|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
revision date: jan. 10, 2007 16 h8s/2194 group , h8s/2194c group , h8s/2194f-ztat?, h8s/2194c f-ztat? hardware manual rev.3.00 rej09b0328-0300 renesas 16-bit single-chip microcomputer h8s family/h8s/2100 series h8s/2194 hd6432194 HD64F2194 h8s/2193 hd6432193 h8s/2192 hd6432192 h8s/2191 hd6432191 h8s/2194c hd6432194c HD64F2194c h8s/2194b hd6432194b h8s/2194a hd6432194a
rev.3.00 jan. 10, 2007 page ii of xxxvi rej09b0328-0300 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 g rants any license to any intellectual property ri g hts or any other ri g hts of renesas or any third party with respect to the information in this document. 2. renesas shall have no liability for dama g es or infrin g ement of any intellectual property or other ri g hts arisin g out of the use of any information in this document, includin g , but not limited to, product data, dia g rams, charts, pro g rams, al g orithms, and application circuit examples. 3. you should not use the products or the technolo g y 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 exportin g the products or technolo g y described herein, you should follow the applicable export control laws and re g ulations, and procedures required by such laws and re g ulations. 4. all information included in this document such as product data, dia g rams, charts, pro g rams, al g orithms, and application circuit examples, is current as of the date this document is issued. such information, however, is subject to chan g e without any prior notice. before purchasin g or usin g any renesas products listed in this document, please confirm the latest product information with a renesas sales office. also, please pay re g ular and careful attention to additional and different information to be disclosed by renesas such as that disclosed throu g h our website. (http://www.renesas.com ) 5. renesas has used reasonable care in compilin g the information included in this document, but renesas assumes no liability whatsoever for any dama g es incurred as a result of errors or omissions in the information included in this document. 6. when usin g or otherwise relyin g on the information in this document, you should evaluate the information in li g ht of the total system before decidin g about the applicability of such information to the intended application. renesas makes no representations, warranties or g uaranties re g ardin g the suitability of its products for any particular application and specifically disclaims any liability arisin g 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 desi g ned, 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 hi g h 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 considerin g the use of our products for such purposes, please contact a renesas sales office beforehand. renesas shall have no liability for dama g es arisin g out of the uses set forth above. 8. notwithstandin g the precedin g para g raph, you should not use renesas products for the purposes listed below: (1) artificial life support devices or systems (2) sur g ical 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 dama g es arisin g out of the uses set forth in the above and purchasers who elect to use renesas products in any of the fore g oin g applications shall indemnify and hold harmless renesas technolo g y corp., its affiliated companies and their officers, directors, and employees a g ainst any and all dama g es arisin g out of such applications. 9. you should use the products described herein within the ran g e specified by renesas, especially with respect to the maximum ratin g , operatin g supply volta g e ran g e, movement power volta g e ran g e, heat radiation characteristics, installation and other product characteristics. renesas shall have no liability for malfunctions or dama g es arisin g out of the use of renesas products beyond such specified ran g es. 10. althou g h 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 g uard a g ainst the possibility of physical injury, and injury or dama g e caused by fire in the event of the failure of a renesas product, such as safety desi g n for hardware and software includin g but not limited to redundancy, fire control and malfunction prevention, appropriate treatment for a g in g de g radation or any other applicable measures. amon g 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 swallowin g by infants and small children is very hi g h. you should implement safety measures so that renesas products may not be easily detached from your products. renesas shall have no liability for dama g es arisin g 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 re g ardin g the information contained in this document, renesas semiconductor products, or if you have any other inquiries. notes re g ardin g these materials rev.3.00 jan. 10, 2007 page iii of xxxvi rej09b0328-0300 general precautions in the ha ndling of mpu/mcu products the following usage notes are applicable to all mpu/mcu products from renesas. for detailed usage notes on the products covered by this manual, re fer to the relevant sections of the manual. if the descriptions under general precautions in the handling of mpu/mcu products and in the body of the manual differ from each other, the description in the body of the manual takes precedence. 1. handling of unused pins handle unused pins in accord with the directions given under handling of unused pins in the manual. ? the input pins of cmos products are generally in the high-impedance state. in operation with an unused pin in the open-circuit state, extra electromagnetic noise is induced in the vicinity of lsi, an associated shoot-through current flows internally, and malfunctions may occur due to the false recognition of the pin state as an input signal. unused pins should be handled as described under handling of unused pins in the manual. 2. processing at power-on the state of the product is undefined at the moment when power is supplied. ? the states of internal circuits in the lsi are indeterminate and the states of register settings and pins are undefined at the moment when power is supplied. in a finished product where the reset signal is applied to the external reset pin, the states of pins are not guaranteed from the moment when power is supplied until the reset process is completed. in a similar way, the states of pins in a product that is reset by an on-chip power-on reset function are not guaranteed from the moment when power is supplied until the power reaches the level at which resetting has been specified. 3. prohibition of access to reserved addresses access to reserved addresses is prohibited. ? the reserved addresses are provided for the possible future expansion of functions. do not access these addresses; the correct operation of lsi is not guaranteed if they are accessed. 4. clock signals after applying a reset, only release the reset line after the operating clock signal has become stable. when switching the clock signal during program execution, wait until the target clock signal has stabilized. ? when the clock signal is generated with an external resonator (or from an external oscillator) during a reset, ensure that the reset line is only released after full stabilization of the clock signal. moreover, when switching to a clock signal produced with an external resonator (or by an external oscillator) while program execution is in progress, wait until the target clock signal is stable. 5. differences between products before changing from one product to another, i.e. to one with a different type number, confirm that the change will not lead to problems. ? the characteristics of mpu/mcu in the same group but having different type numbers may differ because of the differences in internal memory capacity and layout pattern. when changing to products of different type numbers, implement a system-evaluation test for each of the products. rev.3.00 jan. 10, 2007 page iv of xxxvi rej09b0328-0300 rev.3.00 jan. 10, 2007 page v of xxxvi rej09b0328-0300 main revisions for this edition item page revision (see manual for details) all ? ? notification of change in company name amended (before) hitachi, ltd. (after) renesas technology corp. ? product naming convention amended (before) h8s/2194 series (after) h8s/2194 group (before) h8s/2194c series (after) h8s/2194c group 2.8.1 overview figure 2.15 state transitions 54 figure 2.15 amended res = high sleep instruction with lson = 0, tma3 = 0, ssby = 0 4.2.3 timer register a (tma) 79 table amended ? timer a counts -based prescalar (pss) divided clock pulses ? timer a counts w-based prescalar (psw) divided clock pulses 4.6.1 standby mode 83 description amended ? ram as well as functions of the sci1, timer x1 ? 4.6.2 clearing standby mode 83 (1) clearing with an interrupt ... in bits sts2 to sts0 in sbycr, stable clocks are supplied ... 6.2.6 port mode register (pmr1) 106 table amended p1n/ irqn pin functions as the irqn input pin 7.2.5 register configuration table 7.3 flash memory registers 132 access size description deleted from table 7.3 7.4.1 boot mode 143 (1) automatic sci bit rate adjustment description amended ? bit rate should be set to (4800, or 9600) bps. ? 8.4.1 boot mode 191 (1) automatic sci bit rate adjustment description amended ? bit rate should be set to (4800, or 9600) bps. ? 8.5 programming/erasing flash memory 195 description amended ? psu2, esu2, p2, e2, pv2, and ev2 bits in flmcr2. ? rev.3.00 jan. 10, 2007 page vi of xxxvi rej09b0328-0300 item page revision (see manual for details) 8.5.1 program mode (n = 1 for addresses h'00000 to h'1ffff and n= 2 for addresses h'20000 to h'3ffff) 195 section 8.5.1 title amended 8.5.3 erase mode (n = 1 for addresses h'00000 to h'1ffff and n = 2 for addresses h'20000 to h'3ffff) 198 description amended ? is switched to erase mode by setting the en bit in flmcrn. the time during ... 8.8.1 program mode setting 205 description amended ? renesas technology microcomputer device type with 256- kbyte on-chip flash memory. ? 8.8.3 programmer mode operation table 8.10 settings for each operating mode in programmer mode 206 table 8.10 amended pin names mode fwe ce c e oe o e we w e fo0 to fo7 fa0 to fa17 read h or l l l h data output ain output disable h or l l h h hi-z x command write h or l * 3 l h l data input ain * 2 chip disable * 1 h or l h x x hi-z x 8.8.5 auto-program mode 211 description amended (d) ? do not perform transfer after the third cycle. 11.1.2 port input table 11.1 port functions 236 pin description for port 0 in table 11.1 amended p07/an7 to p00/an0 11.1.3 mos pull-up transistors figure 11.1 circuit configuration of pin with mos pull-up transistor 237 figure 11.1 amended input data 11.2.4 pin states table 11.4 port 0 pin states 240 table 11.4 amended p07/an7 to p00/an0 11.4.1 overview 248 (1) port mode register 2 (pmr2) description amended port mode register 2 (pmr2) controls switching ? if the sck1, sck2, si1, and si2 input pins are set, ? rev.3.00 jan. 10, 2007 page vii of xxxvi rej09b0328-0300 item page revision (see manual for details) 11.10.2 register configuration 284 (1) port mode register 8 (pmr8) description amended bit 1 ? p81/excap pin switching (pmr81): pmr81 sets whether the p81/excap pin is used as a p81 i/o pin or an excap pin for the capstan external synchronous signal input. 15.2.1 timer l mode register (lmr) 324 bit figure amended bits 3 to 0 (before) imr (after) lmr 325 bits 2 to 0 ? clock selection bit table amended (before) r2 (after) lmr2 16.2.2 timer r mode register 2 (tmrm2) 335 bit 7 ? selection of capture signals of the tmru-2 (lat) bit table amended captures at the rising edge of the cfg 17.6 exemplary uses of the timer x1 379 description amended (2) each time a comparing match occurs, the olvla bit and ? 22.1.2 block diagram figure 22.1 block diagram of prescalar unit 424 figure 22.1 amended (before) 2 8 (after) 2 0 23.2.5 serial mode register (smr1) 440 bit 4 ? parity mode (o/ e ) bit table amended odd parity * 2 23.2.7 serial status register (ssr1) 448 bit 4 ? parity error (per) bit table amended (before) bit 4 (after) bit 3 23.2.8 bit rate register (brr1) table 23.4 brr1 settings for various bit rates (clock synchronous mode) 452 table 23.4 amended operating frequency (mhz) 24 8 bit rate (bits/s) n n n n 110 70 ? ? 250 2 124 2 249 3 124 500 1 249 2 124 2 249 3 nn table 23.6 maximum bit rate with external clock input (asynchronous mode) 455 table 23.6 amended (mhz) external input clock (mhz) maximum bit rate (bits/s) 6 1.500 0 937 50 rev.3.00 jan. 10, 2007 page viii of xxxvi rej09b0328-0300 item page revision (see manual for details) 23.2.9 serial interface mode register (scmr1) 457 bit 0 ? serial communication interface mode select (smif) bit table amended normal sci1 mode 23.3.4 operation in clock synchronous mode 478 (2) clock description amended ? for details on sci1 clock source selection, ? 23.5 usage notes 488 (1) relation between writes to tdr1 and the tdre flag description amended ? tdr1 to tsr. when the sci1 transfers data from tdr1 to tsr, ? 24.2.4 serial control status register 2 (scsr2) 499 bit 1 ? abort flag (abt) description amended ? while this bit is set to 1. resume transfer after clearing to 0. bit 0 ? start flag (stf) description amended ? other than the scsr2 and serial data buffer (32 bytes) are retained. 24.3.3 data transfer operations 504 (1) sci2 initialization description amended (2) the sci2 pin is also used as a port. switching of a port is performed on pmr3. 505 description amended ? while pmr30 of pmr3 is set to 1, transmission is ? 25.2.5 i 2 c bus control register (iccr) 521 bit 7 ? i 2 c bus interface enable (ice) description amended i 2 c bus interface module enabled for transfer operations (pins scl and sda are driving the bus) ... 25.2.7 serial/timer control register (stcr) 533 bit 5 ? i 2 c controller reset (iicrst) description amended ... therefore, be sure to clear the iicrst bit after setting it. 25.3.2 master transmit operation 537 description amended [11] ?when there is data to be transmitted, go to the step [9] to continue next transmission. ? rev.3.00 jan. 10, 2007 page ix of xxxvi rej09b0328-0300 item page revision (see manual for details) 25.3.3 master receive operation figure 25.7 example of master receive mode operation timing (mls = ackb = 0, wait = 1) 540 figure 25.7 amended [4] iric clearance 25.3.8 sample flowcharts figure 25.14 flowchart for master transmit mode (example) 548 figure 25.14 amended yes clear iric in iccr write transmit data in icdr read iric in iccr no iric = 1? [5] wait for a start condition g eneration [6] set transmit data for the first byte (slave address + r/ w ). (after writin g icdr, clear iric immediately) 25.4 usage notes 554 description amended (1) ? then issue the instruction that generates the stop condition. note that the scl may briefly remain at a high level immediately after bbsy is cleared to 0. 559 to 566 (10) notes on wait function (11) notes on icdr reads and iccr access in slave transmit mode (12) notes on trs bit setting in slave mode (13) notes on arbitration lost in master mode (14) notes on interrupt occurrence after ackb reception (15) notes on trs bit setting and icdr register access description added 28.2.3 pin configuration 610 description amended ? p6n, p7n, p80 to p83, and ps1 to ps4 are general-purpose ports. ? 28.3.4 register descriptions 626 (5) reference period mode register 2 (rfm2) description amended ? signal generators. bits 6 to 1 are reserved. ? rev.3.00 jan. 10, 2007 page x of xxxvi rej09b0328-0300 item page revision (see manual for details) 28.11.2 block diagram figure 28.38 block diagram of digital filter circuit 713 figure 28.38 amended d buffer circuit a, b, g, etc. calculation buffer coefficient re g ister constant re g ister 28.11.5 register descriptions 721 (6) capstan system digital filter control register (cfic) bit figure amended 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 0 6 0 7 ? ? r/w r/w r/(w) cpha r/(w) * crov czpon czson csg2 csg1 csg0 1 bit : initial value : r/w : 28.12.5 additional v pulse signal 732 description amended additional v pulses when sync signal is not detected: ? depending on the hrtr and hpwr setting, with resultant discontinuity. ... 28.13.5 register descriptions 740 (2) ctl mode register (ctlm) description amended bits 7 and 6: record/playback mode bits (asm, rec/ pb ): 745 (6) rec-ctl duty data register 4 (rcdr4) description amended ? rcdr4 = t4 s/64 s is the servo clock frequency (= f osc /2) in hz, and t4 is ? 746 (7) rec-ctl duty data register 5 (rcdr5) description amended ? rcdr5 = t5 s/64 s is the servo clock frequency (= f osc /2) in hz, and t5 is ? 747 bit 0 ? duty i/o register (di/o) description amended ? the viss control circuit. in viss record or rewrite mode ? rev.3.00 jan. 10, 2007 page xi of xxxvi rej09b0328-0300 item page revision (see manual for details) 28.13.6 operation figure 28.50 example of ctlm switchover timing (when phase control is performed by ref30p and dvcfg2 in rec mode) 751 figure 28.50 amended (before) pdcr3 (after) pcdr3 figure 28.51 example of ctlm switchover timing (when phase control is performed by cref and dvcfg2 in rec mode) 752 figure 28.51 amended ta is the interval calculated from rcdr3. ? 28.18.9 ctl output section table 28.21 rec-ctl duty register and ctl outputs 762 table 28.21 amended (before) 65.5 0.5 % (after) 62.5 0.5 % 28.15.6 noise detection 790 (1) example of setting description amended hpwr3 - 0 = h'b 29.2.7 flash memory characteristics table 29.12 flash memory characteristics (preliminary) 824 table 29.12 amended item symbol min typ max unit test conditions erasin g time * 1 * 3 * 5 t e 100 1200 ms/ block repro g rammin g count n wec x 100 * 7 10000 * 8 ? times data retention time * 9 t drp 10 ? ?? ? years wait time after swe-bit settin g * 1 10 s at pro g rammin g 825 notes 7 to 9 added notes: 7. minimum number of times for which all characteristics are guaranteed after rewriting (guarantee range is 1 to minimum value). 8. reference value for 25c (as a guideline, rewriting should normally function up to this value). 9. data retention characteristic when rewriting is performed within the specification range, including the minimum value. rev.3.00 jan. 10, 2007 page xii of xxxvi rej09b0328-0300 item page revision (see manual for details) a.1 instructions table a.1 list of instruction set 856 (7) system control instructions in table a.1 amended trapa #xx:2 rte sleep ldc #xx:8,ccr ldc #xx:8,exr ldc rs,ccr ldc rs,exr ldc @ers,ccr ldc @ers,exr ldc @(d:16,ers),ccr ldc @(d:16,ers),exr ldc @(d:32,ers),ccr ldc @(d:32,ers),exr ldc @ers+,ccr ldc @ers+,exr ldc @aa:16,ccr ldc @aa:16,exr ldc @aa:32,ccr ldc @aa:32,exr stc ccr,rd stc exr,rd stc ccr,@erd stc exr,@erd stc ccr,@(d:16,erd) stc exr,@(d:16,erd) stc ccr,@(d:32,erd) stc exr,@(d:32,erd) stc ccr,@-erd stc exr,@-erd stc ccr,@aa:16 stc exr,@aa:16 stc ccr,@aa:32 stc exr,@aa:32 andc #xx:8,ccr andc #xx:8,exr orc #xx:8,ccr orc #xx:8,exr xorc #xx:8,ccr xorc #xx:8,exr nop trapa rte sleep ldc stc andc orc xorc nop mnemonic advanced mode 5 [9] 2 1 2 1 1 3 3 4 4 6 6 4 4 4 4 5 5 1 1 3 3 4 4 6 6 4 4 4 4 5 5 1 2 1 2 1 2 1 8 [9] no of execution states * 1 a.4 number of execution states 872 description amended ? for each instruction of the h8s/2000 cpu. table a.5 ? table a.4 number of states required for each execution status (cycle) 873 table a.4 amended target of access on-chip supporting module execution status (cycle) on-chip memory 8-bit bus 16-bit bu s byte data access s l 2 2 2 word data access s m 4 internal operation s n 1 1 1 a.6 change of condition codes table a.7 change of condition codes 902 table a.7 amended (before) c=d0 (in case of 1 bit), c=d-1 (in case of 2 bits) (after) c=d0 (in case of 1 bit), c=d1 (in case of 2 bits) rev.3.00 jan. 10, 2007 page xiii of xxxvi rej09b0328-0300 item page revision (see manual for details) b.2 function list 918 h'd029: cfic: digital filter figure amended 0 0 1 0 r/w 2 0 r/w r/w csg2 csg1 csg0 capstan system g ain control bit csg2 csg1 csg0 description 0 0 0 1 1 2 1 0 4 1 8 1 0 0 16 1 ( 32) * 1 0 ( 64) * 1 invalid (do not set) note: * settin g optional 919 h'd031: dfpr: drum error detector h'd033: dfer: drum error detector subheading deleted 919 h'd032: dfer: drum error detector note * added note: * note that only detected error data can be read. 920 h'd035: dfrudr: drum error detector h'd037: dfrldr: drum error detector subheading deleted 927 h'd060: hsm1: hsw timing generator figure amended fifo1 overwrite fla g 0 normal operation 1 data is written to fifo2 while it is full. write 0 to clear the fla g . 941 table amended video ff signal turns counter set on rev.3.00 jan. 10, 2007 page xiv of xxxvi rej09b0328-0300 item page revision (see manual for details) b.2 function list 954 h'd0e2: scr2: 32-byte buffer sci2 figure amended transfer data interval select bits gap1 gap0 transfer data interval 0 0 no interval 0 1 8-clock interval 1 0 24-clock interval 1 1 56-clock interval transfer clock select bits cks2 cks1 cks0 sck2 pin clock source tr ansfer clock frequency = 10 mhz = 5 mhz 0 0 0 sprescaler s /256 25.6 s 51.2 s 0 0 1 /64 6.4 s 12.8 s 0 1 0 /32 3.2 s 6.4 s 0 1 1 /16 1.6 s 3.2 s 1 0 0 /8 0.8 s 1.6 s 1 0 1 /4 0.4 s 0.8 s 1 1 0 /2 ? 0.4 s 1 1 1 external clock ? ? ? prescaler frequency division rate sck2 output sck2 input 956 h'd100: iter: timer x1 figure amended ofv interrupt request (fovi) is disabled ofv interrupt request (fovi) is enabled 0 1 output compare interrupt enable bit 962 h'd100: tmb: timer b figure amended clock select bit count at rising/falling edge of external event (tmbi) * 984 h'd14c: ssr1: sci1 figure amended parity error (before) (even or odd) specified by the o/e bit in smr1 ? 2 (after) (even or odd) specified by the o/ e bit in smr1 ? 2 986 h'd158: iccr: iic bus interface figure amended i 2 c bus interface enable i 2 c bus interface module enabled for transfer operation (pins scl and sda are driving the bus) rev.3.00 jan. 10, 2007 page xv of xxxvi rej09b0328-0300 item page revision (see manual for details) b.2 function list 1000 h'ffd4: pcr4: i/o port figure amended 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 0 7 0 w w w w 6 pcr44 pcr43 pcr42 pcr41 pcr40 pcr47 pcr46 pcr45 p4n pin functions as input port p4n pin functions as output port 0 1 bit : initial value : r/w : note: n = 7 to 0 1002 h'ffdc: pmr5: i/o port figure amended p52/trig pin function select bit p52/tmbi pin functions as tmbi input port 1004 h'ffe3: pur3: i/o port figure amended 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 0 7 0 r/w r/w r/w r/w 6 pur34 pur33 pur32 pur31 pur30 pur37 pur36 pur35 p3n pin has no pull-up mos transistor p3n pin has pull-up mos transistor 0 1 bit : initial value : r/w : note: n = 7 to 0 1010 table amended (before) irq0eg2 (after) irq0eg0 c.1 pin circuit diagrams table c.1 pin circuit diagrams 1019 to 1024 circuit diagram description amended pur1n ? pcr1n pur17 ? pcr17 pur20 ? pcr20 pur21 ? pcr21 pur22 ? pcr22 pur2n ? pcr2n pur26 ? pcr26 pur25 ? pcr25 pur27 ? pcr27 pur30 ? pcr30 pur3n ? pcr3n 1024 circuit diagram description amended (before) our: (after) out: 1025 pin name description amended p42/ftib p46/ftob g. external dimensions figure g.1 external dimensions (fp-112) 1037 figure g.1 replaced rev.3.00 jan. 10, 2007 page xvi of xxxvi rej09b0328-0300 all trademarks and registered trademarks are the property of their respective owners. rev.3.00 jan. 10, 2007 page xvii of xxxvi rej09b0328-0300 contents section 1 overview ............................................................................................................. 1 1.1 overview....................................................................................................................... .... 1 1.2 internal block diagram..................................................................................................... 6 1.3 pin arrangement and functions........................................................................................ 7 1.3.1 pin arrangement .................................................................................................. 7 1.3.2 pin functions ....................................................................................................... 8 1.4 differences between h8s/2194c group and h8s/2194 group........................................ 14 section 2 cpu ...................................................................................................................... 15 2.1 overview....................................................................................................................... .... 15 2.1.1 features................................................................................................................ 15 2.1.2 differences between h8s/2600 cpu and h8s/2000 cpu .................................. 16 2.1.3 differences from h8/300 cpu............................................................................. 17 2.1.4 differences from h8/300h cpu.......................................................................... 17 2.2 cpu operating modes ...................................................................................................... 18 2.2.1 normal mode....................................................................................................... 18 2.2.2 advanced mode ................................................................................................... 20 2.3 address space .................................................................................................................. . 23 2.4 register configuration...................................................................................................... 24 2.4.1 overview.............................................................................................................. 24 2.4.2 general registers ................................................................................................. 25 2.4.3 control registers ................................................................................................. 26 2.4.4 initial register values.......................................................................................... 28 2.5 data formats ................................................................................................................... .. 28 2.5.1 general register data formats ............................................................................ 29 2.5.2 memory data formats ......................................................................................... 31 2.6 instruction set ................................................................................................................ ... 32 2.6.1 overview.............................................................................................................. 32 2.6.2 instructions and a ddressing m odes ..................................................................... 34 2.6.3 table of instructions classified by function ....................................................... 35 2.6.4 basic instruction formats .................................................................................... 45 2.6.5 notes on use of bit-manipulation instructions ................................................... 46 2.7 addressing modes and effective address calculation ..................................................... 46 2.7.1 addressing mode ................................................................................................. 46 2.7.2 effective address calculation.............................................................................. 49 2.8 processing states.............................................................................................................. . 53 2.8.1 overview.............................................................................................................. 53 rev.3.00 jan. 10, 2007 page xviii of xxxvi rej09b0328-0300 2.8.2 reset state ........................................................................................................... 54 2.8.3 exception-handling state .................................................................................... 55 2.8.4 program execution state...................................................................................... 56 2.8.5 power-down state ............................................................................................... 57 2.9 basic timing................................................................................................................... .. 58 2.9.1 overview.............................................................................................................. 58 2.9.2 on-chip memory (rom, ram) ......................................................................... 58 2.9.3 on-chip supporting modul e access timing ...................................................... 59 2.10 usage note..................................................................................................................... ... 59 section 3 mcu operating modes .................................................................................. 61 3.1 overview....................................................................................................................... .... 61 3.1.1 operating mode selection ................................................................................... 61 3.1.2 register configuration......................................................................................... 61 3.2 register descriptions ........................................................................................................ 6 2 3.2.1 mode control register (mdcr) ......................................................................... 62 3.2.2 system control register (syscr) ...................................................................... 62 3.3 operating mode descriptions ........................................................................................... 63 3.3.1 mode 1 ................................................................................................................. 63 3.4 address map .................................................................................................................... . 64 section 4 power-down state ............................................................................................ 69 4.1 overview....................................................................................................................... .... 69 4.1.1 register configuration......................................................................................... 73 4.2 register descriptions ........................................................................................................ 7 4 4.2.1 standby control regist er (sbycr) .................................................................... 74 4.2.2 low-power control register (lpwrcr) ........................................................... 76 4.2.3 timer register a (tma) ..................................................................................... 78 4.2.4 module stop control regi ster (mstpcr) .......................................................... 79 4.3 medium-speed mode........................................................................................................ 80 4.4 sleep mode ..................................................................................................................... .. 81 4.4.1 sleep mode .......................................................................................................... 81 4.4.2 clearing sleep mode............................................................................................ 81 4.5 module stop mode ........................................................................................................... 82 4.5.1 module stop mode .............................................................................................. 82 4.6 standby mode ................................................................................................................... 83 4.6.1 standby mo de ...................................................................................................... 83 4.6.2 clearing sta ndby mode ....................................................................................... 83 4.6.3 setting oscillation settling time af ter clearing standby mode.......................... 83 4.7 watch mode..................................................................................................................... . 85 rev.3.00 jan. 10, 2007 page xix of xxxvi rej09b0328-0300 4.7.1 watch mode......................................................................................................... 85 4.7.2 clearing watch mode .......................................................................................... 85 4.8 subsleep mode.................................................................................................................. 86 4.8.1 subsleep mode..................................................................................................... 86 4.8.2 clearing subsleep mode ...................................................................................... 86 4.9 subactive mode................................................................................................................. 87 4.9.1 subactive mode ................................................................................................... 87 4.9.2 clearing subactive mode..................................................................................... 87 4.10 direct tr ansition .............................................................................................................. . 88 4.10.1 overview of direct transition ............................................................................. 88 section 5 exception handling ......................................................................................... 89 5.1 overview....................................................................................................................... .... 89 5.1.1 exception handling types and priority............................................................... 89 5.1.2 exception handling operation............................................................................. 90 5.1.3 exception sources and vector table ................................................................... 90 5.2 reset.......................................................................................................................... ........ 92 5.2.1 overview.............................................................................................................. 92 5.2.2 reset sequence .................................................................................................... 92 5.2.3 interrupts after reset............................................................................................ 93 5.3 interrupts ..................................................................................................................... ...... 94 5.4 trap instruction............................................................................................................... .. 95 5.5 stack status after exception handling.............................................................................. 96 5.6 notes on use of the stack ................................................................................................. 97 section 6 interrupt controller .......................................................................................... 99 6.1 overview....................................................................................................................... .... 99 6.1.1 features................................................................................................................ 99 6.1.2 block diagram ..................................................................................................... 100 6.1.3 pin configuration................................................................................................. 101 6.1.4 register configuration......................................................................................... 101 6.2 register descriptions ........................................................................................................ 1 02 6.2.1 system control register (syscr) ...................................................................... 102 6.2.2 interrupt control registers a to d (icra to icrd) ........................................... 103 6.2.3 irq enable register (ienr) ............................................................................... 104 6.2.4 irq edge select registers (iegr) ...................................................................... 104 6.2.5 irq status register (irqr) ................................................................................ 105 6.2.6 port mode register (pmr1) ................................................................................ 106 6.3 interrupt sources .............................................................................................................. . 108 6.3.1 external interrupts ............................................................................................... 108 rev.3.00 jan. 10, 2007 page xx of xxxvi rej09b0328-0300 6.3.2 internal interrupts ................................................................................................ 110 6.3.3 interrupt exception vector table ........................................................................ 110 6.4 interrupt operation............................................................................................................ 113 6.4.1 interrupt control modes and interrupt operation................................................ 113 6.4.2 interrupt control mode 0 ..................................................................................... 115 6.4.3 interrupt control mode 1 ..................................................................................... 117 6.4.4 interrupt exception handling sequence .............................................................. 120 6.4.5 interrupt respons e times .................................................................................... 121 6.5 usage notes .................................................................................................................... .. 122 6.5.1 contention between interrupt ge neration and disabling..................................... 122 6.5.2 instructions that di sable interrupts..................................................................... 123 6.5.3 interrupts during execution of eepmov instruction.......................................... 123 6.5.4 when nmi is disabled ........................................................................................ 123 section 7 rom (h8s/2194 group) ................................................................................ 125 7.1 overview....................................................................................................................... .... 125 7.1.1 block diagram..................................................................................................... 125 7.2 overview of flash memory .............................................................................................. 126 7.2.1 features................................................................................................................ 126 7.2.2 block diagram..................................................................................................... 127 7.2.3 flash memory operating modes ......................................................................... 128 7.2.4 pin configuration................................................................................................. 132 7.2.5 register configuration......................................................................................... 132 7.3 flash memory register descriptions................................................................................ 133 7.3.1 flash memory control register 1 (flmcr1)..................................................... 133 7.3.2 flash memory control register 2 (flmcr2)..................................................... 136 7.3.3 erase block registers 1 a nd 2 (ebr1, ebr2) .................................................... 138 7.3.4 serial/timer control register (stcr) ................................................................ 139 7.4 on-board programming modes........................................................................................ 140 7.4.1 boot m ode ........................................................................................................... 141 7.4.2 user program mode............................................................................................. 146 7.5 programming/erasing flash memory ............................................................................... 147 7.5.1 program mo de ..................................................................................................... 147 7.5.2 program-verify mode.......................................................................................... 148 7.5.3 erase mode .......................................................................................................... 150 7.5.4 erase-verify mode .............................................................................................. 150 7.6 flash memory protection.................................................................................................. 152 7.6.1 hardware protection ............................................................................................ 152 7.6.2 software protection.............................................................................................. 153 7.6.3 error protection.................................................................................................... 153 rev.3.00 jan. 10, 2007 page xxi of xxxvi rej09b0328-0300 7.7 interrupt handling when progra mming/erasing flash memory....................................... 155 7.8 flash memory prog rammer mode .................................................................................... 156 7.8.1 programmer mode setting ................................................................................... 156 7.8.2 socket adapters and memory map...................................................................... 156 7.8.3 programmer mode operation .............................................................................. 157 7.8.4 memory read mode ............................................................................................ 158 7.8.5 auto-program mode ............................................................................................ 161 7.8.6 auto-erase mode ................................................................................................. 163 7.8.7 status read mode ................................................................................................ 164 7.8.8 status po lling ....................................................................................................... 166 7.8.9 programmer mode transition time..................................................................... 166 7.8.10 notes on memory programming......................................................................... 167 7.9 flash memory programming a nd erasing precautions ..................................................... 168 7.10 note on switching from f-ztat version to mask rom version .................................. 170 section 8 rom (h8s/2194c group) ............................................................................. 171 8.1 overview....................................................................................................................... .... 171 8.1.1 block diagram ..................................................................................................... 171 8.2 overview of flash memory .............................................................................................. 172 8.2.1 features................................................................................................................ 172 8.2.2 block diagram ..................................................................................................... 173 8.2.3 flash memory operating modes ......................................................................... 174 8.2.4 pin configuration................................................................................................. 178 8.2.5 register configuration......................................................................................... 178 8.3 flash memory register descriptions................................................................................ 179 8.3.1 flash memory control register 1 (flmcr1)..................................................... 179 8.3.2 flash memory control register 2 (flmcr2)..................................................... 183 8.3.3 erase block regist ers 1 (ebr 1) .......................................................................... 186 8.3.4 erase block regist ers 2 (ebr 2) .......................................................................... 186 8.3.5 serial/timer control register (stcr) ................................................................ 187 8.4 on-board programming modes ........................................................................................ 188 8.4.1 boot m ode ........................................................................................................... 189 8.4.2 user program mode............................................................................................. 193 8.5 programming/erasing flash memory ............................................................................... 195 8.5.1 program mode (n = 1 for addresse s h'00000 to h' 1ffff and n = 2 for addresses h'20000 to h'3ffff) .......................................................................... 195 8.5.2 program-verify mode (n = 1 for addresses h'00000 to h'1ffff and n = 2 for addresses h'20000 to h'3 ffff) .................................................................... 196 8.5.3 erase mode (n = 1 for addresses h' 00000 to h'1 ffff and n = 2 for addresses h'20000 to h' 3ffff) ........................................................................................... 198 rev.3.00 jan. 10, 2007 page xxii of xxxvi rej09b0328-0300 8.5.4 erase-verify mode (n = 1 for a ddresses h'00000 to h' 1ffff and n = 2 for addresses h'20000 to h'3 ffff) .................................................................... 198 8.6 flash memory protection.................................................................................................. 200 8.6.1 hardware protection ............................................................................................ 200 8.6.2 software protection.............................................................................................. 201 8.6.3 error protection.................................................................................................... 202 8.7 interrupt handling when progra mming/erasing flash memory....................................... 204 8.8 flash memory prog rammer mode .................................................................................... 205 8.8.1 programmer mode setting................................................................................... 205 8.8.2 socket adapters and memory map ..................................................................... 205 8.8.3 programmer mode operation .............................................................................. 206 8.8.4 memory read mode ............................................................................................ 207 8.8.5 auto-program mode ............................................................................................ 211 8.8.6 auto-erase mode................................................................................................. 213 8.8.7 status read mode ................................................................................................ 214 8.8.8 status po lling ....................................................................................................... 216 8.8.9 programmer mode transition time .................................................................... 217 8.8.10 notes on memory programming......................................................................... 217 8.9 flash memory programming a nd erasing precautions..................................................... 218 8.10 note on switching from f-ztat version to mask rom version .................................. 220 section 9 ram ..................................................................................................................... 221 9.1 overview....................................................................................................................... .... 221 9.1.1 block diagram..................................................................................................... 221 section 10 clock pulse generator .................................................................................. 223 10.1 overview....................................................................................................................... .... 223 10.1.1 block diagram..................................................................................................... 223 10.1.2 register configuration......................................................................................... 223 10.2 register descriptions ........................................................................................................ 2 24 10.2.1 standby control regist er (sbycr) .................................................................... 224 10.2.2 low-power control register (lpwrcr) ........................................................... 225 10.3 oscilla tor..................................................................................................................... ...... 226 10.3.1 connecting a crystal resonator........................................................................... 226 10.3.2 external clock input............................................................................................ 228 10.4 duty adjustment circuit................................................................................................... 230 10.5 medium-speed clock divider .......................................................................................... 230 10.6 bus master clock sel ection circuit.................................................................................. 230 10.7 subclock oscillator circuit............................................................................................... 231 10.7.1 connecting 32.768 khz crystal resonator.......................................................... 231 rev.3.00 jan. 10, 2007 page xxiii of xxxvi rej09b0328-0300 10.7.2 external clock input ............................................................................................ 232 10.7.3 when subclock is not needed ............................................................................ 232 10.8 subclock waveform shaping circuit................................................................................ 233 10.9 notes on the resonator ..................................................................................................... 233 section 11 i/o port .............................................................................................................. 235 11.1 overview....................................................................................................................... .... 235 11.1.1 port functions ...................................................................................................... 235 11.1.2 port i nput ............................................................................................................. 235 11.1.3 mos pull-up transistors..................................................................................... 237 11.2 port 0......................................................................................................................... ........ 238 11.2.1 overview.............................................................................................................. 238 11.2.2 register configuration......................................................................................... 238 11.2.3 pin functions ....................................................................................................... 240 11.2.4 pin states.............................................................................................................. 240 11.3 port 1......................................................................................................................... ........ 241 11.3.1 overview.............................................................................................................. 241 11.3.2 register configuration......................................................................................... 241 11.3.3 pin functions ....................................................................................................... 245 11.3.4 pin states.............................................................................................................. 246 11.4 port 2......................................................................................................................... ........ 247 11.4.1 overview.............................................................................................................. 247 11.4.2 register configuration......................................................................................... 247 11.4.3 pin functions ....................................................................................................... 251 11.4.4 pin states.............................................................................................................. 253 11.5 port 3......................................................................................................................... ........ 254 11.5.1 overview.............................................................................................................. 254 11.5.2 register configuration......................................................................................... 254 11.5.3 pin functions ....................................................................................................... 258 11.5.4 pin states.............................................................................................................. 260 11.6 port 4......................................................................................................................... ........ 261 11.6.1 overview.............................................................................................................. 261 11.6.2 register configuration......................................................................................... 261 11.6.3 pin functions ....................................................................................................... 263 11.6.4 pin states.............................................................................................................. 266 11.7 port 5......................................................................................................................... ........ 267 11.7.1 overview.............................................................................................................. 267 11.7.2 register configuration......................................................................................... 267 11.7.3 pin functions ....................................................................................................... 270 11.7.4 pin states.............................................................................................................. 271 rev.3.00 jan. 10, 2007 page xxiv of xxxvi rej09b0328-0300 11.8 port 6......................................................................................................................... ........ 272 11.8.1 overview.............................................................................................................. 272 11.8.2 register configuration......................................................................................... 273 11.8.3 pin functions ....................................................................................................... 276 11.8.4 operation ............................................................................................................. 277 11.8.5 pin states ............................................................................................................. 278 11.9 port 7......................................................................................................................... ........ 279 11.9.1 overview.............................................................................................................. 279 11.9.2 register configuration......................................................................................... 279 11.9.3 pin functions ....................................................................................................... 281 11.9.4 pin states ............................................................................................................. 281 11.10 port 8......................................................................................................................... ........ 282 11.10.1 overview.............................................................................................................. 282 11.10.2 register configuration......................................................................................... 282 11.10.3 pin functions ....................................................................................................... 285 11.10.4 pin states ............................................................................................................. 287 section 12 timer a ............................................................................................................. 289 12.1 overview....................................................................................................................... .... 289 12.1.1 features................................................................................................................ 289 12.1.2 block diagram..................................................................................................... 290 12.1.3 register configuration......................................................................................... 290 12.2 descriptions of respective registers................................................................................ 291 12.2.1 timer mode register a (tma)........................................................................... 291 12.2.2 timer counter a (tca) ...................................................................................... 293 12.2.3 module stop control regi ster (mstpcr) .......................................................... 293 12.3 operation ...................................................................................................................... .... 294 12.3.1 operation as the interval timer ........................................................................... 294 12.3.2 operation of the ti mer for cl ocks....................................................................... 294 12.3.3 initializing the counts.......................................................................................... 294 section 13 timer b ............................................................................................................. 295 13.1 overview....................................................................................................................... .... 295 13.1.1 features................................................................................................................ 295 13.1.2 block diagram..................................................................................................... 295 13.1.3 pin configuration................................................................................................. 296 13.1.4 register configuration......................................................................................... 296 13.2 descriptions of respective registers................................................................................ 297 13.2.1 timer mode register b (tmb) ........................................................................... 297 13.2.2 timer counter b (tcb)....................................................................................... 299 rev.3.00 jan. 10, 2007 page xxv of xxxvi rej09b0328-0300 13.2.3 timer load register b (tlb) ............................................................................. 299 13.2.4 port mode register 5 (pmr5) ............................................................................. 299 13.2.5 module stop control regi ster (mstpcr) .......................................................... 300 13.3 operation...................................................................................................................... ..... 301 13.3.1 operation as the interval timer ........................................................................... 301 13.3.2 operation as the auto reload timer ................................................................... 301 13.3.3 event count er ...................................................................................................... 301 section 14 timer j ............................................................................................................... 303 14.1 overview....................................................................................................................... .... 303 14.1.1 features................................................................................................................ 303 14.1.2 block diagram ..................................................................................................... 303 14.1.3 pin configuration................................................................................................. 305 14.1.4 register configuration......................................................................................... 305 14.2 descriptions of respective registers ................................................................................ 306 14.2.1 timer mode register j (tmj) ............................................................................. 306 14.2.2 timer j control register (tmjc) ........................................................................ 309 14.2.3 timer j status register (tmjs)........................................................................... 311 14.2.4 timer counter j (tcj) ......................................................................................... 312 14.2.5 timer counter k (tck) ...................................................................................... 313 14.2.6 timer load register j (tlj)................................................................................ 313 14.2.7 timer load register k (tlk) ............................................................................. 314 14.2.8 module stop control regi ster (mstpcr) .......................................................... 314 14.3 operation...................................................................................................................... ..... 315 14.3.1 8-bit reload timer (tmj-1)................................................................................ 315 14.3.2 8-bit reload timer (tmj-2)................................................................................ 315 14.3.3 remote controlled data transmission ................................................................ 316 section 15 timer l .............................................................................................................. 321 15.1 overview....................................................................................................................... .... 321 15.1.1 features................................................................................................................ 321 15.1.2 block diagram ..................................................................................................... 322 15.1.3 register configuration......................................................................................... 323 15.2 descriptions of respective registers ................................................................................ 324 15.2.1 timer l mode register (lmr)............................................................................ 324 15.2.2 linear time counter (ltc)................................................................................. 326 15.2.3 reload/compare match register (rcr) .............................................................. 326 15.2.4 module stop control regi ster (mstpcr) .......................................................... 326 15.3 operation...................................................................................................................... ..... 327 15.3.1 compare match clear operation ......................................................................... 327 rev.3.00 jan. 10, 2007 page xxvi of xxxvi rej09b0328-0300 section 16 timer r ............................................................................................................. 329 16.1 overview....................................................................................................................... .... 329 16.1.1 features................................................................................................................ 329 16.1.2 block diagram..................................................................................................... 329 16.1.3 pin configuration................................................................................................. 331 16.1.4 register configuration......................................................................................... 331 16.2 descriptions of respective registers................................................................................ 332 16.2.1 timer r mode register 1 (tmrm1)................................................................... 332 16.2.2 timer r mode register 2 (tmrm2)................................................................... 334 16.2.3 timer r control/status register (tmrcs)......................................................... 337 16.2.4 timer r capture register 1 (tmrcp1) .............................................................. 339 16.2.5 timer r capture register 2 (tmrcp2) .............................................................. 340 16.2.6 timer r load regist er 1 (tmr l1)..................................................................... 340 16.2.7 timer r load regist er 2 (tmr l2)..................................................................... 341 16.2.8 timer r load regist er 3 (tmr l3)..................................................................... 341 16.2.9 module stop control regi ster (mstpcr) .......................................................... 342 16.3 operation ...................................................................................................................... .... 343 16.3.1 reload timer counter equipped w ith capturing func tion tmru-1.................. 343 16.3.2 reload timer counter equipped w ith capturing func tion tmru-2.................. 344 16.3.3 reload counter ti mer tmru-3.......................................................................... 344 16.3.4 mode identification.............................................................................................. 345 16.3.5 reeling controls .................................................................................................. 345 16.3.6 acceleration and braking processes of the capstan motor ................................. 345 16.3.7 slow tracking mono-multi function .................................................................. 346 16.4 interrupt cause................................................................................................................ .. 348 16.5 exemplary settings for re spective functions .................................................................. 349 16.5.1 mode identification.............................................................................................. 349 16.5.2 reeling controls .................................................................................................. 350 16.5.3 slow tracking mono-multi function .................................................................. 350 16.5.4 acceleration and braking processes of the capstan motor ................................. 351 section 17 timer x1 ........................................................................................................... 353 17.1 overview....................................................................................................................... .... 353 17.1.1 features................................................................................................................ 353 17.1.2 block diagram..................................................................................................... 353 17.1.3 pin configuration................................................................................................. 355 17.1.4 register configuration......................................................................................... 356 17.2 descriptions of respective registers................................................................................ 357 17.2.1 free running coun ter (frc)............................................................................... 357 17.2.2 output comparing register a and b (ocra and ocrb).................................. 357 rev.3.00 jan. 10, 2007 page xxvii of xxxvi rej09b0328-0300 17.2.3 input capture register a thro ugh d (icra through icrd)............................. 358 17.2.4 timer interrupt enabling register (tier)........................................................... 360 17.2.5 timer control/status register x (tcsrx) ......................................................... 362 17.2.6 timer control register x (tcrx) ...................................................................... 366 17.2.7 timer output comparing cont rol register (tocr) ........................................... 368 17.2.8 module stop control regi ster (mstpcr) .......................................................... 371 17.3 operation...................................................................................................................... ..... 372 17.3.1 operation of the timer x1................................................................................... 372 17.3.2 counting timing of the frc ............................................................................... 373 17.3.3 output comparing signal outputting timing ..................................................... 374 17.3.4 frc clearing timing .......................................................................................... 374 17.3.5 input capture signal inputting timing ................................................................ 375 17.3.6 input capture flag (icfa thro ugh icfd) setting up timing............................. 376 17.3.7 output comparing flag (ocfa a nd ocfb) setting up timing ........................ 377 17.3.8 overflow flag (cvf) setting up timing............................................................ 377 17.4 operation mode of the timer x1...................................................................................... 378 17.5 interrupt causes ............................................................................................................... . 378 17.6 exemplary uses of the timer x1...................................................................................... 379 17.7 precautions when using the timer x1 ............................................................................. 380 17.7.1 competition between writing and clearing with the frc .................................. 380 17.7.2 competition between writing and counting up with the frc ........................... 381 17.7.3 competition between writing and comparing match with the ocr .................. 382 17.7.4 changing over the internal clocks and counter operations................................ 383 section 18 watchdog timer (wdt) .............................................................................. 385 18.1 overview....................................................................................................................... .... 385 18.1.1 features................................................................................................................ 385 18.1.2 block diagram ..................................................................................................... 386 18.1.3 register configuration......................................................................................... 387 18.2 register descriptions ........................................................................................................ 3 88 18.2.1 watchdog timer counte r (wtcnt)................................................................... 388 18.2.2 watchdog timer control/status register (wtcsr) ........................................... 388 18.2.3 system control register (syscr) ...................................................................... 391 18.2.4 notes on register access..................................................................................... 391 18.3 operation...................................................................................................................... ..... 393 18.3.1 watchdog timer op eration ................................................................................. 393 18.3.2 interval timer operation ..................................................................................... 394 18.3.3 timing of setting of over flow flag (ovf) ......................................................... 395 18.4 interrupts ..................................................................................................................... ...... 396 18.5 usage notes .................................................................................................................... .. 396 rev.3.00 jan. 10, 2007 page xxviii of xxxvi rej09b0328-0300 18.5.1 contention between watchdog timer counter (wtcnt) write and increment 396 18.5.2 changing value of cks2 to cks0...................................................................... 397 18.5.3 switching between watchdog timer mode and interval timer mode................ 397 section 19 8-bit pwm ....................................................................................................... 399 19.1 overview....................................................................................................................... .... 399 19.1.1 features................................................................................................................ 399 19.1.2 block diagram..................................................................................................... 399 19.1.3 pin configuration................................................................................................. 400 19.1.4 register configuration......................................................................................... 400 19.2 register descriptions ........................................................................................................ 4 01 19.2.1 bit pwm data registers 0, 1, 2, and 3 (pwr0, pwr1, pwr2, pwr3) ............ 401 19.2.2 8-bit pwm control register (pw8cr) .............................................................. 402 19.2.3 port mode register 3 (pmr3) ............................................................................. 402 19.2.4 module stop control regi ster (mstpcr) .......................................................... 403 19.3 8-bit pwm operation....................................................................................................... 404 section 20 12-bit pwm .................................................................................................... 405 20.1 overview....................................................................................................................... .... 405 20.1.1 features................................................................................................................ 405 20.1.2 block diagram..................................................................................................... 406 20.1.3 pin configuration................................................................................................. 407 20.1.4 register configuration......................................................................................... 407 20.2 register descriptions ........................................................................................................ 4 08 20.2.1 12-bit pwm control registers (cpwcr, dpwcr) .......................................... 408 20.2.2 12-bit pwm data registers (cpwdr, dpwdr) .............................................. 410 20.2.3 module stop control regi ster (mstpcr) .......................................................... 411 20.3 operation ...................................................................................................................... .... 412 20.3.1 output waveform ................................................................................................ 412 section 21 14-bit pwm .................................................................................................... 415 21.1 overview....................................................................................................................... .... 415 21.1.1 features................................................................................................................ 415 21.1.2 block diagram..................................................................................................... 416 21.1.3 pin configuration................................................................................................. 416 21.1.4 register configuration......................................................................................... 417 21.2 register descriptions ........................................................................................................ 4 18 21.2.1 pwm control register (pwcr).......................................................................... 418 21.2.2 pwm data registers u and l (pwdru, pwdrl)............................................ 419 21.2.3 module stop control regi ster (mstpcr) .......................................................... 420 rev.3.00 jan. 10, 2007 page xxix of xxxvi rej09b0328-0300 21.3 14-bit pwm operation ..................................................................................................... 421 section 22 prescalar unit .................................................................................................. 423 22.1 overview....................................................................................................................... .... 423 22.1.1 features................................................................................................................ 423 22.1.2 block diagram ..................................................................................................... 424 22.1.3 pin configuration................................................................................................. 425 22.1.4 register configuration......................................................................................... 425 22.2 registers...................................................................................................................... ...... 426 22.2.1 input capture regist er 1 (icr 1) .......................................................................... 426 22.2.2 prescalar unit control/statu s register (pcsr) ................................................... 426 22.2.3 port mode register 1 (pmr1) ............................................................................. 428 22.3 noise cancel circuit ......................................................................................................... 4 29 22.4 operation...................................................................................................................... ..... 429 22.4.1 prescalar s (pss) ................................................................................................. 429 22.4.2 prescalar w (psw) .............................................................................................. 430 22.4.3 stable oscillation wait time count .................................................................... 430 22.4.4 8-bit pwm........................................................................................................... 431 22.4.5 8-bit input capture using ic pin......................................................................... 431 22.4.6 frequency division clock output ....................................................................... 431 section 23 serial communication interface 1 (sci1) ............................................... 433 23.1 overview....................................................................................................................... .... 433 23.1.1 features................................................................................................................ 433 23.1.2 block diagram ..................................................................................................... 435 23.1.3 pin configuration................................................................................................. 436 23.1.4 register configuration......................................................................................... 436 23.2 register descriptions ........................................................................................................ 4 37 23.2.1 receive shift register (rsr) .............................................................................. 437 23.2.2 receive data register (rdr1) ............................................................................ 437 23.2.3 transmit shift register (tsr) ............................................................................. 438 23.2.4 transmit data register (tdr1)........................................................................... 438 23.2.5 serial mode register (smr1).............................................................................. 439 23.2.6 serial control regi ster (scr1)............................................................................ 442 23.2.7 serial status register (ssr1) .............................................................................. 445 23.2.8 bit rate register (brr1) .................................................................................... 449 23.2.9 serial interface mode register (scmr1)............................................................ 456 23.2.10 module stop control regi ster (mstpcr) .......................................................... 457 23.3 operation...................................................................................................................... ..... 458 23.3.1 overview.............................................................................................................. 458 rev.3.00 jan. 10, 2007 page xxx of xxxvi rej09b0328-0300 23.3.2 operation in async hronous m ode ....................................................................... 460 23.3.3 multiprocessor communication function............................................................ 470 23.3.4 operation in clock sy nchronous mode............................................................... 478 23.4 sci1 interrupts................................................................................................................ .. 487 23.5 usage notes .................................................................................................................... .. 488 section 24 serial communication interface 2 (sci2) .............................................. 491 24.1 overview....................................................................................................................... .... 491 24.1.1 features................................................................................................................ 491 24.1.2 block diagram..................................................................................................... 492 24.1.3 pin configuration................................................................................................. 493 24.1.4 register configuration......................................................................................... 493 24.2 register descriptions ........................................................................................................ 4 94 24.2.1 starting address regi ster (star)....................................................................... 494 24.2.2 ending address register (edar) ....................................................................... 494 24.2.3 serial control regi ster 2 (s cr2)......................................................................... 495 24.2.4 serial control status re gister 2 (scsr2)............................................................ 497 24.2.5 module stop control regi ster (mstpcr) .......................................................... 500 24.3 operation ...................................................................................................................... .... 501 24.3.1 clock.................................................................................................................... 501 24.3.2 data transfer format........................................................................................... 501 24.3.3 data transfer operations..................................................................................... 504 24.4 interrupt sources.............................................................................................................. . 508 section 25 i 2 c bus interface (iic) .................................................................................. 509 25.1 overview....................................................................................................................... .... 509 25.1.1 features................................................................................................................ 509 25.1.2 block diagram..................................................................................................... 510 25.1.3 pin configuration................................................................................................. 511 25.1.4 register configuration......................................................................................... 512 25.2 register descriptions ........................................................................................................ 5 13 25.2.1 i 2 c bus data register (icdr) ............................................................................. 513 25.2.2 slave address register (sar)............................................................................. 515 25.2.3 second slave address register (sarx) ............................................................. 516 25.2.4 i 2 c bus mode register (icmr)........................................................................... 517 25.2.5 i 2 c bus control register (iccr)......................................................................... 521 25.2.6 i 2 c bus status register (icsr)............................................................................ 527 25.2.7 serial/timer control register (stcr) ................................................................ 532 25.2.8 module stop control regi ster (mstpcr) .......................................................... 533 25.3 operation ...................................................................................................................... .... 535 rev.3.00 jan. 10, 2007 page xxxi of xxxvi rej09b0328-0300 25.3.1 i 2 c bus data format ............................................................................................ 535 25.3.2 master transmit operation .................................................................................. 536 25.3.3 master receive operation.................................................................................... 539 25.3.4 slave receive operation...................................................................................... 541 25.3.5 slave transmit operation .................................................................................... 544 25.3.6 iric setting timing and scl control ................................................................ 545 25.3.7 noise canceler ..................................................................................................... 547 25.3.8 sample flowcharts............................................................................................... 547 25.3.9 initialization of inte rnal state .............................................................................. 552 25.4 usage notes .................................................................................................................... .. 554 section 26 a/d converter ................................................................................................. 567 26.1 overview....................................................................................................................... .... 567 26.1.1 features................................................................................................................ 567 26.1.2 block diagram ..................................................................................................... 568 26.1.3 pin configuration................................................................................................. 569 26.1.4 register configuration......................................................................................... 570 26.2 register descriptions ........................................................................................................ 5 71 26.2.1 software-triggered a/d result register (adr)................................................. 571 26.2.2 hardware-triggered a/d result register (ahr)................................................ 571 26.2.3 a/d control register (adcr) ............................................................................ 572 26.2.4 a/d control/status register (adcsr) ............................................................... 575 26.2.5 trigger select register (adtsr)........................................................................ 578 26.2.6 port mode register 0 (pmr0) ............................................................................. 578 26.2.7 module stop control regi ster (mstpcr) .......................................................... 579 26.3 interface to bus master ..................................................................................................... 58 0 26.4 operation...................................................................................................................... ..... 581 26.4.1 software-triggered a/d conversion................................................................... 581 26.4.2 hardware- or external-tri ggered a/d conversion.............................................. 582 26.5 interrupt sources .............................................................................................................. . 583 section 27 address trap controller (atc) ................................................................. 585 27.1 overview....................................................................................................................... .... 585 27.1.1 features................................................................................................................ 585 27.1.2 block diagram ..................................................................................................... 585 27.1.3 register configuration......................................................................................... 586 27.2 register descriptions ........................................................................................................ 5 86 27.2.1 address trap control register (atcr) .............................................................. 586 27.2.2 trap address register 2 to 0 (tar2 to tar0) ................................................... 587 27.3 precautions in usage......................................................................................................... 5 88 rev.3.00 jan. 10, 2007 page xxxii of xxxvi rej09b0328-0300 27.3.1 basic operations .................................................................................................. 588 27.3.2 enable .................................................................................................................. 590 27.3.3 bcc instruction..................................................................................................... 590 27.3.4 bsr instruction.................................................................................................... 594 27.3.5 jsr instruction..................................................................................................... 595 27.3.6 jmp instruction.................................................................................................... 596 27.3.7 rts instruction.................................................................................................... 597 27.3.8 sleep instruction ............................................................................................... 597 27.3.9 competing interrupt............................................................................................. 600 section 28 servo circuits .................................................................................................. 605 28.1 overview....................................................................................................................... .... 605 28.1.1 functions.............................................................................................................. 605 28.1.2 block diagram..................................................................................................... 607 28.2 servo port ..................................................................................................................... .... 608 28.2.1 overview.............................................................................................................. 608 28.2.2 block diagram..................................................................................................... 608 28.2.3 pin configuration................................................................................................. 610 28.2.4 register configuration......................................................................................... 611 28.2.5 register descriptions ........................................................................................... 612 28.2.6 dfg/dpg input signals ...................................................................................... 618 28.3 reference signal generators............................................................................................. 619 28.3.1 overview.............................................................................................................. 619 28.3.2 block diagram..................................................................................................... 619 28.3.3 register configuration......................................................................................... 621 28.3.4 register descriptions ........................................................................................... 622 28.3.5 description of operation...................................................................................... 627 28.4 hsw (head-switch) ti ming generator............................................................................ 642 28.4.1 overview.............................................................................................................. 642 28.4.2 block diagram..................................................................................................... 642 28.4.3 composition......................................................................................................... 644 28.4.4 register configuration......................................................................................... 645 28.4.5 register descriptions ........................................................................................... 645 28.4.6 description of operation...................................................................................... 660 28.4.7 interrupt ............................................................................................................... 666 28.4.8 cautions ............................................................................................................... 667 28.5 four-head high-speed switching circuit for special playback ...................................... 668 28.5.1 overview.............................................................................................................. 668 28.5.2 block diagram..................................................................................................... 668 28.5.3 pin configuration................................................................................................. 669 rev.3.00 jan. 10, 2007 page xxxiii of xxxvi rej09b0328-0300 28.5.4 register description............................................................................................. 670 28.6 drum speed error detector .............................................................................................. 672 28.6.1 overview.............................................................................................................. 672 28.6.2 block diagram ..................................................................................................... 672 28.6.3 register configuration......................................................................................... 674 28.6.4 register descriptions ........................................................................................... 675 28.6.5 description of operation...................................................................................... 680 28.6.6 f h correction in trick play mode......................................................................... 682 28.7 drum phase error detector............................................................................................... 683 28.7.1 overview.............................................................................................................. 683 28.7.2 block diagram ..................................................................................................... 683 28.7.3 register configuration......................................................................................... 685 28.7.4 register descriptions ........................................................................................... 686 28.7.5 description of operation...................................................................................... 689 28.7.6 phase comparison................................................................................................ 690 28.8 capstan speed error detector........................................................................................... 691 28.8.1 overview.............................................................................................................. 691 28.8.2 block diagram ..................................................................................................... 691 28.8.3 register configuration......................................................................................... 693 28.8.4 register descriptions ........................................................................................... 693 28.8.5 description of operation...................................................................................... 697 28.9 capstan phase error detector ........................................................................................... 699 28.9.1 overview.............................................................................................................. 699 28.9.2 block diagram ..................................................................................................... 699 28.9.3 register configuration......................................................................................... 701 28.9.4 register descriptions ........................................................................................... 702 28.9.5 description of operation...................................................................................... 705 28.10 x-value and tracking adjustment circuit ....................................................................... 707 28.10.1 overview.............................................................................................................. 707 28.10.2 block diagram ..................................................................................................... 707 28.10.3 register descriptions ........................................................................................... 709 28.11 digital filters ................................................................................................................ .... 712 28.11.1 overview.............................................................................................................. 712 28.11.2 block diagram ..................................................................................................... 713 28.11.3 arithmetic buffer................................................................................................. 715 28.11.4 register configuration......................................................................................... 716 28.11.5 register descriptions ........................................................................................... 717 28.11.6 filter character istics ............................................................................................ 725 28.11.7 operations in case of transient re sponse........................................................... 727 28.11.8 initialization of z -1 ................................................................................................ 727 rev.3.00 jan. 10, 2007 page xxxiv of xxxvi rej09b0328-0300 28.12 additional v signal generator ......................................................................................... 729 28.12.1 overview ............................................................................................................ 729 28.12.2 pin configuration ............................................................................................... 730 28.12.3 register configuration ....................................................................................... 730 28.12.4 register description ........................................................................................... 730 28.12.5 additional v pulse signal .................................................................................. 732 28.13 ctl circuit.................................................................................................................... ... 735 28.13.1 overview ............................................................................................................ 735 28.13.2 block diagram ................................................................................................... 736 28.13.3 pin configuration ............................................................................................... 737 28.13.4 register configuration ....................................................................................... 737 28.13.5 register descriptions ......................................................................................... 738 28.13.6 operation............................................................................................................ 750 28.13.7 ctl input section.............................................................................................. 753 28.13.8 duty discriminator............................................................................................. 756 28.13.9 ctl output section ........................................................................................... 762 28.13.10 trapezoid waveform circuit.............................................................................. 765 28.13.11 note on ctl interrupt........................................................................................ 766 28.14 frequency dividers........................................................................................................... 7 66 28.14.1 overview ............................................................................................................ 766 28.14.2 ctl frequency divider ..................................................................................... 766 28.14.3 cfg frequency divider ..................................................................................... 770 28.14.4 dfg noise removal circuit .............................................................................. 778 28.15 sync signal de tector......................................................................................................... 7 81 28.15.1 overview ............................................................................................................ 781 28.15.2 block diagram ................................................................................................... 781 28.15.3 pin configuration ............................................................................................... 783 28.15.4 register configuration ....................................................................................... 783 28.15.5 register descriptions ......................................................................................... 784 28.15.6 noise detection .................................................................................................. 790 28.15.7 sync signal detector activation ........................................................................ 793 28.16 servo interrupt ................................................................................................................ .. 794 28.16.1 overview ............................................................................................................ 794 28.16.2 register configuration ....................................................................................... 794 28.16.3 register description ........................................................................................... 794 28.17 module stop control reig ster (mstpcr) ....................................................................... 801 section 29 electrical characteristics ............................................................................. 803 29.1 absolute maximum ratings ............................................................................................. 803 29.2 electrical characteris tics of hd 64f2194 ......................................................................... 804 rev.3.00 jan. 10, 2007 page xxxv of xxxvi rej09b0328-0300 29.2.1 dc characteristics of HD64F2194 ...................................................................... 804 29.2.2 allowable output currents of HD64F2194 and hd6 4f2194c........................... 810 29.2.3 ac characteristics of hd 64f2194 and hd64f 2194c........................................ 811 29.2.4 serial interface timing of HD64F2194 and HD64F2194c ................................. 815 29.2.5 a/d converter characteristics of HD64F2194 and HD64F2194c...................... 820 29.2.6 servo section electrical characteristics of HD64F2194 and HD64F2194c ....... 821 29.2.7 flash memory characteristics.......................................................................... 824 29.2.8 usage note........................................................................................................... 825 29.3 electrical characteristics of hd6432194, hd6432193, hd6432192, hd6432191, hd6432194c, hd6432194b, and hd643219 4a............................................................. 826 29.3.1 dc characteristics of hd6432194, hd6432193, hd6432192, hd6432191, hd6432194c, hd6432194b, and hd643219 4a................................................ 826 29.3.2 allowable output currents of hd6432194, hd6432193, hd6432192, hd6432191, hd6432194c, hd6432194b , and hd6432194a .......................... 832 29.3.3 ac characteristics of hd6432194, hd6432193, hd6432192, hd6432191, hd6432194c, hd6432194b, and hd643219 4a................................................ 833 29.3.4 serial interface timing of hd6432194, hd6432193, hd6432192, hd6432191, hd6432194c, hd6432194b, and hd643219 4a................................................ 837 29.3.5 a/d converter characteristics of hd6432194, hd6432193, hd6432192, hd6432191, hd6432194c, hd6432194b , and hd6432194a .......................... 842 29.3.6 servo section electrical characteristics of hd6432194, hd6432193, hd6432192, hd6432191, hd6432194c, hd6432194b , and hd6432194a .......................... 843 appendix a instruction set .............................................................................................. 847 a.1 instructions................................................................................................................... ..... 847 a.2 instruction codes .............................................................................................................. 858 a.3 operation code map......................................................................................................... 868 a.4 number of execution states.............................................................................................. 872 a.5 bus status during instruction execution........................................................................... 883 a.6 change of condition codes .............................................................................................. 899 appendix b internal i/o registers ................................................................................. 904 b.1 addresses ...................................................................................................................... .... 904 b.2 function list .................................................................................................................. ... 913 appendix c pin circuit diagrams ................................................................................. 1018 c.1 pin circuit diagrams........................................................................................................ 10 18 appendix d port states in the difference processing states ................................. 1032 d.1 pin circuit diagrams........................................................................................................ 10 32 rev.3.00 jan. 10, 2007 page xxxvi of xxxvi rej09b0328-0300 appendix e usage notes ................................................................................................. 1033 e.1 power supply rise a nd fall order................................................................................... 1033 e.2 pin handling when the high-speed switching circuit for four-head special playback is not used .................................................................................................................... .. 1034 e.3 sample external circuits ................................................................................................. 1035 appendix f list of product codes ................................................................................ 1036 appendix g external dimensions ................................................................................. 1037 section 1 overview rev.3.00 jan. 10, 2007 page 1 of 1038 rej09b0328-0300 section 1 overview 1.1 overview the h8s/2194 group and h8s/2194c group compri se microcomputers (mcus) built around the h8s/2000 cpu, employing renesas technology proprietary architecture, and equipped with supporting modules on-chip. the h8s/2000 has an internal 32-bit architecture, is provided with sixteen 16-bit general registers and a concise, optimized instruction set designed for high-speed operation, and can address a 16- mbyte linear address space. the instruction set is upward-compatible with h8/300 and h8/300h cpu instructions at the object-code level, facilitating migration from the h8/300, h8/300l, or h8/300h series. the h8s/2194 group and h8s/2194c group are incorporated with digital servo circuit, rom, ram, seven types of timers, three types of pw m, two types of serial communication interface, i 2 c bus interface, a/d converter, and i/o port as on-chip supporting modules. the on-chip rom is either flash memory (f-ztat ? *) or mask rom, with a capacity of 256, 192, 160, 128, 112, 96, or 80 kbytes. rom is connected to the cpu via a 16-bit data bus, enabling both byte and word data to be accessed in one stat e. instruction fetching has been speeded up, and processing speed increased. the features of the h8s/2194 group and h8s/2194c group are shown in table 1.1. note: * f-ztat is a trademark of renesas technology corp. section 1 overview rev.3.00 jan. 10, 2007 page 2 of 1038 rej09b0328-0300 table 1.1 features item specifications cpu ? general-register architecture ? sixteen 16-bit general registers (also usable as sixteen 8-bit registers or eight 32-bit registers) ? high-speed operation suitable for real-time control ? maximum operating frequency: 10 mhz/4 to 5.5 v operable by 32-khz subclock ? high-speed arithmetic operations 8/16/32-bit register-register add/subtract: 100 ns (10-mhz operation) 16 16-bit register-register multiply: 2000 ns (10-mhz operation) 32 16-bit register-register divide: 2000 ns (10-mhz operation) ? instruction set suitable for high-speed operation ? sixty-five basic instructions ? 8/16/32-bit transfer/arithmetic and logic instructions ? unsigned/signed multiply and divide instructions ? powerful bit-manipulation instructions ? cpu operating modes ? advanced mode: 16-mbyte address space timer seven types of timer are incorporated ? timer a ? 8-bit interval timer ? clock source can be selected among 8 types of internal clock of which frequencies are divided from the system clock ( ) and subclock ( sub) ? functions as clock time base by subclock input ? timer b ? functions as 8-bit interval timer or reload timer ? clock source can be selected among 7 types of internal clock or external event input ? timer j ? functions as two 8-bit down counters or one 16-bit down counter (reload timer/event counter timer/timer output, etc., 5 types of operation modes) ? remote controlled transmit function ? take up/supply reel pulse frequency division section 1 overview rev.3.00 jan. 10, 2007 page 3 of 1038 rej09b0328-0300 item specifications timer ? timer l ? 8-bit up/down counter ? clock source can be selected among 2 types of internal clock, cfg frequency division signal, and pb and rec-ctl (control pulse) ? compare-match clearing function/auto reload function ? timer r ? three reload timers ? mode discrimination ? reel control ? capstan motor acceleration/deceleration detection function ? slow tracking mono-multi ? timer x1 ? 16-bit free-running counter ? clock source can be selected among 3 types of internal clock and dvcfg ? two output compare outputs ? four input capture inputs ? watchdog timer ? functions as watchdog timer or 8-bit interval timer ? generates reset signal or nmi at overflow prescaler unit ? divides system clock frequency and generates frequency division clock for supporting module functions ? divides subclock frequency and generates input clock for timer a (clock time base) ? generates 8-bit pwm frequency and duty period ? 8-bit input capture at external signal edge ? frequency division clock output enabled pwm three types of pwm are incorporated ? 14-bit pwm: pulse resolution type 1 channel ? 8-bit pwm: duty control type 4 channels ? 12-bit pwm: pulse pitch control type 2 channels section 1 overview rev.3.00 jan. 10, 2007 page 4 of 1038 rej09b0328-0300 item specifications serial communication interface (sci) two types of serial communication interface is incorporated ? sci1 ? asynchronous mode or synchronous mode selectable ? desired bit rate selectable with built-in baud rate generator ? multiprocessor communication function ? sci2 ? 32-byte data automatically transferrable ? transfer clock selectable among seven types of internal/external clock i 2 c bus interface ? conforms to phillips i 2 c bus interface standard ? single master mode/slave mode ? arbitration lost condition can be identified ? supports two slave addresses a/d converter ? resolution: 10 bits ? input: 12 channels ? high-speed conversion: 13.4 s minimum conversion time (10-mhz operation) ? sample-and-hold function ? a/d conversion can be activated by software or external trigger address trap controller ? interrupt occurs when the preset address is found during bus cycle ? to-be-trapped addresses can be individually set at three different locations i/o port ? 60 input/output pins ? 8 input-only pins ? can be switched for each supporting module servo circuit digital servo circuits on-chip ? input and output circuits ? error detection circuit ? phase and gain compensation sync signal detector on-chip sync signal detection circuit ? can separately detect horizontal and vertical sync signals ? noise detection function section 1 overview rev.3.00 jan. 10, 2007 page 5 of 1038 rej09b0328-0300 item specifications ? flash memory or mask rom ? high-speed static ram product name rom ram h8s/2194c 256 kbytes 6 kbytes h8s/2194b 192 kbytes 6 kbytes h8s/2194a 160 kbytes 6 kbytes h8s/2194 128 kbytes 3 kbytes h8s/2193 112 kbytes 3 kbytes h8s/2192 96 kbytes 3 kbytes h8s/2191 80 kbytes 3 kbytes memory power-down state ? medium-speed mode ? sleep mode ? module stop mode ? standby mode ? subclock operation subactive mode, watch mode, subsleep mode interrupt controller ? seven external interrupt pins ( nmi , irq5 to irq0 ) ? 38 internal interrupt sources ? three priority levels settable clock pulse generator two types of clock pulse generator on-chip ? system clock pulse generator: 8 to 10 mhz ? subclock pulse generator: 32.768 khz packages ? 112-pin plastic qfp (fp-112) part no. group mask rom versions f-ztat versions rom/ram (bytes) packages h8s/2194c hd6432194c HD64F2194c 256 k/6 k fp-112 hd6432194b ? 192 k/6 k fp-112 hd6432194a ? 160 k/6 k fp-112 h8s/2194 hd6432194 HD64F2194 128 k/3 k fp-112 hd6432193 ? 112 k/3 k fp-112 hd6432192 ? 96 k/3 k fp-112 hd6432191 ? 80 k/3 k fp-112 product lineup section 1 overview rev.3.00 jan. 10, 2007 page 6 of 1038 rej09b0328-0300 1.2 internal block diagram an internal block diagram of the chip is shown in figure 1.1. p23/sda p25/si2 p22/sck1 p26/so2 p21/so1 p27/sck2 p20/si1 p24/scl v ss v ss v ss v ss v cc v cc v cc v ss md0 fwe res nmi osc2 osc1 x2 x1 v cc audio ff drmpwm video ff dfg csync sv ss sv cc vpulse exctl/ps4 clt(+) cappwm ctlsmt(i) ctlbias ctlfb clt(-) ctl ref cfg ctlamp(o) c.rotary/ps0 comp/ps2 dpg/ps3 h.amp sw/ps1 p13/ irq3 p15/ irq5 p12/ irq2 r a m r o m h8s/2000 cpu p16/ ic p11/ irq1 p17/tmow p10/ irq0 p14/ irq4 p03/an3 p05/an5 p02/an2 p06/an6 p01/an1 p07/an7 p00/an0 p04/an4 ana an9 an8 anb av cc av ss p83/sv2 p85 p82/sv1 p86 p81/excap p87 p80/exttrg p84 p33/pwm1 p35/pwm3 p32/pwm0 p36/buzz p31/strb p37/tmo p30/ cs p34/pwm2 p43/ftic p45/ftoa p42/ftib p46/ftob p41/ftia p47 p40/pwm14 p44/ftid p51 p53/trig p50/ adtrg p52/tmbi p73/ppg3 p75/ppg5 p72/ppg2 p76/ppg6 p71/ppg1 p77/ppg7 p70/ppg0 p74/ppg4 p63/rp3 p65/rp5 p62/rp2 p66/rp6 p61/rp1 p67/rp7 p60/rp0 p64/rp4 s c i 1 s c i 2 port 1 port 2 port 0 port 4 port 3 port 5 port 6 port 7 port 8 sync signal detection analog port external address bus external data bus external data bus external address bus subclock pulse generator system clock pulse generator interrupt controller 8-bit pwm watchdog timer i c bus interface timer l 2 a/d converter servo pins (ctl input/output amplifier, three-level output, etc.) servo circuit internal data bus internal address bus bus controller address trap controller prescaler unit timer a timer b timer j timer r timer x1 14-bit pwm figure 1.1 internal block diagram of h8s/2194 group section 1 overview rev.3.00 jan. 10, 2007 page 7 of 1038 rej09b0328-0300 1.3 pin arrangement and functions 1.3.1 pin arrangement the pin arrangement of the chip is shown in figure 1.2. v ss p72/ppg2 v cc p71/ppg1 p70/ppg0 p67/rp7 p66/rp6 p65/rp5 p64/rp4 p63/rp3 p62/rp2 p61/rp1 p60/rp0 md0 v cc osc2 v ss osc1 res x2 x1 nmi fwe p17/tmow p16/ ic p15/i rq5 p14/ irq4 p13/ irq3 ctlref v ss vpulse v cc dfg dpg/ps3 exctl/ps4 comp/ps2 h.amp sw/ps1 c.rotary/ps0 drm pwm cap pwm video ff audio ff csync p87 p86 p85 p84 p83/sv2 p82/sv1 p81/excap p80/exttrg p77/ppg7 p76/ppg6 p75/ppg5 p74/ppg4 p73/ppg3 1 ctl(+) fp-112 (top view) 84 2 sv ss 83 3 ctl(?) 82 4 ctlbias 81 5 ctlfb 80 6 ctlamp(o) 79 7 ctlsmt(i) 78 8 cfg 77 9 sv cc 76 10 av cc 75 11 p00/an0 74 12 p01/an1 73 13 p02/an2 72 14 p03/an3 71 15 p04/an4 70 16 p05/an5 69 17 p06/an6 68 18 p07/an7 67 19 an8 66 20 an9 65 21 ana 64 22 anb 63 23 av ss 62 24 p50/ adtrg 61 25 p51 60 26 p52/tmbi 59 27 p53/trig 58 28 p40/pwm14 57 29 p41/ftia 112 30 p42/ftib 111 31 p43/ftic 110 32 p44/ftid 109 33 p45/ftoa 108 34 p46/ftob 107 35 p47 106 36 p30/ cs 105 37 p31/strb 104 38 p32/pwm0 103 39 p33/pwm1 102 40 p34/pwm2 101 41 p35/pwm3 100 42 p36/buzz 99 43 v ss 98 44 p37/tmo 97 45 v cc 96 46 p20/si1 95 47 p21/so1 94 48 p22/sck1 93 49 p23/sda 92 50 p24/scl 91 51 p25/si2 90 52 p26/so2 89 53 p27/sck2 88 54 p10/ irq0 87 55 p11/ irq1 86 56 p12/ irq2 85 figure 1.2 pin arrangement of h8s/2194 group section 1 overview rev.3.00 jan. 10, 2007 page 8 of 1038 rej09b0328-0300 1.3.2 pin functions table 1.2 summarizes the functions of the chip?s pins. table 1.2 pin functions type symbol pin no. i/o name and function vcc 45, 70, 82, 109 input power supply: all vcc pins should be connected to the system power supply (+ 5v) vss 43, 68, 84, 111 input ground: all vss pins should be connected to the system power supply (0 v) svcc 9 input servo power supply: svcc pin should be connected to the servo analog power supply (+5 v) svss 2 input servo ground: svss pin should be connected to the servo analog power supply (0 v) avcc 10 input analog power supply: power supply pin for a/d converter. it should be connected to the system power supply (+5 v) when the a/d converter is not used power supply avss 23 input analog ground: ground pin for a/d converter. it should be connected to the system power supply (0 v) osc1 67 input osc2 69 output connected to a crystal oscillator. it can also input an external clock. see section 10, clock pulse generator, for typical connection diagrams for a crystal oscillator and external clock input x1 65 input clock x2 64 output connected to a 32.768 khz crystal oscillator. see section 10, clock pulse generator, for typical connection diagrams operating mode control md0 71 input mode pins: these pins set the operating mode. these pins should not be changed while the mcu is in operation section 1 overview rev.3.00 jan. 10, 2007 page 9 of 1038 rej09b0328-0300 type symbol pin no. i/o name and function res 66 input reset input: when this pin is driven low, the chip is reset system control fwe 62 input flash memory enable: enables/disables flash memory programming. this pin is available only with mcu with flash memory on-chip. for mask rom type, do not connect anything to this pin irq0 54 input external interrupt request 0: external interrupt input pin for which rising edge sense, falling edge sense or both edges sense are selectable irq1 irq2 irq3 irq4 irq5 55 56 57 58 59 input external interrupt requests 1 to 5: external interrupt input pins for which rising or falling edge sense are selectable interrupts nmi 63 input nonmaskable interrupt: nonmaskable interrupt input pin for which rising edge sense, falling edge sense or both edges sense are selectable ic 60 input input capture input: input capture input pin for prescaler unit prescaler unit tmow 61 output frequency division clock output: output pin for clock of which frequency is divided by prescaler tmbi 26 input timer b event input: input pin for events to be input to timer b counter irq1 irq2 55 56 input timer j event input: input pin for events to be input to timer j rdt- 1or rdt-2 counter tmo 44 output timer j timer output: output pin for toggle at underflow of rdt-1 of timer j, or remote controlled transmit data timers buzz 42 output timer j buzzer output: output pin for toggle which is selectable among fixed frequency, 1 hz frequency divided from subclock (32 khz), and frequency division ctl signal section 1 overview rev.3.00 jan. 10, 2007 page 10 of 1038 rej09b0328-0300 type symbol pin no. i/o name and function irq3 57 input timer r input capture: input pin for input capture of timer r tmru-1 or tmru-2 ftoa ftob 33 34 output timer x1 output compare a and b output: output pin for output compare a and b of timer x1 timers ftia ftib ftic ftid 29 30 31 32 input timer x1 input capture a, b, c, and d input: input pin for input capture a, b, c, and d of timer x1 pwm0 pwm1 pwm2 pwm3 38 39 40 41 output 8-bit pwm square waveform output: output pin for waveform generated by 8-bit pwm 0, 1, 2, and 3 pwm pwm14 28 output 14-bit pwm square waveform output: output pin for waveform generated by 14-bit pwm sck1 sck2 48 53 input/ output sci clock input/output: clock input pins for sci 1 and 2 si1 si2 46 51 input sci receive data input: receive data input pins for sci 1 and 2 so1 so2 47 52 output sci transmit data output: transmit data output pins for sci 1 and 2 strb 37 output sci2 strobe output: this pin outputs strobe pulse for each byte transmit by sci2 serial commu- nication interface (sci) cs 36 input sci2 chip select input: this pin controls the transfer start of sci2 scl 50 input/ output i 2 c bus interface clock input/output: clock input/output pin for i 2 c bus interface i 2 c bus interface sda 49 input/ output i 2 c bus interface data input/output: data input/output pin for i 2 c bus interface section 1 overview rev.3.00 jan. 10, 2007 page 11 of 1038 rej09b0328-0300 type symbol pin no. i/o name and function an7 to an0 18 to 11 input analog input channels 7 to 0: analog data input pins. a/d conversion is started by a software triggering an8 an9 ana anb 19 20 21 22 input analog input channels 8, 9, a, and b: analog data input pins. a/d conversion is started by an external, hardware, or software triggering a/d converter adtrg 24 input a/d conversion external trigger input: pin for input of an external trigger to start a/d conversion audio ff 99 output audio ff: output pin for audio head switching signal video ff 100 output video ff: output pin for video head switching signal cappwm 101 output capstan mix: 12-bit pwm output pin giving result of capstan speed error and phase error after filtering drmpwm 102 output drum mix: 12-bit pwm output pin giving result of drum speed error and phase error after filtering vpulse 110 output additional v pulse: three-level output pin for additional v signal synchronized to the video ff signal c.rotary/ ps0 103 output, input/ output color rotary signal: output pin for color signal processing control signal in four-head special-effects playback h.ampsw/p s1 104 output, input/ output head-amp switch: output pin for preamplifier output select signal in four-head special-effects playback. this pin can also be used as a general port when not used comp/ ps2 105 input, input/ output compare input: input pin for signal giving the result of preamplifier output comparison in four-head special-effects playback. this pin can also be used as a general port when not used ctl (+) ctl (-) 1 3 input/ output ctl head (+) and (-) pins: i/o pins for ctl signals servo circuits ctl bias 4 input ctl primary amp bias supply: bias supply pin for ctl primary amp section 1 overview rev.3.00 jan. 10, 2007 page 12 of 1038 rej09b0328-0300 type symbol pin no. i/o name and function ctl amp (o) 6 output ctl amp output: output pin for ctl amp ctl smt (l) 7 input ctl schmitt amp input: input pin for ctl schmitt amp ctlfb 5 input clt feedback input: input pin for ctl amp high-range characteristics control ctlref 112 output ctl amp reference voltage output: output pin for 1/2 vcc (sv) cfg 8 input capstan fg input: schmitt comparator input pin for cfg signal dfg 108 input drum fg input: schmitt input pin for dfg signal dpg/ps3 107 input, input/ output drum pg input: schmitt input pin for dpg signal. this pin can also be used as a general port when not used exctl/ ps4 106 input, input/ output external ctl input: input pin for external ctl signal. this pin can also be used as a general port when not used csync 98 input mixed sync signal input: input pin for mixed sync signal excap 91 input capstan external sync signal input: signal input pin for external synchronization of capstan phase control exttrg 90 input external trigger signal input: signal input pin for synchronization with reference signal generator sv1 92 output servo monitor output pin 1: output pin for servo module internal signal sv2 93 output servo monitor output pin 2: output pin for servo module internal signal servo circuits ppg7 to ppg0 89 to 85, 83, 81, 80 output ppg: output pin for hsw timing generator. to be used when head switching is required as well as audio ff and video ff section 1 overview rev.3.00 jan. 10, 2007 page 13 of 1038 rej09b0328-0300 type symbol pin no. i/o name and function p07 to p00 11 to 18 input port 0: 8-bit input pins p17 to p10 61 to 54 input/ output port 1: 8-bit i/o pins p27 to p20 53 to 46 input/ output port 2: 8-bit i/o pins p37 to p30 44, 42 to 36 input/ output port 3: 8-bit i/o pins p47 to p40 35 to 28 input/ output port 4: 8-bit i/o pins p53 to p50 27 to 24 input/ output port 5: 4-bit i/o pins p67 to p60 79 to 72 input/ output port 6: 8-bit i/o pins p77 to p70 89 to 85, 83, 81, 80 input/ output port 7: 8-bit i/o pins p87 to p80 97 to 90 input/ output port 8: 8-bit i/o pins rp7 to rp0 79 to 72 output realtime output port: 8-bit realtime output pins i/o port trig 27 input realtime output port trigger input: input pin for realtime output port trigger section 1 overview rev.3.00 jan. 10, 2007 page 14 of 1038 rej09b0328-0300 1.4 differences between h8s/ 2194c group and h8s/2194 group though the h8s/2194c group is compatible with the h8s/2194 group and their supporting modules are almost identical, there are some differences between them as shown below. for details, see the following sections. table 1.3 differences between h8s/2194c group and h8s/2194 group h8s/2194c group h8s/2194 group rom h8s/2194c: 256 kbytes h8s/2194b: 192 kbytes h8s/2194a: 160 kbytes h8s/2194: 128 kbytes h8s/2193: 112 kbytes h8s/2192: 96 kbytes h8s/2191: 80 kbytes ram h8s/2194c: 6 kbytes h8s/2194b: 6 kbytes h8s/2194a: 6 kbytes h8s/2194: 3 kbytes h8s/2193: 3 kbytes h8s/2192: 3 kbytes h8s/2191: 3 kbytes timer j five operating modes: tmj-2 input clock sources: pss = /16384, /2048, or /1024; underflow of tmj-1, external clock (irq2) four operating modes: tmj-2 input clock sources: pss = /16384 or /2048; underflow of tmj-1, external clock (irq2) servo circuit in the reference signal generator, the servo circuit selects whether reference signals are generated with vd when it is in pb mode, or in free-run in the reference signal generator, when the servo circuit is in pb mode, reference signals are generated in free-run flash rom 256 kbytes when the flash rom control flag is set, use the e (erase) bit and the p (program) bit in flash memory control register 1 (fmlcr1). 128 kbytes when the flash rom control flag is set, use the e (erase) bit and the p (program) bit in flash memory control register 2 (fmlcr2). section 2 cpu rev.3.00 jan. 10, 2007 page 15 of 1038 rej09b0328-0300 section 2 cpu 2.1 overview the h8s/2000 cpu is a high-speed central processing unit with an internal 32-bit architecture that is upward-compatible with the h8/300 and h8/300h cpus. the h8s/2000 cpu has sixteen 16-bit general registers, can address a 16-mbyte (archit ecturally 4-gbyte) linear address space, and is ideal for realtime control. 2.1.1 features the h8s/2000 cpu has the following features. ? upward-compatible with h8/300 and h8/300h cpus can execute h8/300 and h8/300h object programs ? general-register architecture sixteen 16-bit general registers (also usable as sixteen 8-bit registers or eight 32-bit registers) ? sixty-five basic instructions 8/16/32-bit arithmetic and logic instructions multiply and divide instructions powerful bit-manipulation instructions ? eight addressing modes register direct [rn] register indirect [@ern] register indirect with displacemen t [@(d:16,ern) or @(d:32,ern)] register indirect with post-increment or pre-decrement [@ern+ or @-ern] absolute address [@aa:8, @aa:16, @aa:24, or @aa:32] immediate [#xx:8, #xx:16, or #xx:32] program-counter relative [@(d:8,pc) or @(d:16,pc)] memory indirect [@@aa:8] ? 16-mbyte address space program: 16 mbytes data: 16 mbytes (4 gbytes architecturally) section 2 cpu rev.3.00 jan. 10, 2007 page 16 of 1038 rej09b0328-0300 ? high-speed operation all frequently-used instructions execute in one or two states maximum clock rate: 10 mhz 8/16/32-bit register-register add/subtract: 100 ns 8 8-bit register-register multiply: 1200 ns 16 8-bit register-register divide: 1200 ns 16 16-bit register-register multiply: 2000 ns 32 16-bit register-register divide: 2000 ns ? two cpu operating modes normal mode*/advanced mode ? power-down state transition to power-down state by sleep instruction cpu clock speed selection note: * normal mode is not available for this lsi. 2.1.2 differences between h8s/2600 cpu and h8s/2000 cpu the differences between the h8s/2600 cpu and the h8s/2000 cpu are shown below. ? register configuration the mac register is supported only by the h8s/2600 cpu. ? basic instructions the four instructions mac, clrmac, ldmac, and stmac are supported only by the h8s/2600 cpu. ? number of execution states the number of execution states of the mulxu and mulxs instructions differ as follows. number of execution states instruction mnemonic h8s/2600 h8s/2000 mulxu mulxu.b rs, rd 3 12 mulxu.w rs, erd 4 20 mulxs mulxs.b rs, rd 4 13 mulxs.w rs, erd 5 21 there are also differences in the address space, exr register functions, power-down state, etc., depending on the product. section 2 cpu rev.3.00 jan. 10, 2007 page 17 of 1038 rej09b0328-0300 2.1.3 differences from h8/300 cpu in comparison to the h8/300 cpu, the h8s/2000 cpu has the following enhancements. ? more general registers and control registers eight 16-bit extended registers, and one 8-bit control register, have been added. ? expanded address space normal mode supports the same 64-kbyt e address space as the h8/300 cpu. advanced mode supports a maximum 16-mbyte address space. ? enhanced addressing mode the addressing modes have been enhanced to make effective use of the 16-mbyte address space. ? enhanced instructions addressing modes of bit-manipulation in structions have been enhanced. signed multiply and divide instructions have been added. two-bit shift instructions have been added. instructions for saving and restoring multiple registers have been added. a test and set instruction has been added. ? higher speed basic instructions execute twice as fast. 2.1.4 differences from h8/300h cpu in comparison to the h8/300h cpu, the h8s/2000 cpu has the following enhancements. ? additional control register one 8-bit control register has been added. ? enhanced instructions addressing modes of bit-manipulation in structions have been enhanced. two-bit shift instructions have been added. instructions for saving and restoring multiple registers have been added. a test and set instruction has been added. ? higher speed basic instructions execute twice as fast. section 2 cpu rev.3.00 jan. 10, 2007 page 18 of 1038 rej09b0328-0300 2.2 cpu operating modes the h8s/2000 cpu has two operating modes: norma l and advanced. normal mode supports a maximum 64-kbyte address space. advanced mode supports a maximum 16-mbyte total address space (architecturally the maxi mum total address space is 4 gbytes, with a maximum of 16 mbytes for the program area and a maximum of 4 gbytes for the data area). the mode is selected by the mode pins of the microcontroller. cpu operating mode normal mode * advanced mode maximum 64 kbytes for program and data areas combined maximum 16 mbytes for program and data areas combined note: * normal mode is not available for this lsi. figure 2.1 cpu operating modes 2.2.1 normal mode the exception vector table and stack have th e same structure as in the h8/300 cpu. address space: a maximum address space of 64 kbytes can be accessed. extended registers (en): the extended registers (e0 to e7) can be used as 16-bit registers, or as the upper 16-bit segments of 32-bit registers. when en is used as a 16-bit register it can contain any value, even when the corresponding general register (rn) is used as an address register. if the general register is referenced in the register indirect addressing mode with pre-decrement (@-rn) or post-increment (@rn+) and a carry or borrow occurs, however, the value in the corresponding extended register (en) will be affected. instruction set: all instructions and addressing modes can be used. only the lower 16 bits of effective addresses (ea) are valid. section 2 cpu rev.3.00 jan. 10, 2007 page 19 of 1038 rej09b0328-0300 exception vector table and memo ry indirect branch addresses: in normal mode the top area starting at h'0000 is allocated to the exception vector table. one branch address is stored per 16 bits. the configuration of the exception vector table in normal mode is shown in figure 2.2. for details of the exception vector table, see section 5, exception handling. h'0000 h'0001 h'0002 h'0003 h'0004 h'0005 h'0006 h'0007 h'0008 h'0009 h'000a h'000b reset exception vector exception vector 1 exception vector 2 exception vector table (reserved for system use) figure 2.2 exception v ector table (normal mode) the memory indirect addressing mode (@@aa:8) employed in the jmp and jsr instructions uses an 8-bit absolute address included in the instruction code to specify a memory operand that contains a branch address. in normal mode the operand is a 16-bit word operand, providing a 16- bit branch address. branch addresses can be stored in the top area from h'0000 to h'00ff. note that this area is also used for the exception vector table. stack structure: when the program counter (pc) is pushed onto the stack in a subroutine call, and the pc and condition-code register (ccr) are pushed onto the stack in exception handling, they are stored as shown in figure 2.3. the extended control register (exr) is not pushed onto the stack. for details, see section 5, exception handling. section 2 cpu rev.3.00 jan. 10, 2007 page 20 of 1038 rej09b0328-0300 (a) subroutine branch (b) exception handling pc (16 bits) ccr ccr * pc (16 bits) sp sp note: * ignored when returning. figure 2.3 stack stru cture in normal mode 2.2.2 advanced mode address space: linear access is provided to a 16-mbyte maximum address space (architecturally a maximum 16-mbyte program area and a maximum 4-gbyte data area, with a maximum of 4 gbytes for program and data areas combined). extended registers (en): the extended registers (e0 to e7) can be used as 16-bit registers, or as the upper 16-bit segments of 32-bit registers or address registers. instruction set: all instructions and addressing modes can be used. exception vector table and memo ry indirect branch addresses: in advanced mode the top area starting at h'00000000 is allocated to the excep tion vector table in units of 32 bits. in each 32 bits, the upper 8 bits are ignored and a branch address is stored in the lower 24 bits (figure 2.4). for details of the exception vector table, see section 5, exception handling. section 2 cpu rev.3.00 jan. 10, 2007 page 21 of 1038 rej09b0328-0300 h'00000000 h'00000003 h'00000004 h'0000000b h'0000000c exception vector table reserved reset exception vector (reserved for system use) reserved exception vector 1 reserved h'00000010 h'00000008 h'00000007 figure 2.4 excep tion vector tabl e (advanced mode) the memory indirect addressing mode (@@aa:8) employed in the jmp and jsr instructions uses an 8-bit absolute address included in the instruction code to specify a memory operand that contains a branch address. in advanced mode the operand is a 32-bit longword operand, providing a 32-bit branch address. the upper 8 bits of these 32 bits are a re served area that is regarded as h'00. branch addresses can be stored in the area from h'00000000 to h'000000ff. note that the first part of this range is also the exception vector table. stack structure: in advanced mode, when the program counter (pc) is pushed onto the stack in a subroutine call, and the pc an d condition-code register (ccr) are pushed onto the stack in exception handling, they are stored as shown in figure 2.5. the extended control register (exr) is not pushed onto the stack. for details, see section 5, exception handling. section 2 cpu rev.3.00 jan. 10, 2007 page 22 of 1038 rej09b0328-0300 (a) subroutine branch (b) exception handling pc (24 bits) ccr pc (24 bits) sp sp reserved figure 2.5 stack stru cture in advanced mode section 2 cpu rev.3.00 jan. 10, 2007 page 23 of 1038 rej09b0328-0300 2.3 address space figure 2.6 shows a memory map of the h8s/2000 cpu. the h8s/2000 cpu provides linear access to a maximum 64-kbyte address space in normal mode, and a maximum 16-mbyte (architecturally 4-gbyte) a ddress space in advanced mode. (b) advanced mode h'0000 h'ffff h'00000000 h'ffffffff h'00ffffff (a) normal mode * data area program area cannot be used with this lsi note: * normal mode is not available for this lsi. figure 2.6 memory map section 2 cpu rev.3.00 jan. 10, 2007 page 24 of 1038 rej09b0328-0300 2.4 register configuration 2.4.1 overview the cpu has the internal registers shown in figure 2.7. there are two types of registers: general registers and control registers. t ? ? ? ? i2 i1 i0 exr 76543210 pc 23 0 15 0 7 0 7 0 e0 e1 e2 e3 e4 e5 e6 e7 r0h r1h r2h r3h r4h r5h r6h r7h r0l r1l r2l r3l r4l r5l r6l r7l general registers (rn) and extended registers (en) control registers (cr) legend: sp pc exr t i2 to i 0 ccr i ui er0 er1 er2 er3 er4 er5 er6 er7 (sp) iuihunzvc ccr 76543210 : half-carry flag : user bit : negative flag : zero flag : overflow flag : carry flag h u n z v c : stack pointer : program counter : extended control register : trace bit : interrupt mask bits : condition-code register : interrupt mask bit : user bit or interrupt mask bit note: * does not affect operation in this lsi. * figure 2.7 cpu registers section 2 cpu rev.3.00 jan. 10, 2007 page 25 of 1038 rej09b0328-0300 2.4.2 general registers the cpu has eight 32-bit general registers. these general registers are all functionally alike and can be used as both address registers and data regi sters. when a general register is used as a data register, it can be accessed as a 32-bit, 16-bit, or 8- bit register. when the general registers are used as 32-bit registers or address registers, they are designated by the letters er (er0 to er7). the er registers divide into 16-bit general registers designated by the letters e (e0 to e7) and r (r0 to r7). these registers are functionally equivalent, providing a maximum of sixteen 16-bit registers. the e registers (e0 to e7) are also referred to as extended registers. the r registers divide into 8-bit general register s designated by the letters rh (r0h to r7h) and rl (r0l to r7l). these registers are functionally equivalent, providing a maximum of sixteen 8- bit registers. figure 2.8 illustrates the usage of the general registers. the usage of each register can be selected independently. address registers 32-bit registers 16-bit registers 8-bit registers er registers (er0 to er7) e registers (extended registers) (e0 to e7) r registers (r0 to r7) rh registers (r0h to r7h) rl registers (r0l to r7l) figure 2.8 usage of general registers general register er7 has the function of stack poi nter (sp) in addition to its general-register function, and is used implicitly in exception handling and subroutine calls. figure 2.9 shows the stack. section 2 cpu rev.3.00 jan. 10, 2007 page 26 of 1038 rej09b0328-0300 sp (er7) free area stack area figure 2.9 stack 2.4.3 control registers the control registers are the 24-bit program counter (pc), 8-bit extended control register (exr), and 8-bit condition-code register (ccr). (1) program counter (pc) this 24-bit counter indicates the address of the next instruction the cpu will execute. the length of all cpu instructions is 2 bytes (one word), so the least significant pc bit is ignored. (when an instruction is fetched, the least significant pc bit is regarded as 0.) (2) extended control register (exr) an 8-bit register. in this lsi, this register does not affect operation. bit 7 ? trace bit (t): this bit is reserved. in this lsi, this bit does not affect operation. bits 6 to 3 ? reserved: this bit is reserved. in this lsi, this bit does not affect operation. bits 2 to 0 ? interrupt mask bits (i2 to i0): these bits are reserved. in this lsi, these bits do not affect operation. (3) condition-code register (ccr) this 8-bit register contains internal cpu status information, including an interrupt mask bit (i) and half-carry (h), negative (n), zero (z), overflow (v), and carry (c) flags. section 2 cpu rev.3.00 jan. 10, 2007 page 27 of 1038 rej09b0328-0300 bit 7 ? interrupt mask bit (i): masks interrupts other than nmi when set to 1. (nmi is accepted regardless of the i bit setting.) the i bit is set to 1 by hardware at the start of an exception- handling sequence. for details, see section 6, interrupt controller. bit 6 ? user bit or interrupt mask bit (ui): can be written and read by software using the ldc, stc, andc, orc, and xorc instructions. this bit can also be used as an interrupt mask bit. for details, see section 6, interrupt controller. bit 5 ? half-carry flag (h): when the add.b, addx.b, sub.b, subx.b, cmp.b, or neg.b instruction is executed, this flag is set to 1 if th ere is a carry or borrow at bit 3, and cleared to 0 otherwise. when the add.w, sub.w, cmp.w, or neg.w instruction is executed, the h flag is set to 1 if there is a carry or borrow at bit 11, and cleared to 0 otherwise. when the add.l, sub.l, cmp.l, or neg.l instruction is executed, the h flag is set to 1 if there is a carry or borrow at bit 27, and cleared to 0 otherwise. bit 4 ? user bit (u): can be written and read by software using the ldc, stc, andc, orc, and xorc instructions. bit 3 ? negative flag (n): stores the value of the most significant bit (sign bit) of data. bit 2 ? zero flag (z): set to 1 to indicate zero data, and cleared to 0 to indicate non-zero data. bit 1 ? overflow flag (v): set to 1 when an arithmetic overflow occurs, and cleared to 0 otherwise. bit 0 ? carry flag (c): set to 1 when a carry occurs, and cleared to 0 otherwise. used by: ? add instructions, to indicate a carry ? subtract instructions , to indicate a borrow ? shift and rotate instructions, to store the carry the carry flag is also used as a bit accumulator by bit-manipulation instructions. some instructions leave some or all of the flag bits unchanged. for the action of each instruction on the flag bits, see appendix a.1, instructions. operations can be performed on the ccr bits by the ldc, stc, andc, orc, and xorc instructions. the n, z, v, and c flags are used as branching conditions for conditional branch (bcc) instructions. section 2 cpu rev.3.00 jan. 10, 2007 page 28 of 1038 rej09b0328-0300 2.4.4 initial register values reset exception handling loads the cp u's program counter (pc) from the vector table, clears the trace bit in exr to 0, and sets th e interrupt mask bits in ccr and exr to 1. the other ccr bits and the general registers are not initialized. in particular, the stack pointer (er7) is not initialized. the stack pointer should therefore be initialized by an mov.l instruction executed immediately after a reset. 2.5 data formats the cpu can process 1-bit, 4-bit (bcd), 8-bit (byte), 16-bit (word), and 32-bit (longword) data. bit-manipulation instructi ons operate on 1-bit data by accessing bit n (n = 0, 1, 2, ..., 7) of byte operand data. the daa and das decimal-adjust instructions treat byte data as two digits of 4-bit bcd data. section 2 cpu rev.3.00 jan. 10, 2007 page 29 of 1038 rej09b0328-0300 2.5.1 general register data formats figure 2.10 shows the data formats in general registers. 70 70 msb lsb msb lsb 70 43 upper digit lower digit don't care don't care don't care 70 43 upper digit lower digit 70 don't care 65432 710 70 don't care 65432 710 don't care data format data type 1-bit data 1-bit data 4-bit bcd data 4-bit bcd data byte data byte data general register rnh rnl rnh rnl rnh rnl figure 2.10 general re gister data formats (1) section 2 cpu rev.3.00 jan. 10, 2007 page 30 of 1038 rej09b0328-0300 15 0 msb lsb 15 0 msb lsb 31 16 msb 15 0 lsb en rn data type word data word data longword data general register rn en ern data format ern en rn rnh rnl msb lsb : general register er : general register e : general register r : general register rh : general register rl : most significant bit : least significant bit legend: figure 2.10 general re gister data formats (2) section 2 cpu rev.3.00 jan. 10, 2007 page 31 of 1038 rej09b0328-0300 2.5.2 memory data formats figure 2.11 shows the data formats in memory. the cpu can access word data and longword data in memory, but word or longword data must begin at an even address. if an attempt is made to access word or longword data at an odd address, no address error occurs but the leas t significant bit of the address is regarded as 0, so the access starts at the preceding address. this also applies to instruction fetches. 70 76 543210 msb lsb msb msb lsb lsb address address l address l address 2m address 2n address 2n + 1 address 2n + 2 address 2n + 3 1-bit data byte data word data longword data data type data format address 2m + 1 figure 2.11 memory data formats when er7 (sp) is used as an address register to access the stack, the operand size should be word size or longword size. section 2 cpu rev.3.00 jan. 10, 2007 page 32 of 1038 rej09b0328-0300 2.6 instruction set 2.6.1 overview the h8s/2000 cpu has 65 types of instructions. the instructions are classified by function in table 2.1. table 2.1 instructio n classification function instructions size types mov bwl pop * 1 , push * 1 wl ldm, stm l data transfer movfpe * 3 , movtpe * 3 b 5 add, sub, cmp, neg bwl addx, subx, daa, das b inc, dec bwl adds, subs l mulxu, divxu, mulxs, divxs bw extu, exts wl arithmetic tas * 4 b 19 logic operations and, or, xor, not bwl 4 shift shal, shar, shll, sh lr, rotl, rotr, rotxl, rotxr bwl 8 bit manipulation rset, bclr, bnot, btst, bld, bild, bst, bist, band, biand, bor, bior, bxor, bixor b 14 branch bcc * 2 , jmp, bsr, jsr, rts ? 5 system control trapa, rte, sleep, ldc, stc, andc, orc, xorc, nop ? 9 block data transfer eepmov ? 1 total: 65 types legend: b: byte w: word l: longword section 2 cpu rev.3.00 jan. 10, 2007 page 33 of 1038 rej09b0328-0300 notes: 1. pop.w rn and push.w rn are identical to mov.w @sp+, rn and mov.w rn, @- sp. pop.l ern and push.l ern are identical to mov.l @sp+, ern and mov.l ern, @- sp. 2. bcc is the general name for conditional branch instructions. 3. not available in this lsi. 4. only register er0, er1, er4, or er5 should be used when using the tas instruction. section 2 cpu rev.3.00 jan. 10, 2007 page 34 of 1038 rej09b0328-0300 2.6.2 instructions and addressing modes table 2.2 indicates the combinations of instructions and addressing modes that the h8s/2000 cpu can use. table 2.2 combinations of instructions and addressing modes addressing modes function arithmetic operations system control branch logic operation instruction mov pop, push ldm, stm add, cmp sub addx, subx adds, subs inc, dec daa, das neg extu, exts tas * 2 movfpe, movtpe * 1 mulxu, divxu mulxs, divxs and, or, xor andc, orc, xorc not bcc, bsr jmp, jsr rts trapa rte sleep ldc stc nop shift bit manipulation block data transfer data transfer bwl #xx ? ? bwl wl b ? ? ? ? ? ? ? ? ? bwl b ? ? ? ? ? ? ? b ? ? ? ? ? bwl rn ? ? bwl bwl b l bwl b bwl wl ? ? bw bw bwl ? bwl ? ? ? ? ? ? b b ? bwl b ? bwl @ern ? ? ? ? ? ? ? ? ? ? b ? ? ? ? ? ? ? ? ? ? ? ? w w ? ? b ? bwl @(d:16, ern) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? w w ? ? ? ? bwl @(d:32, ern) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? w w ? ? ? ? bwl @-ern/@ern+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? w w ? ? ? ? b @aa:8 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? b ? bwl @aa:16 ? ? ? ? ? ? ? ? ? ? ? b ? ? ? ? ? ? ? ? ? ? ? w w ? ? b ? ? @aa:24 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bwl @aa:32 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? w w ? ? b ? ? @(d:8, pc) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? @(d:16, pc) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? @@aa:8 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? wl l ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? bw legend: b: byte w: work l: longword notes: 1. cannot be used in this lsi. 2. only register er0, er1, er4, or er5 should be used when using the tas instruction. section 2 cpu rev.3.00 jan. 10, 2007 page 35 of 1038 rej09b0328-0300 2.6.3 table of instructions classified by function table 2.3 to 2.10 summarize the instructions in each functional category. the notation used in table 2.3 is defined below. operation notation rd general register (destination) * rs general register (source) * rn general register * ern general register (32-bit register) (ead) destination operand (eas) source operand exr extended control register ccr condition-code register n n (negative) flag in ccr z z (zero) flag in ccr v v (overflow) flag in ccr c c (carry) flag in ccr pc program counter sp stack pointer #imm immediate data disp displacement + addition ? subtraction multiplication division logical and logical or logical exclusive or move not (logical complement) :8/:16/:24/:32 8-, 16-, 24-, or 32-bit length note: * general registers include 8-bit registers (r0h to r7h, r0l to r7l), 16-bit registers (r0 to r7, e0 to e7), and 32-bit registers (er0 to er7). section 2 cpu rev.3.00 jan. 10, 2007 page 36 of 1038 rej09b0328-0300 table 2.3 data transfer instructions instruction size * function mov b/w/l (eas) rd, rs (ead) moves data between two general registers or between a general register and memory, or moves immediate data to a general register movfpe b cannot be used in this lsi movtpe b cannot be used in this lsi pop w/l @sp+ rn pops a general register from the stack pop.w rn is identical to mov.w @sp+, rn pop.l ern is identical to mov.l @sp+, ern push w/l rn @-sp pushes a general register onto the stack push.w rn is identical to mov.w rn, @-sp push.l ern is identical to mov.l ern, @-sp ldm l @sp+ rn (register list) pops two or more general registers from the stack stm l rn (register list) @-sp pushes two or more general registers onto the stack note: * size refers to the operand size. b: byte w: word l: longword section 2 cpu rev.3.00 jan. 10, 2007 page 37 of 1038 rej09b0328-0300 table 2.4 arithmetic instructions instruction size * 1 function add sub b/w/l rd rs rd, rd #imm rd performs addition or subtraction on data in two general registers, or on immediate data and data in a general register. (immediate byte data cannot be subtracted from byte data in a general register. use the subx or add instruction) addx subx b rd rs c rd, rd #imm c rd performs addition or subtraction with carry on byte data in two general registers, or on immediate data and data in a general register inc dec b/w/l rd 1 rd, rd 2 rd increments or decrements a general register by 1 or 2. (byte operands can be incremented or decremented by 1 only) adds subs b rd 1 rd, rd 2 rd, rd 4 rd adds or subtracts the value 1, 2, or 4 to or from data in a 32-bit register daa das b/w rd decimal adjust rd decimal-adjusts an addition or subtraction result in a general register by referring to the ccr to produce 4-bit bcd data mulxu b/w rd rs rd performs unsigned multiplication on data in two general registers: either 8 bits 8 bits 16 bits or 16 bits 16 bits 32 bits mulxs b/w rd rs rd performs signed multiplication on data in two general registers: either 8 bits 8 bits 16 bits or 16 bits 16 bits 32 bits divxu b/w rd rs rd performs unsigned division on data in two general registers: either 16 bits 8 bits 8-bit quotient and 8-bit remainder or 32 bits 16 bits 16-bit quotient and 16-bit remainder section 2 cpu rev.3.00 jan. 10, 2007 page 38 of 1038 rej09b0328-0300 instruction size * 1 function divxs b/w rd rs rd performs signed division on data in two general registers: either 16 bits 8 bits 8-bit quotient and 8-bit remainder or 32 bits 16 bits 16-bit quotient and 16-bit remainder cmp b/w/l rd - rs, rd - #imm compares data in a general register with data in another general register or with immediate data, and sets ccr bits according to the result neg b/w/l 0 - rd rd takes the two's complement (arithmetic complement) of data in a general register extu w/l rd (zero extension) rd extends the lower 8 bits of a 16-bit register to word size, or the lower 16 bits of a 32-bit register to longword size, by padding with zeros on the left exts w/l rd (sign extension) rd extends the lower 8 bits of a 16-bit register to word size, or the lower 16 bits of a 32-bit register to longword size, by extending the sign bit tas b @erd - 0, 1 ( section 2 cpu rev.3.00 jan. 10, 2007 page 39 of 1038 rej09b0328-0300 table 2.5 logic instructions instruction size * function and b/w/l rd rs rd, rd #imm rd performs a logical and operation on a general register and another general register or immediate data or b/w/l rd rs rd, rd #imm rd performs a logical or operation on a general register and another general register or immediate data xor b/w/l rd rs rd, rd #imm rd performs a logical exclusive or operation on a general register and another general register or immediate data not b/w/l ~ rd rd takes the one's complement (logical complement) of general register contents note: * size refers to the operand size. b: byte w: word l: longword table 2.6 shift instructions instruction size * function shal shar b/w/l rd (shift) rd performs an arithmetic shift on general register contents a 1-bit or 2-bit shift is possible shll shlr b/w/l rd (shift) rd performs a logical shift on general register contents a 1-bit or 2-bit shift is possible rotl rotr b/w/l rd (rotate) rd rotates general register contents 1-bit or 2-bit rotation is possible rotxl rotxr b/w/l rd (rotate) rd rotates general register contents through the carry flag 1-bit or 2-bit rotation is possible note: * size refers to the operand size. b: byte w: word l: longword section 2 cpu rev.3.00 jan. 10, 2007 page 40 of 1038 rej09b0328-0300 table 2.7 bit manipulation instructions instruction size * function bset b 1 ( section 2 cpu rev.3.00 jan. 10, 2007 page 41 of 1038 rej09b0328-0300 instruction size * function boxr b c ( section 2 cpu rev.3.00 jan. 10, 2007 page 42 of 1038 rej09b0328-0300 table 2.8 branch instructions instruction size * function branches to a specified address if a specified condition is true the branching conditions are listed below mnemonic description condition bra (bt) always (true) always brn (bf) never (false) never bhi high cvz = 0 bls low of same cvz = 1 bcc (bhs) carry clear (high or same) c = 0 bcs (blo) carry set (low) c = 1 bne not equal z = 0 beq equal z = 1 bvc overflow clear v = 0 bvs overflow set v = 1 bpl plus n = 0 bmi minus n = 1 bge greater or equal nv = 0 blt less than n v = 1 bgt greater than z (n v) = 0 ble less or equal z (n v) = 1 bcc ? jmp ? branches unconditionally to a specified address bsr ? branches to a subroutine at a specified address jsr ? branches to a subroutine at a specified address rts ? returns from a subroutine section 2 cpu rev.3.00 jan. 10, 2007 page 43 of 1038 rej09b0328-0300 table 2.9 system co ntrol instructions instruction size * function trapa ? starts trap-instruction exception handling rte ? returns from an exception-handling routine sleep ? causes a transition to a power-down state ldc b/w (eas) ccr, (eas) exr moves contents of a general register or memory or immediate data to ccr or exr. although ccr and exr are 8-bit registers, word-size transfers are performed between them and memory. the upper 8 bits are valid stc b/w ccr (ead), exr (ead) transfers ccr or exr contents to a general register or memory. although ccr and exr are 8-bit registers, word-size transfers are performed between them and memory. the upper 8 bits are valid andc b ccr #imm ccr, exr #imm exr logically ands the ccr or exr contents with immediate data orc b ccr #imm ccr, exr #imm exr logically ors the ccr or exr contents with immediate data xorc b ccr #imm ccr, exr #imm exr logically exclusive-ors the ccr or exr contents with immediate data nop ? pc + 2 pc only increments the program counter note: * size refers to the operand size. b: byte w: word section 2 cpu rev.3.00 jan. 10, 2007 page 44 of 1038 rej09b0328-0300 table 2.10 block data transfer instructions instruction size * function eepmov.b ? if r4l 0 then repeat @er5+ @er6+ r4l ? 1 r4l until r4l = 0 else next; eepmov.w ? if r4 0 then repeat @er5+ @er6+ r4 ? 1 r4 until r4 = 0 else next; transfers a data block according to parameters set in general registers r4l or r4, er5, and er6 r4l or r4: size of block (bytes) er5: starting source address er6: starting destination address execution of the next instruction begins as soon as the transfer is completed section 2 cpu rev.3.00 jan. 10, 2007 page 45 of 1038 rej09b0328-0300 2.6.4 basic instruction formats the cpu instructions consist of 2-byte (1-word) units. an instruction consists of an operation field (op field), a register field (r field), an effective addre ss extension (ea field), and a condition field (cc). figure 2.12 shows examples of instruction formats. op op rn rm nop, rts, etc. add.b rn, rm, etc. mov.b@(d:16, rn), rm, etc. (1) operation field only (2) operation field and register fields (3) operation field, register fields, and effective address extension rn rm op ea (disp) (4) operation field, effective address extension, and condition field op cc ea (disp) bra d:16, etc. figure 2.12 instruction formats (examples) operation field: indicates the function of the instruction, the addressing mode, and the operation to be carried out on the operand. the operation field always includes the first four bits of the instruction. some instructions have two operation fields. register field: specifies a general register. address regist ers are specified by 3 bits, data registers by 3 bits or 4 bits. some instructions have two register fields. some have no register field. effective address extension: 8, 16, or 32 bits specifying immediate data, an absolute address, or a displacement. condition field: specifies the branching condition of bcc instructions. section 2 cpu rev.3.00 jan. 10, 2007 page 46 of 1038 rej09b0328-0300 2.6.5 notes on use of bit-manipulation instructions the bset, bclr, bnot, bst, and bist instructions read a byte of data, carry out bit manipulation, then write back the byte of data. caution is therefore required when using these instructions on a register containing write-only bits, or a port. the bclr instruction can be used to clear internal i/o register flags to 0. in this case, the relevant flag need not be read beforehand if it is clear that it has been set to 1 in an interrupt handling routine, etc. 2.7 addressing modes and eff ective address calculation 2.7.1 ad d ressing mode the cpu supports the eight addressing modes listed in table 2.11. each instruction uses a subset of these addressing modes. arithmetic and logic instructions can use the register direct and immediate modes. data transfer instructions can use all addressing modes except program-counter relative and memory indirect. bit-manipulation instructions use register direct, register indirect, or absolute addressing mode to specify an operand, and register direct (bset, bclr, bnot, and btst instructions) or immediate (3-bit) addressing mode to specify a bit number in the operand. table 2.11 addressing modes no. addressing mode symbol 1 register direct rn 2 register indirect @ern 3 register indirect with displacement @(d:16,ern)/@(d:32,ern) 4 register indirect with post-increment register indirect with pre-decrement @ern+ @-ern 5 absolute address @aa:8/#@aa:16/@aa:24/@aa:32 6 immediate #xx:8/#xx:16/#xx:32 7 program-counter relative @(d:8,pc)/@(d:16,pc) 8 memory indirect @@aa:8 (1) register direct ? rn the register field of the instruction code specifies an 8-, 16-, or 32-bit general register containing the operand. r0h to r7h and r0l to r7l can be specified as 8-bit registers. r0 to r7 and e0 to e7 can be specified as 16-bit registers. er0 to er7 can be specified as 32-bit registers. section 2 cpu rev.3.00 jan. 10, 2007 page 47 of 1038 rej09b0328-0300 (2) register indirect ? @ern the register field of the instruc tion code specifies an address re gister (ern) which contains the address of the operand in memory. if the address is a program instruction address, the lower 24 bits are valid and the upper 8 bits are all assumed to be 0 (h'00). (3) register indirect with displacement ? @(d:16, ern) or @(d:32, ern) a 16-bit or 32-bit displacement contained in the inst ruction is added to an address register (ern) specified by the register field of the instructio n, and the sum gives the address of a memory operand. a 16-bit displacement is sign-extended when added. (4) register indirect with po st-increment or pre-decrement ? @ern+ or @-ern ? register indirect with post-increment ? @ern+ the register field of the instruc tion code specifies an address re gister (ern) which contains the address of a memory operand. after the operand is accessed, 1, 2, or 4 is added to the address register contents and the sum is stored in the address register. the value added is 1 for byte access, 2 for word access, or 4 for longword access. for word or longword access, the register value should be even. ? register indirect with pre-decrement ? @-ern the value 1, 2, or 4 is subtracted from an address register (ern) specified by the register field in the instruction code, and the result becomes th e address of a memory operand. the result is also stored in the address register. the value s ubtracted is 1 for byte access, 2 for word access, or 4 for longword access. for word or longword access, the register value should be even. (5) absolute address ? @aa:8, @aa:16, @aa:24, or @aa:32 the instruction code contains th e absolute address of a memory operand. the absolute address may be 8 bits long (@aa:8), 16 bits long (@aa:16), 24 bits long (@aa:24), or 32 bits long (@aa:32). to access data, the absolute address should be 8 bits (@aa:8), 16 bits (@aa:16), or 32 bits (@aa:32) long. for an 8-bit absolute address, th e upper 24 bits are all a ssumed to be 1 (h'ffff). for a 16-bit absolute address the upper 16 bits are a sign extension. a 32-bit absolute address can access the entire address space. a 24-bit absolute address (@aa:24) indicates the address of a program instruction. the upper 8 bits are all assumed to be 0 (h'00). table 2.12 indicates the accessi ble absolute address ranges. section 2 cpu rev.3.00 jan. 10, 2007 page 48 of 1038 rej09b0328-0300 table 2.12 absolute address access ranges absolute address normal mode advanced mode data address 8 bits (@aa:8) h'ff00 to h'ffff h'ffff00 to h'ffffff 16 bits (@aa:16) h'0000 to h'ffff h'000000 to h'007fff, h'ff8000 to h'ffffff 32 bits (@aa:32) h'000000 to h'ffffff program instruction address 24 bits (@aa:24) (6) immediate ? #xx:8, #xx:16, or #xx:32 the instruction contains 8-bit (#xx:8), 16-bit (#xx:16), or 32-bit (#xx:32) immediate data as an operand. the adds, subs, inc, and dec instructions contain immediate data implicitly. some bit manipulation instructions contain 3-bit immediate data in the instruction code, specifying a bit number. the trapa instruction contains 2-bit immediate data in its instruction code, specifying a vector address. (7) program-counter relative ? @(d:8, pc) or @(d:16, pc) this mode is used in the bcc and bsr instructions. an 8-bit or 16-bit displacement contained in the instruction is sign-extended and added to the 24-bit pc contents to generate a branch address. only the lower 24 bits of this branch address are valid; the upper 8 bits are all assumed to be 0 (h'00). the pc value to which the displacement is added is the addre ss of the first byte of the next instruction, so the possible branching range is -126 to +128 bytes (-63 to +64 words) or -32766 to +32768 bytes (-16383 to +16384 words) from the branch instruction. the resulting value should be an even number. (8) memory indirect ? @@aa:8 this mode can be used by the jmp and jsr instructions. the instruction code contains an 8-bit absolute address specifying a memory operand. this memory operand contains a branch address. the upper bits of the absolute address are all a ssumed to be 0, so the address range is 0 to 255 (h'0000 to h'00ff in normal mode, h'000000 to h' 0000ff in advanced mode). in normal mode the memory operand is a word operand and the branch address is 16 bits long. in advanced mode the memory operand is a longword operand, the first byte of which is assumed to be all 0 (h'00). section 2 cpu rev.3.00 jan. 10, 2007 page 49 of 1038 rej09b0328-0300 note that the first part of the address range is also the exception vector area. for further details, see section 5, exception handling. (a) normal mode (b) advanced mode branch address specified by @aa:8 specified by @aa:8 reserved branch address figure 2.13 branch a ddress specification in memory indirect mode if an odd address is specified in word or longwor d memory access, or as a branch address, the least significant bit is regarded as 0, causing data to be accessed or an instruction code to be fetched at the address preceding the specified addre ss. (for further information, see section 2.5.2, memory data formats.) 2.7.2 effective address calculation table 2.13 indicates how effective addre sses are calculated in each addressing mode. in normal mode the upper 8 bits of the effective address are ignored in order to generate a 16-bit address. section 2 cpu rev.3.00 jan. 10, 2007 page 50 of 1038 rej09b0328-0300 table 2.13 effective address calculation no. addressing mode and instruction format effective address calculation effective address (ea) 1 register direct (rn) op rm rn operand is general register contents 2 register indirect (@ern) general register contents 31 0 31 0 r op 24 23 don?t care 3 register indirect with displacement @(d:16, ern) or @(d:32, ern) general register contents sign extension disp 31 0 31 0 31 0 op r disp don?t care 24 23 4 register indirect with post-increment or pre-decrement ? register indirect with post-increment @ern+ general register contents 1, 2, or 4 31 0 31 0 r op don?t care 24 23 ? register indirect with pre-decrement @?ern general register contents 1, 2, or 4 byte word longword 1 2 4 operand size value added 31 0 31 0 op r don?t care 24 23 section 2 cpu rev.3.00 jan. 10, 2007 page 51 of 1038 rej09b0328-0300 no. addressing mode and instruction format effective address calculation effective address (ea) 5 absolute address @aa:8 @aa:16 @aa:32 31 0 8 7 @aa:24 31 0 16 15 31 0 31 0 op abs op abs abs op op abs h'ffff 24 23 don?t care don?t care don?t care don?t care 24 23 24 23 24 23 sign exten- sion 6 immediate #xx:8/#xx:16/#xx:32 op imm operand is immediate data 7 program-counter relative @(d:8, pc)/@(d:16, pc) 0 0 23 23 disp 31 0 24 23 op disp pc contents don?t care sign exten- sion section 2 cpu rev.3.00 jan. 10, 2007 page 52 of 1038 rej09b0328-0300 no. addressing mode and instruction format effective address calculation effective address (ea) 8 memory indirect @@aa:8 ? normal mode * 0 0 31 8 7 0 15 h'000000 31 0 16 15 op abs abs memory contents h'00 24 23 don?t care ? advanced mode 31 0 31 8 7 0 abs h'000000 31 0 24 23 op abs memory contents don?t care note: * not available in this lsi. section 2 cpu rev.3.00 jan. 10, 2007 page 53 of 1038 rej09b0328-0300 2.8 processing states 2.8.1 overview the cpu has four main processing states: the reset state, exception-handling state, program execution state, and power-down state. figure 2. 14 shows a diagram of the processing states. figure 2.15 indicates the state transitions. reset state the cpu and all on-chip supporting modules have been initialized and are stopped. exception-handling state a transient state in which the cpu changes the normal processing flow in response to a reset, interrupt or trap instruction. program execution state the cpu executes program instructions in sequence. power-down state cpu operation is stopped to conserve power. * sleep mode standby mode processing states note: * the power-down state also includes a medium-speed mode, modue stop mode, sub-active mode, sub-sleep mode and watch mode. figure 2.14 processing states section 2 cpu rev.3.00 jan. 10, 2007 page 54 of 1038 rej09b0328-0300 reset state exception-handling state sleep mode standby mode power-down state program execution state interr upt request external interrupt request res = high request for exception handlin g sleep inst ruc tion with lson = 0, tma3 = 0, ssby = 0 sleep instruction with lson = 0, ssby = 0 end of exception handling * 1 * 2 notes: 1. 2. from any state, a transition to the reset state occurs whenever res goes low. a transition can also be made to the reset state when the watchdog timer overflows. the power-down state also includes a watch mode, subactive mode, subsleep mode, etc. for details, see section 4, power-down state. figure 2.15 state transitions 2.8.2 reset state when the res input goes low all current processing stops and the cpu enters the reset state. all interrupts are disabled in the reset state. reset exception handling starts when the res signal changes from low to high. the reset state can also be entered by a watc hdog timer overflow. for details, see section 18, watchdog timer (wdt). section 2 cpu rev.3.00 jan. 10, 2007 page 55 of 1038 rej09b0328-0300 2.8.3 exception-handling state the exception-handling state is a transient state that occurs when the cp u alters the normal processing flow due to a reset, interrupt, or trap instruction. the cpu fetches a start address (vector) from the exception vector tabl e and branches to that address. (1) types of exception ha ndling and their priority exception handling is performed for resets, interrupts, and trap instructions. table 2.14 indicates the types of exception handling and their priority. trap instruction exception handling is always accepted in the program execution state. exception handling and the stack structure depend on the interrupt control mode set in syscr. table 2.14 exception handling types and priority priority type of exception detection timing start of exception handling reset synchronized with clock exception handling starts immediately after a low-to-high transition at the res pin, or when the watchdog timer overflows interrupt end of instruction execution or end of exception-handling sequence * 1 when an interrupt is requested, exception handling starts at the end of the current instruction or current exception-handling sequence high low trap instruction when trapa instruction is executed exception handling starts when a trap (trapa) instruction is executed * 2 notes: 1. interrupts are not detected at the end of the andc, orc, xorc, and ldc instructions, or immediately after reset exception handling. 2. trap instruction exception handling is alwa ys accepted in the program execution state. (2) reset exception handling after the res pin has gone low and the reset state has been entered, when res goes high again, reset exception handling starts. when reset exception handling starts the cpu fetches a start address (vector) from the exception vector table and starts program execution from that address. all interrupts, including nmi, are disabled during reset exception handling and after it ends. (3) interrupt exception handling and trap instruction exception handling when interrupt or trap-instruction exception handling begins, the cpu references the stack pointer (er7) and pushes the program counter and other control registers onto the stack. next, the cpu section 2 cpu rev.3.00 jan. 10, 2007 page 56 of 1038 rej09b0328-0300 alters the settings of the interrupt mask bits in the control registers. then the cpu fetches a start address (vector) from the exception vector table and program execution starts from that start address. figure 2.16 shows the stack after exception handling ends. pc (16 bits) sp ccr ccr * 1 pc (24 bits) sp ccr normal mode * 2 advanced mode notes: 1. ignored when returning. 2. normal mode is not available for this lsi. figure 2.16 stack structure after exception handling (examples) 2.8.4 program execution state in this state the cpu executes pr ogram instructions in sequence. section 2 cpu rev.3.00 jan. 10, 2007 page 57 of 1038 rej09b0328-0300 2.8.5 power-down state the power-down state includes both modes in which the cpu stops operating and modes in which the cpu does not stop. there are five modes in which the cpu stops operating: sleep mode, standby mode, subsleep mode, and watch mode. there are also three other power-down modes: medium-speed mode, module stop mode, and subactive mode. in medium-speed mode, the cpu operates on a medium-speed clock. module stop mode permits halting of the operation of individual modules, other than the cpu. subactive mode, subsleep mode, and watch mode are power-down modes that use subclock input. for details, see section 4, power-down state. (1) sleep mode a transition to sleep mode is made if the s leep instruction is execu ted while the software standby bit (ssby) in the standby control register (sbycr) and the lson bit in the low-power control register (lpwrcr) are both cleared to 0. in sleep mode, cpu operations stop immediately after execution of th e sleep instruction. the contents of cpu registers are retained. (2) standby mode a transition to standby mode is made if the sleep instruction is executed while the ssby bit in sbycr is set to 1 and the lson bit in lpwrcr and the tma3 bit in the tma (timer a) are both cleared to 0. in standby mode, the cpu a nd clock halt and all mcu operations stop. as long as a specified voltage is supplied, the contents of cpu registers and on-chip ram are retained. section 2 cpu rev.3.00 jan. 10, 2007 page 58 of 1038 rej09b0328-0300 2.9 basic timing 2.9.1 overview the cpu is driven by a system clock, denoted by the symbol . the period from one rising edge of to the next is referred to as a ?state.? the me mory cycle or bus cycle consists of one or two states. different methods are us ed to access on-chip memory and on-chip supporting modules. 2.9.2 on-chip memory (rom, ram) on-chip memory is accessed in one state. the data bus is 16 bits wide, permitting both byte and word transfer instruction. figure 2.17 shows the on-chip memory access cycle. internal address bus internal read signal internal data bus internal write signal internal data bus bus cycle t1 address read data write data read access write access figure 2.17 on-chip memory access cycle section 2 cpu rev.3.00 jan. 10, 2007 page 59 of 1038 rej09b0328-0300 2.9.3 on-chip supporting module access timing the on-chip supporting modules are accessed in two stat es. the data bus is either 8 bits or 16 bits wide, depending on the particular internal i/o register being accessed. figure 2.18 shows the access timing for the on-chip supporting modules. internal address bus internal read signal internal data bus internal write signal internal data bus bus cycle t1 address read access write access read data write data t2 figure 2.18 on-chip supporting module access cycle 2.10 usage note only register er0, er1, er4, or er5 should be used when using the tas instruction. the tas instruction is not generated by the renesas technology h8s or h8/300 series c/c++ compilers. if the tas instruction is used as a user-defined intrinsic function, ensure that only register er0, er1, er4, or er5 is used. section 2 cpu rev.3.00 jan. 10, 2007 page 60 of 1038 rej09b0328-0300 section 3 mcu operating modes rev.3.00 jan. 10, 2007 page 61 of 1038 rej09b0328-0300 section 3 mcu operating modes 3.1 overview 3.1.1 operating mode selection this lsi has one operating mode (mode 1). this mode is selected depending on settings of the mode pin (md0). table 3.1 lists the mcu operating modes. table 3.1 mcu operating mode selection mcu operating mode md0 cpu operating mode description 0 0 ? ? 1 1 advanced single-chip mode the cpu's architecture allows for 4 gbytes of address space, but this lsi actually accesses a maximum of 16 mbytes. mode 1 operation starts in single-chip mode after reset release. this lsi can only be used in mode 1. this means that the mode pins must be set at mode 1. do not changes the inputs at the mode pins during operation. 3.1.2 register configuration this lsi has a mode control register (mdcr) that indicates the inputs at the mode pin (md0) and a system control register (syscr) and that controls the operation of this lsi. table 3.2 summarizes these registers. table 3.2 mcu registers name abbreviation r/w initial value address * mode control register mdcr r/w undetermined h'ffe9 system control register syscr r/w h'09 h'ffe8 note: * lower 16 bits of the address. section 3 mcu operating modes rev.3.00 jan. 10, 2007 page 62 of 1038 rej09b0328-0300 3.2 register descriptions 3.2.1 mode control register (mdcr) 0 ? * 1 0 2 0 3 0 4 0 5 ? ? ? ? ? 0 6 ? 0 7 ? ? ? ? ? ? ? ? r mds0 0 bit : initial value : r/w : note: * determined by md0 pin mdcr is an 8-bit read-only register monitors the current operating mode of this lsi. bits 7 to 1 ? reserved: these bits cannot be modified and are always set at 0. bit 0 ? mode select 0 (mds0): this bit indicates the value which reflects the input levels at mode pin (md0) (the current operating mode). bit mds0 corresponds to md0 pin. it is read-only bit and cannot be written to. the mode pin (md0) input levels are latched into these bits when mdcr is read. 3.2.2 system control register (syscr) 0 ? 1 1 0 r/w 2 0 r/w 3 1 4 0 r/w 5 0 6 ? 0 7 ? ? ? ? r r intm1 intm0 xrst nmieg1 nmieg0 0 bit : initial value : r/w : bits 7 and 6 ? reserved. bits 5 and 4 ? interrupt control modes 1 and 0 (intm1, intm0): these bits are for selecting the interrupt control mode of the interrupt controller. for details of the interrupt control modes, see section 6.4, interrupt operation. bit 5 bit 4 intm1 intm0 interrupt control mode description 0 0 interrupt is controlled by bit i (initial value) 0 1 1 interrupt is controlled by bits i and ui, and icr 1 0 2 cannot be used in this lsi 1 3 cannot be used in this lsi section 3 mcu operating modes rev.3.00 jan. 10, 2007 page 63 of 1038 rej09b0328-0300 bit 3 ? external reset (xrst) : indicates the reset source. when the watchdog timer is used, a reset can be generated by watchdog timer overflow as well as by external reset input. xrst is a read-only bit. it is set to 1 by an external reset and cleared to 0 by watchdog timer overflow. bit 3 xrst description 0 a reset is generated by watchdog timer overflow 1 a reset is generated by an external reset (initial value) bits 2 and 1 ? nmi edge select 1 and 0 (nmig1, 0) : select the input edge for nmi interrupt. bit 2 bit 1 nimieg1 nimieg0 description 0 an interrupt request occurs at falling edge of nmi input (initial value) 0 1 an interrupt request occurs at rising edge of nmi input 1 * an interrupt request occurs at rising or falling edge of nmi input legend: * don't care bit 0 ? reserved. 3.3 operating mode descriptions 3.3.1 mode 1 the cpu can access a 16 mbyte address space in advanced mode. section 3 mcu operating modes rev.3.00 jan. 10, 2007 page 64 of 1038 rej09b0328-0300 3.4 address map h8s/2191 h8s/2192 memory indirect branch address absolute address, 16 bits 3 kbytes vector area on-chip rom (80 kbytes) internal i/o register internal i/o register on-chip ram (3 kbytes) vector area on-chip rom (96 kbytes) internal i/o register internal i/o register on-chip ram (3 kbytes) h'000000 h'000000 h'017fff h'ffd000 h'ffd2ff h'fff3b0 h'ffffaf h'ffffb0 h'ffffff h'0000ff h'007fff h'013fff h'ff8000 h'ffd000 h'ffd2ff h'fff3b0 h'ffff00 h'ffffaf h'ffffb0 h'ffffff absolut e address, 8 bits absolute address, 16 bits figure 3.1 address map (1) section 3 mcu operating modes rev.3.00 jan. 10, 2007 page 65 of 1038 rej09b0328-0300 h8s/2193 h8s/2194 vector area on-chip rom (112 kbytes) internal i/o register internal i/o register on-chip ram (3 kbytes) vector area on-chip rom (128 kbytes) internal i/o register internal i/o register on-chip ram (3 kbytes) h'000000 h'000000 h'01ffff h'ffd000 h'ffd2ff h'fff3b0 h'ffffaf h'ffffb0 h'ffffff h'01bfff h'ffd000 h'ffd2ff h'fff3b0 h'ffffaf h'ffffb0 h'ffffff figure 3.2 address map (2) section 3 mcu operating modes rev.3.00 jan. 10, 2007 page 66 of 1038 rej09b0328-0300 h8s/2191a h8s/2194b memory indirect branch address absolute address, 16 bits 6 kbytes vector area on-chip rom (160 kbytes) internal i/o register internal i/o register on-chip ram (6 kbytes) vector area on-chip rom (192 kbytes) internal i/o register internal i/o register on-chip ram (6 kbytes) h'000000 h'000000 h'02ffff h'ffd000 h'ffd2ff h'ffe7b0 h'ffffaf h'ffffb0 h'ffffff h'0000ff h'007fff h'027fff h'ff8000 h'ffd000 h'ffd2ff h'ffe7b0 h'ffff00 h'ffffaf h'ffffb0 h'ffffff absolute address, 8 bits absolute address, 16 bits figure 3.3 address map (3) section 3 mcu operating modes rev.3.00 jan. 10, 2007 page 67 of 1038 rej09b0328-0300 h8s/2194c vector area on-chip rom (256 kbytes) internal i/o register internal i/o register on-chip ram (6 kbytes) h'000000 h'03ffff h'ffd000 h'ffd2ff h'ffe7b0 h'ffffaf h'ffffb0 h'ffffff figure 3.4 address map (4) section 3 mcu operating modes rev.3.00 jan. 10, 2007 page 68 of 1038 rej09b0328-0300 section 4 power-down state rev.3.00 jan. 10, 2007 page 69 of 1038 rej09b0328-0300 section 4 power-down state 4.1 overview in addition to the normal program execution state, this lsi has a power-down state in which operation of the cpu and oscillator is halted and power dissipation is reduced. low-power operation can be achieved by individually controlling the cpu, on-chip supporting modules, and so on. this lsi operating modes are as follows: 1. high-speed mode 2. medium-speed mode 3. subactive mode 4. sleep mode 5. subsleep mode 6. watch mode 7. module stop mode 8. standby mode of these, 2 to 8 are power-down modes. certai n combinations of these modes can be set. after a reset, the mcu is in high-speed mode. table 4.1 shows the internal chip states in each mode, and table 4.2 shows the conditions for transition to the various modes. figure 4.1 shows a mode transition diagram. section 4 power-down state rev.3.00 jan. 10, 2007 page 70 of 1038 rej09b0328-0300 table 4.1 internal chip states in each mode function high-speed medium- speed sleep module stop watch subactive subsleep standby system clock functioning functioning functioning functioning halted halted halted halted subclock pulse generator functioning functioning functioning functioning functioning functioning functioning functioning instructions halted halted halted halted cpu operation registers functioning medium- speed retained functioning retained subclock operation retained retained nimi irq0 irq1 functioning functioning functioning functioning irq2 irq3 irq4 external interrupts irq5 functioning functioning functioning functioning halted halted functioning halted timer a functioning functioning functioning functioning/ halted (retained) subclock operation subclock operation subclock operation halted (retained) timer b timer j timer l timer r functioning/ halted (retained) halted (retained) halted (retained) halted (retained) halted (retained) timer x1 functioning functioning functioning functioning/ halted (reset) halted (reset) halted (reset) halted (reset) halted (reset) watchdog timer functioning functioning functioning functioning halted (retained) halted (retained) halted (retained) halted (retained) psu functioning subclock operation subclock operation subclock operation halted iic sci1 functioning/ halted (reset) halted (reset) halted (reset) halted (reset) halted (reset) sci2 14-bit pwm 8-bit pwm functioning/ halted (retained) halted (retained) halted (retained) halted (retained) halted (retained) a/d functioning functioning functioning functioning/ halted (reset) halted (reset) halted (reset) halted (reset) halted (reset) i/o functioning functioning retained functioning halted functioning retained halted 12-bit pwm on-chip supporting module operation servo functioning functioning halted (reset) functioning/ halted (reset) halted (reset) halted (reset) halted (reset) halted (reset) notes: 1. "halted (retained)" means that internal register values are retained. the internal state is "operation suspended." 2. "halted (reset)" means that internal register values and internal states are initialized. 3. in module stop mode, only modules for which a stop setting has been made are halted (reset or retained). 4. in the power-down mode, the analog section of the servo circuits are not turned off, therefore vcc (servo) current does not go low. when power-down is needed, externally shut down the analog system power. section 4 power-down state rev.3.00 jan. 10, 2007 page 71 of 1038 rej09b0328-0300 program-halted state conditions for mode transition (1) conditions for mode transition (2) interruption factor sleep (high-speed) mode sleep (medium-speed) mode subsleep mode program execution state reset state flag sleep instruction interrupt lson ssby tma3 dton a 010 * b * 110 c 0111 d 1111 e 00 ** f 101 * g sck1 to 0 = 0 h sck1 to 0 0 (either 1 bit = 0) power-down mode active (high-speed) mode active (medium-speed) mode subactive mode program-halted state watch mode standby mode nmi, irq0 to 1 nmi, irq0 to 1, timer a interruption all interruption (excluding servo system) nmi, irq0 to 5, timer a interruption 1 2 3 4 interrupt interrupt sleep instruction sleep instruction e note: when a transition is made between modes by means of an interrupt, transition cannot be made on interrupt source generation alone. ensure that interrupt handling is performed after accepting the interrupt request sleep instruction a 1 interrupt 1 2 sleep instruction sleep instruction sleep instruction sleep instruction a b g h d sleep instruction c e 3 interrupt 2 interrupt 3 interrupt 2 interrupt 4 c sleep instruction d b b sleep instruction sleep instruction 1 legend: * don't care figure 4.1 mode transitions section 4 power-down state rev.3.00 jan. 10, 2007 page 72 of 1038 rej09b0328-0300 table 4.2 power-down mode transition conditions control bit states at time of transition state before transition ssby tma3 lson dton state after transition by sleep instruction state after return by interrupt 0 * 0 * sleep high-speed/ medium-speed * 1 0 * 1 * ? ? 1 0 0 * standby high-speed/ medium-speed * 1 1 0 1 * ? ? 1 1 0 0 watch high-speed/ medium-speed * 1 1 1 1 0 watch subactive 1 1 0 1 ? ? high-speed/ medium-speed 1 1 1 1 subactive ? 0 0 * * ? ? 0 1 0 * ? ? 0 1 1 * subsleep subactive 1 0 * * ? ? 1 1 0 0 watch high-speed/ medium-speed * 2 1 1 1 0 watch subactive 1 1 0 1 high-speed/ medium-speed * 2 ? subactive 1 1 1 1 ? ? legend: * don't care ? : do not set. notes: 1. returns to the state before transition. 2. mode varies depending on the state of sck1 to sck0. section 4 power-down state rev.3.00 jan. 10, 2007 page 73 of 1038 rej09b0328-0300 4.1.1 register configuration the power-down state is controlled by the sbycr, lpwrcr, tma (timer a), and mstpcr registers. table 4.3 summarizes these registers. table 4.3 power-down state registers name abbreviation r/w initial value address * standby control register sbycr r/w h'00 h'ffea low-power control register lpwrcr r/w h'00 h'ffeb mstpcrh r/w h'ff h'ffec module stop control register mstpcrl r/w h'ff h'ffed timer mode register tma r/w h'30 h'ffba note: * lower 16 bits of the address. section 4 power-down state rev.3.00 jan. 10, 2007 page 74 of 1038 rej09b0328-0300 4.2 register descriptions 4.2.1 standby control register (sbycr) 0 0 1 0 r/w 2 0 3 ? ? ? ? 0 4 0 r/w 5 0 6 0 7 r/w r/w sts1 r/w sts2 0 r/w ssby sts0 sck1 sck0 bit : initial value : r/w : sbycr is an 8-bit readable/writable register that performs power-down mode control. sbycr is initialized to h'00 by a reset. bit 7 ? software standby (ssby): determines the operating mode, in combination with other control bits, when a power-down mode transition is made by executing a sleep instruction. the ssby setting is not changed by a mode transition due to an interrupt, etc. bit 7 ssby description 0 transition to sleep mode after execution of sleep instruction in high-speed mode or medium-speed mode transition to subsleep mode after execution of sleep instruction in subactive mode (initial value) 1 transition to standby mode, subactive mode, or watch mode after execution of sleep instruction in high-speed mode or medium-speed mode transition to watch mode or high-speed mode after execution of sleep instruction in subactive mode section 4 power-down state rev.3.00 jan. 10, 2007 page 75 of 1038 rej09b0328-0300 bits 6 to 4 ? standby timer select 2 to 0 (sts2 to sts0): these bits select the time the mcu waits for the clock to stabilize when standby mode, watch mode, or subactive mode is cleared and a transition is made to high-speed mode or medium-speed mode by means of a specific interrupt or instruction. with crystal oscillation, see table 4.5 and make a selection according to the operating frequency so that the standby time is at least 10 ms (the oscillation settling time). with an external clock, any selection can be made. (with flash rom version, do not set the standby time to 16 states.) bit 6 bit 5 bit 4 sts2 sts1 sts0 description 0 0 0 standby time = 8192 states 0 0 1 standby time = 16384 states 0 1 0 standby time = 32768 states 0 1 1 standby time = 65536 states 1 0 0 standby time = 131072 states 1 0 1 standby time = 262144 states 1 1 * standby time = 16 states * 1 legend: * don't care note: 1. with flash rom version, do not set the standby time to 16 states. the standby time is 32 states when transited to medium-speed mode /32 (sck1 = 1, sck0 = 0). bits 3 and 2 ? reserved: these bits cannot be modified and are always read as 0. bits 1 and 0 ? system clock select 1, 0 (sck1, sck0) : these bits select the cpu clock for the bus master in high-speed mode and medium-speed mode. bit 1 bit 0 sck1 sck0 description 0 0 bus master is in high-speed mode (initial value) 0 1 medium-speed clock is /16 1 0 medium-speed clock is /32 1 1 medium-speed clock is /64 section 4 power-down state rev.3.00 jan. 10, 2007 page 76 of 1038 rej09b0328-0300 4.2.2 low-power control register (lpwrcr) 0 0 1 0 r/w r/w 2 0 3 0 4 ? ? ? ? ? ? 0 5 0 6 0 7 r/w nesel r/w lson 0 r/w dton sa1 sa0 bit : initial value : r/w : lpwrcr is an 8-bit readable/writable register that performs power-down mode control. lpwrcr is initialized to h'00 by a reset. bit 7 ? direct-transfer on flag (dton): specifies whether a direct transition is made between high-speed mode, medium-speed mode, and subactive mode when making a power-down transition by executing a sleep instruction. the operating mode to which the transition is made after sleep instruction execution is determin ed by a combination of other control bits. bit 7 dton description 0 ? when a sleep instruction is executed in high-speed mode or medium-speed mode, a transition is made to sleep mode, standby mode, or watch mode ? when a sleep instruction is executed in subactive mode, a transition is made to subsleep mode or watch mode (initial value) 1 ? when a sleep instruction is executed in high-speed mode or medium-speed mode, transition is made directly to subactive mode, or a transition is made to sleep mode or standby mode ? when a sleep instruction is executed in subactive mode, a transition is made directly to high-speed mode, or a transition is made to subsleep mode section 4 power-down state rev.3.00 jan. 10, 2007 page 77 of 1038 rej09b0328-0300 bit 6 ? low-speed on flag (lson): determines the operating mode in combination with other control bits when making a power-down tran sition by executing a sleep instruction. also controls whether a transition is made to high-speed mode or to subactive mode when watch mode is cleared. bit 6 lson description 0 ? when a sleep instruction is executed in high-speed mode or medium-speed mode, transition is made to sleep mode, standby mode, or watch mode ? when a sleep instruction is executed in subactive mode, a transition is made to watch mode, or directly to high-speed mode ? after watch mode is cleared, a transition is made to high-speed mode (initial value) 1 ? when a sleep instruction is executed in high-speed mode a transition is made to watch mode, subactive mode, sleep mode or standby mode ? when a sleep instruction is executed in subactive mode, a transition is made to subsleep mode or watch mode ? after watch mode is cleared, a transition is made to subactive mode bit 5 ? noise elimination sampling frequency select (nesel): selects the frequency at which the subclock ( w) generated by the subclock pulse generator is sampled with the clock ( ) generated by the system clock oscillator. when = 5 mhz or higher, clear this bit to 0. bit 5 nesel description 0 sampling at divided by 16 1 sampling at divided by 4 bits 4 to 2 ? reserved: these bits cannot be modified and are always read as 0. section 4 power-down state rev.3.00 jan. 10, 2007 page 78 of 1038 rej09b0328-0300 bits 1 and 0 ? subactive mode clock select 1, 0 (sa1, sa0): these bits select the cpu operating clock in the subactive mode. these bits cannot be modified in the subactive mode. bit 1 bit 0 sa1 sa0 description 0 0 operating clock of cpu is w/8 (initial value) 0 1 operating clock of cpu is w/4 1 * operating clock of cpu is w/2 legend: * don't care 4.2.3 timer register a (tma) 0 0 1 0 r/w 2 0 3 0 4 1 5 ? ? 1 6 0 7 r/w r/w r/w r/w tma3 r/w tma2 r/w tmaie 0 r/(w) * tmaov tma1 tma0 bit : initial value : r/w : note: * only 0 can be written, to clear the flag. the timer register a (tma) controls timer a interrupts and selects input clock. only bit 3 is explained here. for details of othe r bits, see section 12.2.1, timer mode register a (tma). tma is a readable/writable register which is initialized to h'30 by a reset. section 4 power-down state rev.3.00 jan. 10, 2007 page 79 of 1038 rej09b0328-0300 bit 3 ? clock source, prescaler select (tma3): selects timer a clock source between pss and psw. also controls transition operation to the power-down mode. the operation mode to which the mcu is transited after sleep inst ruction execution is determined by the combination with other control bits than this bit. for details, see the description of clock select 2 to 0 in section 12.2.1, timer mode register a (tma). bit 3 tma3 description 0 ? timer a counts -based prescaler (pss) divided clock pulses ? when a sleep instruction is executed in high-speed mode or medium-speed mode, a transition is made to sleep mode or software standby mode (initial value) 1 ? timer a counts w-based prescaler (psw) divided clock pulses ? when a sleep instruction is executed in high-speed mode or medium-speed mode, a transition is made to sleep mode, watch mode, or subactive mode ? when a sleep instruction is executed in subactive mode, a transition is made to subsleep mode, watch mode, or high-speed mode 4.2.4 module stop control register (mstpcr) 7 1 mstp15 r/w mstpcrh 6 1 mstp14 r/w 5 1 mstp13 r/w 4 1 mstp12 r/w 3 1 mstp11 r/w 2 1 mstp10 r/w 1 1 mstp9 r/w 0 1 mstp8 r/w 7 1 mstp7 r/w 6 1 mstp6 r/w 5 1 mstp5 r/w 4 1 mstp4 r/w 3 1 mstp3 r/w 2 1 mstp2 r/w 1 1 mstp1 r/w 0 1 mstp0 r/w mstpcrl bit : initial value : r/w : mstpcr comprises two 8-bit readable/writable registers that perform module stop mode control. mstpcr is initialized to h'ffff by a reset. mstrcrh and mstpcrl bits 7 to 0 ? module stop (mstp 15 to mstp 0): these bits specify module stop mode. see table 4.4 for the method of selecting on-chip supporting modules. mstpcrh, mstpcrl bits 7 to 0 mstp 15 to mstp 0 description 0 module stop mode is cleared 1 module stop mode is set (initial value) section 4 power-down state rev.3.00 jan. 10, 2007 page 80 of 1038 rej09b0328-0300 4.3 medium-speed mode when the sck1 and sck0 bits in sbycr are set to 1 in high-speed mode, the operating mode changes to medium-speed mode at the end of the bus cycle. in medium-speed mode, the cpu operates on the operating clock ( 16, 32 or 64) specified by the sck1 and sck0 bits. the on- chip supporting modules other than the cpu always operate on the high-speed clock ( ). in medium-speed mode, a bus access is executed in the specified number of states with respect to the bus master operating clock. for example, if 16 is selected as the operating clock, on-chip memory is accessed in 16 states, and internal i/o registers in 32 states. medium-speed mode is cleared by clearing the both bits sck1 and sck0 to 0. a transition is made to high-speed mode and medium-speed mode is cleared at the end of the current bus cycle. if a sleep instruction is exec uted when the ssby bit in sbycr and the lson bit in lpwrcr are cleared to 0, a transition is made to sleep mode. when sleep mode is cleared by an interrupt, medium-speed mode is restored. if a sleep instruction is executed when the ssby bit in sbycr is set to 1, and the lson bit in lpwrcr and the tma3 bit in tma (timer a) are both cleared to 0, a transition is made to software standby mode. when standby mode is cleared by an external interrupt, medium-speed mode is restored. when the res pin is driven low, a transition is made to the reset state, and medium-speed mode is cleared. the same applies in the case of a re set caused by overflow of the watchdog timer. figure 4.2 shows the timing for transition to and clearance of medium-speed mode. medium-speed mode internal , supporting module clock cpu clock internal address bus internal write signal sbycr sbycr figure 4.2 medium-speed mode transition and clearance timing section 4 power-down state rev.3.00 jan. 10, 2007 page 81 of 1038 rej09b0328-0300 4.4 sleep mode 4.4.1 sleep mode if a sleep instruction is execut ed when the ssby b it in sbycr and the lson bit in lpwrcr are both cleared to 0, the cpu enters sleep mode. in sleep mode, cpu operation stops but the contents of the cpu's internal registers are retained. other supporting modules (excluding the servo circuit and 12-bit pwm) do not stop. 4.4.2 clearing sleep mode sleep mode is cleared by any interrupt, or with the res pin. (1) clearing with an interrupt when an interrupt request signal is input, sleep mode is cleared and interrupt exception handling is started. sleep mode will not be cleared if interrupts are disabled, or if interrupts other than nmi have been masked by the cpu. (2) clearing with the res pin when the res pin is driven low, the reset state is entered. when the res pin is driven high after the prescribed reset input period, the cpu begins reset exception handling. section 4 power-down state rev.3.00 jan. 10, 2007 page 82 of 1038 rej09b0328-0300 4.5 module stop mode 4.5.1 module stop mode module stop mode can be set for individual on-chip supporting modules. when the corresponding mstp bit in mstpcr is set to 1, module operation stops at the end of the bus cycle and a transition is made to module stop mode. the cpu continues operating independently. table 4.4 shows mstp bits and the on-chip supporting modules. when the corresponding mstp bit is cleared to 0, module stop mode is cleared and the module starts operating again at the end of the bus cycle. in module stop mode, the internal states of modules other than the sci1, a/d converter, timer x1, and servo circuit, are retained. after reset release, all modules are in module stop mode. when an on-chip supporting module is in module stop mode, read/write access to its registers is disabled. table 4.4 mstp bits and corresponding on-chip supporting modules register bit module mstp15 timer a mstp14 timer b mstp13 timer j mstp12 timer l mstp11 timer r mstp10 timer x1 mstp9 ? mstpcrh mstp8 serial communication interface 1 (sci1) mstp7 serial communication interface 2 (sci2) mstp6 i 2 c bus interface (iic) mstp5 14-bit pwm mstp4 8-bit pwm mstp3 ? mstp2 a/d converter mstp1 servo circuit, 12-bit pwm mstpcrl mstp0 ? section 4 power-down state rev.3.00 jan. 10, 2007 page 83 of 1038 rej09b0328-0300 4.6 standby mode 4.6.1 standby mode if a sleep instruction is execut ed when the ssby bit in sbycr is set to 1, the lson bit in lpwrcr is cleared to 0, and the tma3 bit in tm a (timer a) is cleared to 0, standby mode is entered. in this mode, the cpu, on-chip supporting modules, and oscillator (except for subclock oscillator) all stop. however, contents of the cpu's internal registers and data in the built-in ram as well as functions of the sci1, timer x1 and built- in peripheral circuits (except the servo circuit) are maintained in the curr ent state. the i/o port, at this time, is caused to the high impedance state. in this mode the oscillator stops, and therefore power dissipation is significantly reduced. 4.6.2 c l earing standby mode standby mode is cleared by an external interrupt (nmi pin, or pin irq0 and irq1 , or by means of the res pin. (1) clearing with an interrupt when an nmi, irq0 and irq1 interrupt request signal is i nput, clock oscillation starts, and after the elapse of the time set in bits sts2 to sts0 in sbycr, stable clocks are supplied to the entire chip, standby mode is cleared, and interrupt exception handling is started. standby mode cannot be cleared with an irq0 and irq1 interrupt if the corresponding enable bit has been cleared to 0 or has been masked by the cpu. (2) clearing with the res pin when the res pin is driven low, clock oscillation is started. at the same time as clock oscillation starts, clocks are supplied to the entire chip . note that the res pin must be held low until clock oscillation stabilizes. when the res pin goes high, the cpu begins reset exception handling. 4.6.3 setting oscillation settling time after clearing standby mode bits sts2 to sts0 in sbycr should be set as described below. (1) using a crystal oscillator set bits sts2 to sts0 so that the standby time is at l east 10 ms (the oscillation settling time). table 4.5 shows the standby times for different op erating frequencies and settings of bits sts2 to sts0. section 4 power-down state rev.3.00 jan. 10, 2007 page 84 of 1038 rej09b0328-0300 table 4.5 oscillation settling time settings sts2 sts1 sts0 standby time 10 mhz 8 mhz unit 0 8192 states 0.8 1.0 0 1 16384 states 1.6 2.0 0 32768 states 3.3 4.1 0 1 1 65536 states 6.6 8.2 0 131072 states 13.1 16.4 0 1 262144 states 26.2 32.8 ms 1 1 * 16 states * 1 1.6 2.0 s : recommended time setting legend: * don't care note: 1. with flash memory version, do not set the standby time to 16 states. the standby time is 32 states when transited to medium-speed mode /32 (sck1 = 1, sck0 = 0). (2) using an external clock any value can be set. section 4 power-down state rev.3.00 jan. 10, 2007 page 85 of 1038 rej09b0328-0300 4.7 watch mode 4.7.1 watch mode if a sleep instruction is executed in high-speed mode, medium-speed mode or subactive mode when the ssby in sbycr is set to 1, the dton bit in lpwrcr is cleared to 0, and the tma3 bit in tma (timer a) is set to 1, the cpu makes a transition to watch mode. in this mode, the cpu and all on-chip supporting modules except timer a stop. as long as the prescribed voltage is supplied, the contents of some of the cpu's internal registers and on-chip ram are retained, and i/o ports are placed in the high-impedance state. 4.7.2 clearing watch mode watch mode is cleared by an interrupt (timer a interrupt, nmi pin, or pin irq0 and irq1 ), or by means of the res pin. (1) clearing with an interrupt when an interrupt request signal is input, watch mode is cleared and a transition is made to high-speed mode or medium-speed mode if the lson bit in lpwrcr is cleared to 0, or to subactive mode if the lson bit is set to 1. when making a transition to medium-speed mode, after the elapse of the time set in bits sts2 to sts0 in sbycr, stable clocks are supplied to the entire chip, and interrupt exception handling is started. watch mode cannot be cleared with an irq0 and irq1 interrupt if the corresponding enable bit has been cleared to 0, or with an on-chi p supporting module interrupt if acceptance of the relevant interrupt has been disabled by the interrupt enable register or masked by the cpu. see section 4.6.3, setting oscillation settling time after clearing standby mode, for the oscillation settling time setting when making a transition from watch mode to high-speed mode. (2) clearing with the res pin see (2) clearing with the res pin in section 4.6.2, clearing standby mode. section 4 power-down state rev.3.00 jan. 10, 2007 page 86 of 1038 rej09b0328-0300 4.8 subsleep mode 4.8.1 subsleep mode if a sleep instruction is executed in subactive mode when the ssb y in sbycr is cleared to 0, the lson bit in lpwrcr is set to 1, and the tma3 bit in tma (timer a) is set to 1, the cpu makes a transition to subsleep mode. in this mode, the cpu and all on-chip supporting modules other than timer a stop. as long as the prescribed voltage is supplied, the contents of the cpu, some of its on-chip registers and on-chip ram are retained, and i/o ports retain their states prior to the transition. 4.8.2 clearing subsleep mode subsleep mode is cleared by an interrupt (timer a interrupt, nmi pin, or pin irq0 to irq5 ), or by means of the res pin. (1) clearing with an interrupt when an interrupt request signal is input, subsleep mode is cleared and interrupt exception handling is started. subsleep mode cannot be cleared with an irq0 to irq5 interrupt if the corresponding enable bit has been cleared to 0, or with an on-chip supporting module interrupt if acceptance of the relevant interrupt has been disabled by the interrupt enable register or masked by the cpu. (2) clearing with the res pin see (2) clearing with the res pin in section 4.6.2, clearing standby mode. section 4 power-down state rev.3.00 jan. 10, 2007 page 87 of 1038 rej09b0328-0300 4.9 subactive mode 4.9.1 subactive mode if a sleep instruction is executed in high-sp eed mode when the ssby bit in sbycr, the dton bit in lpwrcr, and the tma3 bit in tma (timer a) are all set to 1, the cpu makes a transition to subactive mode. when an interrupt is generated in watch mode, if the lson bit in lpwrcr is set to 1, a transition is made to subactive mode. when an interrupt is generated in subsleep mode, a transition is made to subactive mode. in subactive mode, the cpu performs sequential program execution at low speed on the subclock. in this mode, all on-chip supporting modules other than timer a stop. 4.9.2 clearing subactive mode subsleep mode is cleared by a sleep instruction, or by means of the res pin. (1) clearing with a sleep instruction when a sleep instruction is ex ecuted while the ssby bit in sb ycr is set to 1, the dton bit in lpwrcr is cleared to 0, and the tma3 bit in tma (timer a) is set to 1, subactive mode is cleared and a transition is made to watch mode. when a sleep instruction is executed while the ssby bit in sbycr is cleared to 0, the lson bit in lpwrcr is set to 1, and the tma3 bit in tma (timer a) is set to 1, a transition is made to subsleep mode. when a sleep instruction is executed wh ile the ssby bit in sbycr is se t to 1, the dton bit is set to 1 and the lson bit is cleared to 0 in lpwrcr, and the pss bit in tcsr (wdt1) is set to 1, a transition is made directly to high-speed or medium-speed mode. fort details of direct transition, see section 4.10, direct transition. (2) clearing with the res pin see (2) clearing with the res pin in section 4.6.2, clearing standby mode. section 4 power-down state rev.3.00 jan. 10, 2007 page 88 of 1038 rej09b0328-0300 4.10 direct transition 4.10.1 overview of direct transition there are three operating modes in which th e cpu executes programs: high-speed mode, medium-speed mode, and subactive mode. a transition between high-speed mode and subactive mode without halting the program* is called a direct transition. a di rect transition can be carried out by setting the dton bit in lpwrcr to 1 and executing a sleep instruction. after the transition, direct transition interrupt exception handling is started. (1) direct transition from high-speed mode to subactive mode if a sleep instruction is executed in high-s peed mode while the ssb y bit in sbycr, the lson bit and dton bit in lpwrcr, and the tma3 bit in tma (timer a) are all set to 1, a transition is made to subactive mode. (2) direct transition from subactive mode to high-speed mode /medium-speed mode if a sleep instruction is executed in subactiv e mode while the ssby b it in sbycr is set to 1, the lson bit is cleared to 0 and the dton bit is set to 1 in lpwrcr, and the tma3 bit in tma (timer a) is set to 1, after the elapse of the time set in bits sts2 to sts0 in sbycr, a transition is made to directly to high-speed mode. note: * at the time of transition from subactive mode to high- or medium-speed mode, an oscillation stabilization wait time is generated. section 5 exception handling rev.3.00 jan. 10, 2007 page 89 of 1038 rej09b0328-0300 section 5 exception handling 5.1 overview 5.1.1 exception handling types and priority as table 5.1 indicates, exception handling may be caused by a reset, trap instruction, or interrupt. exception handling is prioritized as shown in table 5.1. if two or more exceptions occur simultaneously, they are accepted and processed in or der of priority. trap instruction exceptions are accepted at all times in th e program execution state. exception handling sources, the stack structure, and the operation of the cpu vary depending on the interrupt control mode set by the intm0 and intm1 bits in syscr. table 5.1 exception types and priority priority exception type start of exception handling reset starts immediately after a low-to-high transition at the res pin, or when the watchdog timer overflows trace * 1 starts when execution of the current instruction or exception handling ends, if the trace (t) bit is set to 1 interrupt starts when execution of the current instruction or exception handling ends, if an interrupt request has been issued * 2 direct transition started by a direct transition resulting from execution of a sleep instruction high low trap instruction (trapa) * 3 started by execution of a trap instruction (trapa) notes: 1. traces are enabled only in interrupt control modes 2 and 3. (they cannot be used in this lsi.) trace exception handling is not executed after execution of an rte instruction. 2. interrupt detection is not performed on completion of andc, orc, xorc, or ldc instruction execution, or on completion of reset exception handling. 3. trap instruction exception handling requests are accepted at all times in the program execution state. section 5 exception handling rev.3.00 jan. 10, 2007 page 90 of 1038 rej09b0328-0300 5.1.2 exception handling operation exceptions originate from various sources. trap instructions and interrupts are handled as follows: [1] the program counter (pc) and condition-code register (ccr) are pushed onto the stack. [2] the interrupt mask bits are upd ated. the t bit is cleared to 0. [3] a vector address corresponding to the exception source is generated, and program execution starts from that address. for a reset exception, steps [2] and [3] above are carried out. 5.1.3 exception sources and vector table the exception sources are classified as shown in figure 5.1. different vector addresses are assigned to different exception sources. table 5.2 lists the exception sources and their vector addresses. exception sources ? reset ? interrupts ? trap instruction ? trace (cannot be used in this lsi) ? direct transition external interrupts nmi, irq5 to irq0 internal interrupts interrupt sources in on-chip supporting modules ? ? figure 5.1 exception sources section 5 exception handling rev.3.00 jan. 10, 2007 page 91 of 1038 rej09b0328-0300 table 5.2 exception vector table exception source vector number vector address * 1 reset 0 h'0000 to h'0003 1 h'0004 to h'0007 2 h'0008 to h'000b 3 h'000c to h'000f 4 h'0010 to h'0013 reserved for system use 5 h'0014 to h'0017 direct transition 6 h'0018 to h001b external interrupt nmi 7 h'001c to h'001f 8 h'0020 to h'0023 9 h'0024 to h'0027 10 h'0028 to h'002b trap instruction (4 sources) 11 h'002c to h'002f 12 h'0030 to h'0033 13 h'0034 to h'0037 14 h'0038 to h'003b reserved for system use 15 h'003c to h'003f #0 16 h'0040 to h'0043 #1 17 h'0044 to h'0047 address trap #2 18 h'0048 to h'004b internal interrupt (ic) 19 h'004c to h'004f internal interrupt (hsw1) 20 h'0050 to h'0053 irq0 21 h'0054 to h'0057 irq1 22 h'0058 to h'005b irq2 23 h'005c to h'005f irq3 24 h'0060 to h'0063 irq4 25 h'0064 to h'0067 external interrupt irq5 26 h'0068 to h'006b reserved 27 ? 33 h'006c to h'006f ? h'0084 to h'0087 internal interrupt * 2 30 ? 67 h'0088 to h'008b ? h'010c to h'010f notes: 1. lower 16 bits of the address. 2. for details on internal interrupt vectors, see section 6.3.3, interrupt exception vector table. section 5 exception handling rev.3.00 jan. 10, 2007 page 92 of 1038 rej09b0328-0300 5.2 reset 5.2.1 overview a reset has the highest exception priority. when the res pin goes low, all processing halts and the mcu enters the reset state. a reset initializes the internal state of the cpu and the registers of on-chip supporting modules. immediately after a reset, interrupt control mode 0 is set. reset exception handling begins when the res pin changes from low to high. the mcus can also be reset by overflow of th e watchdog timer. for details, see section 18, watchdog timer (wdt). 5.2.2 reset sequence the mcu enters the re set state when the res pin goes low. to ensure that the chip is reset, hold the res pin low during the oscillation stabilizing time of the clock oscillator when powering on. to reset the chip during operation, hold the res pin low for at least 20 states. for pin states in a reset, see appendix d.1, pin circuit diagrams. when the res pin goes high after being held low for the necessary time, the chip starts reset exception handling as follows: [1] the internal state of the cpu and the registers of the on-chip supporting modules are initialized, and the i bit is set to 1 in ccr. [2] the reset exception vector ad dress is read and transferred to the pc, and program execution starts from the address indicated by the pc. figures 5.2 shows examples of the reset sequence. section 5 exception handling rev.3.00 jan. 10, 2007 page 93 of 1038 rej09b0328-0300 res internal address bus internal read signal internal write signal internal data bus vector fetch (1) (2) (3) (4) : reset exception vector address ((1) = h'0000 or h'000000) : start address (contents of reset exception vector address) : start address ((3) = (2)) : first program instruction (1) (3) high level internal processing fetch of first program instruction (2) (4) figure 5.2 reset sequence (mode 1) 5.2.3 interrupts after reset if an interrupt is accepted after a reset but before the stack pointer (sp) is initialized, the pc and ccr will not be saved correctly, leading to a program crash. to prevent this, all interrupt requests, including nmi, are disabled immedi ately after a reset. since the first instruction of a program is always executed immediately after the reset state ends, make sure that this instruction initializes the stack pointer (example: mov.l #xx:32, sp). section 5 exception handling rev.3.00 jan. 10, 2007 page 94 of 1038 rej09b0328-0300 5.3 interrupts interrupt exception handling can be requested by seven external sources (nmi and irq5 to irq0) and internal sources in the on-chip supporting modules. figure 5.3 shows the interrupt sources and the number of interrupts of each type. the on-chip supporting modules that can request interrupts include the watchdog timer (wdt), prescaler unit (psu), timers a, b, j, l, r a nd x1 (tmr), serial communication interface (sci), a/d converter (adc), i 2 c bus interface (iic), servo circuits, s ynchronized detection, address trap, etc. each interrupt source has a separate vector address. nmi is the highest-priority interrupt. interrupts are controlled by the interrupt controller. the interrupt controller has two interrupt control modes and can assign interrupts other than nmi to either three priority/mask levels to enable multiplexed interrupt control. for details on interrupts, see section 6, interrupt controller. wdt * (1) psu (1) tmr (15) sci (6) adc (1) iic (1) servo circuits (9) synchronized detection (1) address trap (3) interrupts internal interrupts external interrupts notes: numbers in parentheses are the numbers of interrupt sources. when the watchdog timer is used as an interval timer, it generates an interrupt request at each counter overflow. * nmi (1) irq5 to irq0 (6) figure 5.3 interrupt sou rces and number of interrupts section 5 exception handling rev.3.00 jan. 10, 2007 page 95 of 1038 rej09b0328-0300 5.4 trap instruction trap instruction exception handling starts when a trapa instruction is executed. trap instruction exception handling can be executed at a ll times in the program execution state. the trapa instruction fetches a start address from a vector table entry corresponding to a vector number from 0 to 3, as specified in the instruction code. table 5.3 shows the status of ccr and exr after execution of trap instruction exception handling. table 5.3 status of ccr and exr after trap instruction exception handling ccr exr * interrupt control mode i ui i2 to i0 t 0 1 ? ? ? 1 1 1 ? ? legend: 1: set to 1 0: cleared to 0 ? : retains value prior to execution. * : does not affect operation in this lsi. section 5 exception handling rev.3.00 jan. 10, 2007 page 96 of 1038 rej09b0328-0300 5.5 stack status after exception handling figure 5.4 shows the stack after completion of trap instruction exception handling and interrupt exception handling. ccr ccr * pc (16 bits) sp note: * ignored on return. interrupt control modes 0 and 1 figure 5.4 (1) stack status after exception handling (normal mode) * note: * normal mode is not available for this lsi. ccr pc (24 bits) sp interrupt control modes 0 and 1 figure 5.4 (2) stack status after exception handling (advanced mode) section 5 exception handling rev.3.00 jan. 10, 2007 page 97 of 1038 rej09b0328-0300 5.6 notes on use of the stack when accessing word data or longword data, this ch ip assumes that the lowest address bit is 0. the stack should always be accessed by word transfer instruction or longword transfer instruction, and the value of the stack pointer (sp: er7) should always be kept even. use the following instructions to save registers: push.w rn (or mov.w rn, @-sp) push.l ern (or mov.l ern, @-sp) use the following instructions to restore registers: pop.wrn (or mov.w @sp+, rn) pop.lern (or mov.l @sp+, ern) setting sp to an odd value may lead to a malfunction. figure 5.5 shows an example of what happens when the sp value is odd. sp legend: : condition-code register : program counter : general register r1l : stack pointer h'fffefa h'fffefb h'fffefc h'fffefd h'fffeff r1l pc sp ccr pc sp ccr pc r1l sp note: this diagram illustrates an example in which the interrupt control mode is 0, is advanced mode. trapa instruction executed mov.b r1l, @-er7 sp set to h'fffeff data saved above sp contents of ccr lost figure 5.5 operation when sp value is odd section 5 exception handling rev.3.00 jan. 10, 2007 page 98 of 1038 rej09b0328-0300 section 6 interrupt controller rev.3.00 jan. 10, 2007 page 99 of 1038 rej09b0328-0300 section 6 interrupt controller 6.1 overview 6.1.1 features this lsi controls interrupts by means of an interrupt controller. the interrupt controller has the following features: ? two interrupt control modes ? either of two interrupt control modes can be set by means of the intm1 and intm0 bits in the system control register (syscr). ? priorities settable with icr ? an interrupt control register (icr) is provided for setting interrupt priorities. three priority levels can be set for each module for all interrupts except nmi. ? independent vector addresses ? all interrupt sources are assigned independent vector addresses, making it unnecessary for the source to be identified in the interrupt handling routine. ? seven external interrupt pins ? nmi is the highest-priority interrupt, and is accepted at all times. falling edge, rising edge, or both edge detection can be selected for the nmi interrupt. ? falling edge, rising edge, or both edge detection can be selected for interrupt irq0. ? falling edge or rising edge can be individually selected for interrupts irq5 to irq1. section 6 interrupt controller rev.3.00 jan. 10, 2007 page 100 of 1038 rej09b0328-0300 6.1.2 block diagram a block diagram of the interrupt controller is shown in figure 6.1. nm input irq input internal interrupt requests legend: iegr ienr irqr icr syscr : irq edge select register : irq enable register : irq status register : interrupt control register : system control register nmi input unit interrupt request vector number i, ui irq input unit irqr iegr ienr icr cpu interrupt controller syscr intm1, intm0 nmieg1, nmieg0 ccr priority determina- tion figure 6.1 block diagram of interrupt controller section 6 interrupt controller rev.3.00 jan. 10, 2007 page 101 of 1038 rej09b0328-0300 6.1.3 pin configuration table 6.1 summarizes the pins of the interrupt controller. table 6.1 interrupt controller pins name symbol i/o function nonmaskable interrupt nmi input nonmaskable external interrupt; rising, falling, or both edges can be selected external interrupt request irq0 input maskable external interrupts; rising, falling, or both edges can be selected external interrupt requests 1 to 5 irq1 to irq5 input maskable external interrupts: rising, or falling edges can be selected 6.1.4 register configuration table 6.2 summarizes the registers of the interrupt controller. table 6.2 interrupt controller registers name abbreviation r/w initial value address * 1 system control register syscr r/w h'00 h'ffe8 irq edge select register iegr r/w h'00 h'fff0 irq enable register ienr r/w h'00 h'fff1 irq status register irqr r/ (w) * 2 h'00 h'fff2 interrupt control register a icra r/w h'00 h'fff3 interrupt control register b icrb r/w h'00 h'fff4 interrupt control register c icrc r/w h'00 h'fff5 interrupt control register d icrd r/w h'00 h'fff6 port mode register 1 pmr1 r/w h'00 h'ffce notes: 1. lower 16 bits of the address. 2. only 0 can be written, for flag clearing. section 6 interrupt controller rev.3.00 jan. 10, 2007 page 102 of 1038 rej09b0328-0300 6.2 register descriptions 6.2.1 system control register (syscr) 0 0 1 0 r/w 2 0 r/w 3 0 r 4 0 r/w 5 0 r/w 0 7 nmieg0 nmieg1 xrst intm0 intm1 0 6 ?? ?? ? ? bit : initial value : r/w : syscr is an 8-bit readable regist er that selects the interrupt cont rol mode and the detected edge for nmi . only bits 5, 4, 2 and 1 are described here; for de tails on the other bits, see section 3.2.2, system control register (syscr). syscr is initialized to h'00 by a reset. bits 5 and 4?interrupt control mode (intm1, intm0): these bits select one of two interrupt control modes for the interrupt controller. the intm1 bit must not be set to 1. bit 5 bit 4 intm1 intm0 interrupt control mode description 0 0 interrupts are controlled by i bit (initial value) 0 1 1 interrupts are controlled by i and ui bits and icr 1 0 ? cannot be used in this lsi 1 ? cannot be used in this lsi bits 2 and 1? nmi pin detected edge select (nmieg1, nmieg0): selects the detected edge for the nmi pin. bit 2 bit 1 nimieg1 nimieg0 description 0 interrupt request generated at falling edge of nmi pin (initial value) 0 1 interrupt request generated at rising edge of nmi pin 1 * interrupt request generated at both falling and rising edges of nmi pin legend: * don't care section 6 interrupt controller rev.3.00 jan. 10, 2007 page 103 of 1038 rej09b0328-0300 6.2.2 interrupt control registers a to d (icra to icrd) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 0 7 icr4 icr3 icr2 icr1 icr0 0 r/w icr7 r/w r/w r/w icr6 icr5 6 bit : initial value : r/w : the icr registers are four 8-bit readable/writable registers that set the interrupt control level for interrupts other than nmi. the correspondence between icr settings and in terrupt sources is shown in table 6.3. the icr registers are initialized to h'00 by a reset. bits 7 to 0?interrupt control level (icr7 to icr0): sets the control level for the corresponding interrupt source. bit n icrn description 0 corresponding interrupt source is control level 0 (non-priority) (initial value) 1 corresponding interrupt source is control level 1 (priority) note: n = 7 to 0 table 6.3 correspondence between in terrupt sources and icr settings icra7 icra6 icra5 icra4 icra3 icra2 icra1 cira0 icra reserved input capture hsw1 irq0 irq1 irq2 irq3 irq4 irq5 reserved icrb7 icrb6 icrb5 icrb4 icrb3 icrb2 icrb1 icrb0 icrb reserved reserved servo (drum, capstan latch) timer a timer b time r j timer r timer l icrc7 icrc6 icrc5 icrc4 icrc3 icrc2 icrc1 icrc0 icrc timer x1 synchro- nized detection watchdog timer servo iic sci1 (uart) sci2 (with 32-bit buffer) a/d icrd icrd7 icrd6 icrd5 icrd4 icrd3 icrd2 icrd1 icrd0 hsw2 reserved reserved reserved reserved reserved reserved reserved section 6 interrupt controller rev.3.00 jan. 10, 2007 page 104 of 1038 rej09b0328-0300 6.2.3 irq enable register (ienr) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 0 0 7 r/w r/w r/w irq5e irq4e irq3e irq2e irq1e irq0e 0 6 ?? ?? bit : initial value : r/w : ienr is an 8-bit readable/writable register that controls enabling and disabling of interrupt requests irq5 to irq0. ienr is initialized to h'00 by a reset. bits 7 and 6?reserved: do not write 1 to them. bits 5 to 0?irq5 to irq0 enable (irq5e to irq0e): these bits select whether irq5 to irq0 are enabled or disabled. bit n irqne description 0 irqn interrupt disabled (initial value) 1 irqn interrupt enabled note: n = 5 to 0 6.2.4 irq edge select registers (iegr) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 0 0 7 ? ? r/w r/w r/w irq4eg r/w irq5eg irq3eg irq2eg irq1eg irq0eg1 irq0eg0 0 6 bit : initial value : r/w : iegr is an 8-bit readable/writable register that selects detected edge of the input at pins irq5 to irq0 . iegr register is initialized to h'00 by a reset. bit 7?reserved: do not write 1 to it. section 6 interrupt controller rev.3.00 jan. 10, 2007 page 105 of 1038 rej09b0328-0300 bits 6 to 2? irq5 to irq1 pins detected edge select (irq5eg to irq1eg): these bits select detected edge for interrupts irq5 to irq1. bits 6 to 2 irqneg description 0 interrupt request generated at falling edge of irqn pin input (initial value) 1 interrupt request generated at rising edge of irqn pin input note: n = 5 to 1 bits 1 and 0? irq0 pin detected edge select (irq0eg1, irq0eg0): these bits select detected edge for interrupt irq0 . bit 1 bit 0 irq0eg1 irq0eg0 description 0 0 interrupt request generated at falling edge of irq0 pin input (initial value) 0 1 interrupt request generated at rising edge of irq0 pin input 1 * interrupt request generated at both falling and rising edges of irq0 pin input legend: * don't care 6.2.5 irq status register (irqr) 0 0 1 0 r/(w) * 2 0 r/(w) * 3 0 4 0 r/(w) * 5 0 0 7 r/(w) * r/(w) * r/(w) * irq5f irq4f irq3f irq2f irq1f irq0f 0 6 ?? ?? note: * only 0 can be written, to clear the flag. bit : initial value : r/w : irqr is an 8-bit readable/writable re gister that indicat es the status of irq5 to irq0 interrupt requests. irqr is initialized to h'00 by a reset. bits 7 and 6?reserved: do not write 1 to them. section 6 interrupt controller rev.3.00 jan. 10, 2007 page 106 of 1038 rej09b0328-0300 bits 5 to 0? irq5 to irq0 flags: these bits indicate the status of irq5 to irq0 interrupt requests. bit n irqnf description 0 [clearing condition] (initial value) cleared by reading irqnf set to 1, then writing 0 in irqnf when irqn interrupt exception handling is executed 1 [setting conditions] (1) when a falling edge occurs in irqn input while falling edge detection is set (irqneg = 0) (2) when a rising edge occurs in irqn input while rising edge detection is set (irqneg = 0) (3) when a falling or rising edge occurs in irq0 input while both-edge detection is set (irq0eg1 = 1) note: n = 5 to 0 6.2.6 port mode register (pmr1) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 0 7 0 r/w pmr17 pmr16 pmr15 pmr14 pmr13 pmr12 pmr11 pmr10 r/w r/w r/w 6 bit : initial value : r/w : port mode register 1 (pmr1) controls pin function switching-over of port 1. switching is specified for each bit. pmr1 is an 8-bit readable/writable register and is initialized to h'00 by a reset. only bits 5 to 0 are explained here. for details, see section 11, i/o port. bits 5 to 0?p15/ irq5 to p10/ irq0 pin switching (pmr15 to pmr10): these bits are for setting the p1n/ irqn pin as the input/output pin for p1n or as the irqn pin for external interrupt request input. bit n pmr1n description 0 p1n/ irqn pin functions as the p1n input/output pin (initial value) 1 p1n/ irqn pin functions as the irqn input pin note: n = 5 to 0 section 6 interrupt controller rev.3.00 jan. 10, 2007 page 107 of 1038 rej09b0328-0300 the following is the notes on switching the pin function by pmr1. (1) when the port is set as the ic input pin or irq5 to irq0 input pin, the pin level must be high or low regardless of active mode or power-down mode. do not set the pin level at medium. (2) switching the pin function of p16/ ic or p15/ irq5 to p10/ irq0 may be mistakenly identified as edge detection and detection signal may be generated. to prevent this, operate as follows: (a) set the interrupt enable/disable flag to disable before switching the pin function. (b) clear the applicable interrupt request flag to 0 after switching the pin function and executing another instruction. (program example) : mov.b r0l,@ienr ?????? interrupt disabled mov.b r1l,@pmr1 ?????? pin function change nop ?????? optional instruction bclr m @irqr ?????? applicable interrupt clear mov.b r1l,@ienr ?????? interrupt enabled : section 6 interrupt controller rev.3.00 jan. 10, 2007 page 108 of 1038 rej09b0328-0300 6.3 interrupt sources interrupt sources comprise external interrupts (nmi and irq5 to irq0) and internal interrupts. 6.3.1 external interrupts there are seven external interrupt sources; nmi an d irq5 to irq0. of these, nmi, and irq1 to irq0 can be used to restore this chip from standby mode. (1) nmi interrupt nmi is the highest-priority interrupt, and is always accepted by the cpu regardless of the interrupt control mode and the status of the cpu interrupt mask bits. the nmieg1 and nmieg0 bits in syscr can be used to select whether an interrupt is requested at a rising, falling edge or both edges on the nmi pin. the vector number for nmi interrupt exception handling is 7. (2) irq5 to irq0 interrupts interrupts irq5 to irq0 are requested by an input signal at pins irq5 to irq0 . interrupts irq5 to irq0 have the following features: (a) using iegr, it is possible to select whether an interrupt is generated by a low level, falling edge, rising edge, or both edges, at pin irq0 . (b) using iegr, it is possible to select whether an interrupt is generated by a low level, falling edge, rising edge, or both edges, at pins irq5 to irq0 . (c) enabling or disabling of interrupt requests irq5 to irq0 can be selected with ienr. (d) the interrupt control level can be set with icr. (e) the status of interrupt requests irq5 to irq0 is indicated in irqr. irqr flags can be cleared to 0 by software. a block diagram of interrupts irq5 to irq0 is shown in figure 6.2. section 6 interrupt controller rev.3.00 jan. 10, 2007 page 109 of 1038 rej09b0328-0300 clear signal r s q edge detection circuit irqneg irqnf irqne note: n = 5 to 0 irqn interrupt request irqn input figure 6.2 block diagram of interrupts irq5 to irq0 figure 6.3 shows the timing of irqnf setting. internal irqnf irqn input pin figure 6.3 timing of irqnf setting the vector numbers for irq5 to irq0 interrupt exception handling are 21 to 26. upon detection of irq5 to irq0 interrupts, the applicable pin is set in the port mode register 1 (pmr1) as irqn pin. section 6 interrupt controller rev.3.00 jan. 10, 2007 page 110 of 1038 rej09b0328-0300 6.3.2 internal interrupts there are 38 sources for internal interrupts from on-chip supporting modules. (1) for each on-chip supporting module there are fl ags that indicate the interrupt request status, and enable bits that select enabling or disabling of these interrupts. if any one of these is set to 1, an interrupt request is issued to the interrupt controller. (2) the interrupt control level can be set by means of icr. 6.3.3 interrupt exception vector table table 6.4 shows interrupt exception handling sources , vector addresses, and interrupt priorities. for default priorities, the lower the vector number, the higher the priority. priorities among modules can be set by means of ic r. the situation when two or more modules are set to the same priority, an d priorities within a module, are fixed as shown in table 6.4. table 6.4 interrupt sources, vector addresses, and interrupt priorities priority interrupt source origin of interrupt source vector no. vector address icr remarks reset external pin 0 h'0000 to h'0003 ? ? 1 h'0004 to h'0007 ? ? 2 h'0008 to h'000b ? ? 3 h'000c to h'000f ? ? 4 h'0010 to h'0013 ? reserved ? 5 h'0014 to h'0017 ? direct transition instruction 6 h'0018 to h'001b ? nmi external pin 7 h'001c to h'001f ? trapa#0 8 h'0020 to h'0023 ? trapa#1 9 h'0024 to h'0027 ? trapa#2 10 h'0028 to h'002b ? trap instruction trapa#3 instruction 11 h'002c to h'002f ? 12 h'0030 to h'0033 13 h'0034 to h'0037 14 h'0038 to h'003b high low reserved ? 15 h'003c to h'003f ? section 6 interrupt controller rev.3.00 jan. 10, 2007 page 111 of 1038 rej09b0328-0300 priority interrupt source origin of interrupt source vector no. vector address icr remarks #0 16 h'0040 to h'0043 #1 17 h'0044 to h'0047 address trap #2 atc 18 h'0048 to h'004b ? ic psu 19 h'004c to h'004f icra6 hsw1 servo circuit 20 h'0050 to h'0053 icra5 irq0 21 h'0054 to h'0057 icra4 irq1 22 h'0058 to h'005b icra3 irq2 23 h'005c to h'005f irq3 24 h'0060 to h'0063 icra2 irq4 25 h'0064 to h'0067 irq5 external pin 26 h'0068 to h'006b icra1 27 h'006c to h'006f 28 h'0070 to h'0073 29 h'0074 to h'0077 30 h'0078 to h'007b 31 h'007c to h'007f 32 h'0080 to h'0083 reserved ? 33 h'0084 to h'0087 ? drum latch 1 (speed) 34 h'0088 to h'008b capstan latch 1 (speed) servo circuit 35 h'008c to h'008f icrb5 tmai timer a 36 h'0090 to h'0093 icrb4 tmbi timer b 37 h'0094 to h'0097 icrb3 tmj1i 38 h'0098 to h'009b tmj2i timer j 39 h'009c to h'009f icrb2 tmr1i 40 h'00a0 to h'00a3 tmr2i 41 h'00a4 to h'00a7 tmr3i timer r 42 h'00a8 to h'00ab icrb1 high low tmli timer l 43 h'00ac to h'00af icrb0 section 6 interrupt controller rev.3.00 jan. 10, 2007 page 112 of 1038 rej09b0328-0300 priority interrupt source origin of interrupt source vector no. vector address icr remarks icxa timer x1 44 h'00b0 to h'00b3 icxb 45 h'00b4 to h'00b7 icxc 46 h'00b8 to h'00bb icxd 47 h'00bc to h'00bf ocx1 48 h'00c0 to h'00c3 ocx2 49 h'00c4 to h'00c7 ovfx 50 h'00c8 to h'00cb icrc7 vd interrupts sync signal detection 51 h'00cc to h'00cf icrc6 reserved ? 52 h'00d0 to h'00d3 8-bit interval timer watchdog timer 53 h'00d4 to h'00d7 icrc5 ctl 54 h'00d8 to h'00db drum latch 2 (speed) 55 h'00dc to h'00df capstan latch 2 (speed) 56 h'00e0 to h'00e3 drum latch 3 (phase) 57 h'00e4 to h'00d7 capstan latch 3 (phase) servo circuit 58 h'00e8 to h'00eb icrc4 iic iic 59 h'00ec to h'00ef icrc3 eri 60 h'00f0 to h'00f3 rxi 61 h'00f4 to h'00f7 txi 62 h'00f8 to h'00fb sci1 tei sci1 (uart) 63 h'00fc to h'00ff icrc2 tei 64 h'0100 to h'0103 sci2 abti sci2 65 h'0104 to h'0107 icrc1 a/d conversion end a/d 66 h'0108 to h'010b icrc0 high low hsw2 servo circuit 67 h'010c to h'010f icrd7 section 6 interrupt controller rev.3.00 jan. 10, 2007 page 113 of 1038 rej09b0328-0300 6.4 interrupt operation 6.4.1 interrupt control modes and interrupt operation interrupt operations in this lsi differ depending on the interrupt control mode. nmi interrupts and address trap inte rrupts are accepted at all times ex cept in the reset state. in the case of irq interrupts and on-chip supporting module interrupts, an enable b it is provided for each interrupt. clearing an enable bit to 0 disables the corresponding interrupt request. interrupt sources for which the enable bits are set to 1 are controlled by the interrupt controller. table 6.5 shows the interrupt control modes. the interrupt controller performs interrupt control according to th e interrupt control mode set by the intm1 and intm0 bits in syscr, the priorities set in icr, and the masking state indicated by the i and ui bits in the cpu's ccr. table 6.5 interrupt control modes syscr interrupt control mode intm1 intm0 priority setting register interrupt mask bits description 0 0 0 icr i interrupt mask control is performed by the i bit priority can be set with icr 1 1 icr i, ui 3-level interrupt mask control is performed by the i and ui bits priority can be set with icr figure 6.4 shows a block diagram of the priority decision circuit. section 6 interrupt controller rev.3.00 jan. 10, 2007 page 114 of 1038 rej09b0328-0300 interrupt control modes 0 and 1 i interrupt source ui vector number interrupt acceptance control and 3-level mask control default priority determination i c r figure 6.4 block diagram of interrupt priority determination operation (1) interrupt acceptance control and 3-level control in interrupt control modes 0 and 1, interrupt acceptance control and 3-level mask control is performed by means of the i and ui bits in ccr, and icr (control level). table 6.6 shows the interrupts select ed in each interrupt control mode. table 6.6 interrupts selected in each interrupt control mode interrupt mask bit interrupt control mode i ui selected interrupts 0 * all interrupts (control level 1 has priority) 0 1 * nmi and address trap interrupts 0 * all interrupts (control level 1 has priority) 0 nmi, address trap and control level 1 interrupts 1 1 1 nmi and address trap interrupts legend: * don't care (2) default priority determination the priority is determined for the selected interrupt, and a vector number is generated. if the same value is set for icr, acceptance of multiple interrupts is enabled, and so only the interrupt source with the highest priority according to the preset default priorities is selected and has a vector number generated. interrupt sources with a lower priority than the accep ted interrupt source are held pending. table 6.7 shows operations and control signal functions in each interrupt control mode. section 6 interrupt controller rev.3.00 jan. 10, 2007 page 115 of 1038 rej09b0328-0300 table 6.7 operations and control signal functions in each interrupt control mode setting interrupt acceptance control, 3-level control interrupt control mode intm1 intm0 i ui icr default priority determination 0 0 0 { im ? pr { 1 1 { im im pr { legend: { : interrupt operation control performed im: used as interrupt mask bit pr: sets priority ? : not used 6.4.2 interrupt control mode 0 enabling and disabling of irq interrupts and on-chip supporting module interrupts can be set by means of the i bit in the cpu's ccr, and icr. interr upts are enabled when the i bit is cleared to 0, and disabled when set to 1. control level 1 interrupt sources have higher priority. figure 6.5 shows a flowchart of the inte rrupt acceptance operation in this case. (1) if an interrupt source occurs when the corresponding interrupt enable bit is set to 1, an interrupt request is sent to the interrupt controller. (2) when interrupt requests are sent to the interrupt controller, a control level 1 interrupt, according to the contro l level set in icr, has priority for se lection, and other interrupt requests are held pending. if a number of interrupt requests with the same control level setting are generated at the same time, the interrupt request with the highest priority according to the priority system shown in table 6.4 is selected. (3) the i bit is then referenced. if the i bit is cleared to 0, the interrupt request is accepted. if the i bit is set to 1, only an nmi or an address trap interrupt is accepted, and other interrupt requests are held pending. (4) when an interrupt request is accepted, interrupt exception handling starts after execution of the current instruction has been completed. (5) the pc and ccr are saved to the stack area by interrupt exception handling. the pc saved on the stack shows the address of the first instruc tion to be executed after returning from the interrupt handling routine. (6) next, the i bit in ccr is set to 1. this disables all interrupts except nmi and address trap. (7) a vector address is generated for the acce pted interrupt, and execution of the interrupt handling routine starts at the address indicated by the contents of that vector address. section 6 interrupt controller rev.3.00 jan. 10, 2007 page 116 of 1038 rej09b0328-0300 program execution state interrupt generated? nmi address trap interrupt? control level 1 interrupt? i c i = 0 yes yes yes yes yes yes yes no yes yes yes yes no no no no no no save pc and ccr i 1 read vector address branch to interrupt handling routine i c no no h s w 1 h s w 1 h s w 2 h s w 2 hold pending figure 6.5 flowchart of procedu re up to interrupt acceptance in interrupt control mode 0 section 6 interrupt controller rev.3.00 jan. 10, 2007 page 117 of 1038 rej09b0328-0300 6.4.3 interrupt control mode 1 three-level masking is implemented for irq interrupts and on-chip supporting module interrupts by means of the i and ui bits in the cpu's ccr, and icr. (1) control level 0 interrupt requests are enabled when the i bit is cleared to 0, and disabled when set to 1. (2) control level 1 interrupt requests are enabled when the i bit or ui bit is cleared to 0, and disabled when both the i bit and the ui bit are set to 1. for example, if the interrupt enable bit for an interrupt request is set to 1, and h'04, h'00, h'00 and h'00 are set in icra, icrb, icrc, and icrd respectively, (i.e. irq2 interrupt is set to control level 1 and other interrupts to control level 0), the situation is as follows: (1) when i = 0, all interrupts are enabled (priority order: nmi > irq2 > ic > hsw1 > ...) (2) when i = 1 and ui = 0, only nmi, address trap and irq2 interrupts are enabled (3) when i = 1 and ui = 1, only nmi a nd address trap interrupts are enabled figure 6.6 shows the state transitions in these cases. only nmi, address trap and irq2 interrupts enabled all interrupts enabled exception handling execution or ui 1 exception handling execution or i 1, ui 1 i 0 i 1, ui 0 ui 0 i 0 only nmi and address trap interrupts enabled figure 6.6 example of state transitions in interrupt control mode 1 figure 6.7 shows an operation fl owchart of interrupt reception. section 6 interrupt controller rev.3.00 jan. 10, 2007 page 118 of 1038 rej09b0328-0300 (1) if an interrupt source occurs when the corresponding interrupt enable bit is set to 1, an interrupt request is sent to the interrupt controller. (2) when interrupt requests are sent to the interrupt controller, a control level 1 interrupt, according to the contro l level set in icr, has priority for se lection, and other interrupt requests are held pending. if a number of interrupt requests with the same control level setting are generated at the same time, the interrupt request with the highest priority according to the priority system shown in table 6.4 is selected. (3) the i bit is then referenced. if the i bit is cleared to 0, the ui bit has no effect. an interrupt request set to interrupt control leve l 0 is accepted when the i bit is cleared to 0. if the i bit is set to 1, only nmi and address tr ap interrupts are accepted, and other interrupt requests are held pending. an interrupt request set to interrupt control level 1 has priority over an interrupt request set to interrupt control level 0, and is accep ted if the i bit is cleared to 0, or if the i bit is set to 1 and the ui bit is cleared to 0. when both the i bit and the ui bit are set to 1, only nmi and address trap interrupts are accepted, and other interrupt requests are held pending. (4) when an interrupt request is accepted, interrupt exception handling starts after execution of the current instruction has been completed. (5) the pc and ccr are saved to the stack area by interrupt exception handling. the pc saved on the stack shows the address of the first instruc tion to be executed after returning from the interrupt handling routine. (6) next, the i and ui bits in ccr are set to 1. this masks all interrupts except nmi and address trap. (7) a vector address is generated for the acce pted interrupt, and execution of the interrupt handling routine starts at the address indicated by the contents of that vector address. section 6 interrupt controller rev.3.00 jan. 10, 2007 page 119 of 1038 rej09b0328-0300 program execution state nmi i c yes yes yes yes yes yes yes no yes yes yes yes no no no no no no i c no no h s w 1 h s w 1 h s w 2 h s w 2 yes no yes no interrupt generated? address trap interrupt? control level 1 interrupt? i = 0 i = 0 ui = 0 save pc and ccr i 1, ui 1 read vector address branch to interrupt handling routine hold pending figure 6.7 flowchart of procedu re up to interrupt acceptance in interrupt control mode 1 section 6 interrupt controller rev.3.00 jan. 10, 2007 page 120 of 1038 rej09b0328-0300 6.4.4 interrupt exception handling sequence figure 6.8 shows the interrupt exception handling sequence. the example shown is for the case where interrupt control 0 is set in advanced mo de, and the program area and stack area are in on- chip memory. (1) (1) instruction prefetch address (not executed. this is the contents of the saved pc, the return address.) saved pc and saved ccr vector address interrupt handling routine start address (vector address contents) interrupt handling routine start address ((13) = (10)(12)) first instruction of interrupt handling routine (2)(4) (6)(8) (10)(12) (13) (9)(11) (14) (3) (5) (7) (9) (11) (13) internal address bus interrupt request signal internal read signal internal write signal internal data bus (2) (4) (6) (8) (10) (12) (14) stack vector fetch interrupt level determination wait for end of instruction interrupt acceptance internal operation internal operation instruction prefetch interrupt handling routine instruction prefetch instruction code (not executed.) (3) instruction prefetch address (not executed.) (5) sp-2 (7) sp-4 figure 6.8 interrupt exception handling section 6 interrupt controller rev.3.00 jan. 10, 2007 page 121 of 1038 rej09b0328-0300 6.4.5 interrupt response times table 6.8 shows interrupt response times-the interv al between generation of an interrupt request and execution of the first instruction in the interrupt handling routine. the symbols used in table 6.8 are explained in table 6.9. table 6.8 interrupt response times no. number of states advanced mode 1 interrupt priority determination * 1 3 2 number of wait states until executing instruction ends * 2 1 to 19 + 2 ? s i 3 pc, ccr stack save 2 ? s k 4 vector fetch 2 ? s i 5 instruction fetch * 3 2 ? s i 6 internal processing * 4 2 total (using on-chip memory) 12 to 32 notes: 1. two states in case of internal interrupt. 2. refers to mulxs and divxs instructions. 3. prefetch after interrupt acceptance and interrupt handling routine prefetch. 4. internal processing after interrupt acceptance and internal processing after vector fetch. table 6.9 number of states in in terrupt handling routine execution object of access symbol internal memory instruction fetch si 1 branch address read sj stack manipulation sk section 6 interrupt controller rev.3.00 jan. 10, 2007 page 122 of 1038 rej09b0328-0300 6.5 usage notes 6.5.1 contention between interru pt generation and disabling when an interrupt enable bit is cleared to 0 to disable interrupts, the disabling becomes effective after execution of the instruction. in other words, when an interrupt enable bit is cleared to 0 by an inst ruction such as bclr or mov, if an interrupt is generated during execution of the instruction, the interrupt concerned will still be enabled on completion of the instruction, and so interrupt exception handling for that interrupt will be executed on completion of the instruction. however, if there is an interrupt request of higher priority than that interrupt, interrupt exception handling will be executed for the higher-priority interrupt, and the lower-priority interrupt will be ignored. the same also applies when an inte rrupt source flag is cleared to 0. figure 6.9 shows an example in which the ocia e bit in timer x1 tier is cleared to 0. tier address internal address bus internal write signal ociae ocfa ocia interrupt signal tier write cycle by cpu ocia interrupt exception handling figure 6.9 contention between in terrupt generation and disabling section 6 interrupt controller rev.3.00 jan. 10, 2007 page 123 of 1038 rej09b0328-0300 the above contention will not occur if an enable bit or interrupt source flag is cleared to 0 while the interrupt is masked. 6.5.2 instructions that disable interrupts instructions that disable interrupts are ldc, andc, orc, and xorc. after any of these instructions is executed, all interrupts except nmi are disabled and the next instruction is always executed. when the i bit or ui bit is set by one of these instructions, the new value becomes valid two states after execution of the instruction ends. 6.5.3 interrupts during execution of eepmov instruction interrupt operation differs between the eepmov.b instruction and the eepmov.w instruction. with the eepmov.b instruction, an interrupt request (including nmi) issued during the transfer is not accepted until the move is completed. with the eepmov.w instruction, if an interrupt request is issued during the transfer, interrupt exception handling starts at a break in the transfer cycle. the pc value saved on the stack in this case is the address of the next instruction. therefore, if an interrupt is generated during execution of an eepmov.w instruction, the following coding should be used. l1: eepmov.w mov.w r4,r4 bne l1 6.5.4 when nmi is disabled when nmi is disabled, the input level to the nmi pin must be fixed high or low. it is recommended that the nmi interrupt exception hand ling address be set to the nmi vector address (h'00001c to h'00001f) and that the rte instruction also be set to the nmi exception handling address. section 6 interrupt controller rev.3.00 jan. 10, 2007 page 124 of 1038 rej09b0328-0300 section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 125 of 1038 rej09b0328-0300 section 7 rom (h8s/2194 group) 7.1 overview the h8s/2194 has 128 kbytes of on-chip rom (flash memory or mask rom), the h8s/2193 has 112 kbytes, the h8s/2192 has 96 kbytes, and the h8s/2191 has 80 kbytes. the rom is connected to the cpu by a 16-bit data bus. the cpu accesses bot h byte and word data in one state, enabling faster instruction fetches and higher processing speed. the flash memory versions of the h8s/2194 can be erased and programmed on-board as well as with a general-purpose prom programmer. 7.1.1 block diagram figure 7.1 shows a block diagram of the rom. internal data bus (upper 8 bits) internal data bus (lower 8 bits) h'000000 h'000002 h'01fffe h'000001 h'000003 h'01ffff figure 7.1 rom block diagram (h8s/2194) section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 126 of 1038 rej09b0328-0300 7.2 overview of flash memory 7.2.1 features the features of the flash memory are summarized below. ? four flash memory operating modes ? program mode ? erase mode ? program-verify mode ? erase-verify mode ? programming/erase methods the flash memory is programmed 32 bytes at a time. erasing is performed by block erase (in single-block units). when erasing all blocks, the individual blocks must be erased sequentially. block erasing can be performed as required on 1-kbyte, 8-kbyte, 16-kbyte, 28-kbyte, and 32- kbyte blocks. ? programming/erase times the flash memory programming time is 10 ms (typ.) for simultaneous 32-byte programming, equivalent to 300 s (typ.) per byte, and the erase time is 100 ms (typ.) per block. ? reprogramming capability the flash memory can be reprogrammed up to 100 times. ? on-board programming modes there are two modes in which flash memory can be programmed/erased/verified on-board: ? boot mode ? user program mode ? automatic bit rate adjustment if data transfer on boot mode, automatic adjustment is possible at host transfer bit rates and mcu's bit rates. ? protect modes there are three protect modes, hardware, soft ware, and error protect, which allow protected status to be designated for flash memory program/erase/verify operations. ? programmer mode flash memory can be programmed/erased in programmer mode, using a prom programmer, as well as in on-board programming mode. section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 127 of 1038 rej09b0328-0300 7.2.2 block diagram module bus bus interface/controller flash memory (128 kbytes) operat- ing mode flmcr1 * * * * stcr flmcr1 flmcr2 ebr1 ebr2 : serial/timer control register : flash memory control register 1 : flash memory control register 2 : erase block register 1 : erase block register 2 legend: internal address bus internal data bus (16 bits) stcr fwe pin mode pin flmcr2 ebr1 ebr2 note: * these registers are exclusively used for the flash memory. if you try to read these addresses with the mask rom version, values read becomes uncertain. data write is also disabled with the above version. figure 7.2 block diagram of flash memory section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 128 of 1038 rej09b0328-0300 7.2.3 flash memory operating modes (1) mode transitions when each mode pin and the fwe pin are set in th e reset state and a reset-start is executed, the mcu enters one of the operating modes shown in figure 7.3. in user mode, flash memory can be read but not programmed or erased. flash memory can be programmed and erased in boot mode, user program mode, and programmer mode. boot mode on-board program mode user program mode user mode reset state programmer mode fwe = 1, md0 = 0, p12 = p13 = p14 = 1 res = 0 res = 0 fwe = 1 swe = 1 fwe = 0 or swe = 0 res = 0 md0 = 1, fwe = 0 res = 0 only make a transition between user mode and user program mode when the cpu is not accessing the flash memory. * md0 = 0, p12 = p13 = 1, p14 = 0 notes: * figure 7.3 flash memory mode transitions section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 129 of 1038 rej09b0328-0300 (2) on-board programming modes (a) boot mode flash memory ram host programming control program sci application program (old version) new application program new application program flash memory ? this lsi ? ? this lsi ? ? this lsi ? ? this lsi ? ram host sci application program (old version) boot program area programming control program new application program flash memory ram host sci flash memory preprograming erase boot program flash memory program execution state ram host sci new application program boot program programming control program 1. initial state the old program version or data remains written in the flash memory. the user should prepare the programming control program and new application program beforehand in the host. 2. programming control program transfer when boot mode is entered, the boot program in the lsi (originally incorporated in the chip) is started and the programing control program in the host is transferred to ram via sci communication. the boot program required for flash memory erasing is automatically transferred to the ram boot program area. 3. flash memory initialization the erase program in the boot program area (in ram) is executed, and the flash memory is initialized (to h'ff). in boot mode, entire flash memory erasure is performed, without regard to blocks. 4. writing new application program the programming control program transferred from the host to ram is executed, and the new application program in the host is written into the flash memory. boot program boot program boot program area boot program area programming control program figure 7.4 boot mode section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 130 of 1038 rej09b0328-0300 (b) user program mode section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 131 of 1038 rej09b0328-0300 (3) differences between boot mode and user program mode table 7.1 differences between boot mode and user program mode boot mode user program mode entire memory erase yes yes block erase no yes programming control program * program/program-verify erase/erase-verify program/program-verify note: * to be provided by the user, in accordance with the recommended algorithm. (4) block configuration the flash memory is divided into two 32-kbyte blocks, two 8-kbyte blocks, one 16-kbyte block, one 28-kbyte block, and four 1-kbyte blocks. 8 kbytes address h'00000 address h'1ffff 128 kbytes 32 kbytes 128-kbyte version 32 kbytes 28 kbytes 1 kbyte 1 kbyte 1 kbyte 1 kbyte 16 kbytes 8 kbytes figure 7.6 flash memory block configuration section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 132 of 1038 rej09b0328-0300 7.2.4 pin configuration the flash memory is controlled by means of the pins shown in table 7.2. table 7.2 flash memory pins pin name abbreviation i/o function reset res input reset flash write enable fwe input flash program/erase protection by hardware mode 0 md0 input sets this lsi operating mode port 12 p12 input sets this lsi operating mode when md0 = 0 port 13 p13 input sets this lsi operating mode when md0 = 0 port 14 p14 input sets this lsi operating mode when md0 = 0 transmit data so1 output serial transmit data output receive data si1 input serial receive data input 7.2.5 register configuration the registers used to control the on-chip flash memory when enabled are shown in table 7.3. in order to access these registers, the flshe bit in stcr must be set to 1. table 7.3 flash memory registers register name abbreviation r/w initial value address * 5 flash memory control register 1 flmcr1 * 4 r/w * 1 h'00 * 2 h'fff8 flash memory control register 2 flmcr2 * 4 r/w * 1 h'00 * 3 h'fff9 erase block register 1 ebr1 * 4 r/w * 1 h'00 * 3 h'fffa erase block register 2 ebr2 * 4 r/w * 1 h'00 * 3 h'fffb serial/timer control register stcr r/w h'00 h'ffee notes: 1. when the fwe bit in flmcr1 is not set at 1, writes are disabled. 2. when a high level is input to the fwe pin, the initial value is h'80. 3. when a low level is input to the fwe pin, or if a high level is input and the swe bit in flmcr1 is not set, these registers are initialized to h'00. 4. flmcr1, flmcr2, ebr1, and ebr2 are 8-bit registers. only byte accesses are valid for these registers, the access requiring 2 states. 5. lower 16 bits of the address. section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 133 of 1038 rej09b0328-0300 7.3 flash memory register descriptions 7.3.1 flash memory control register 1 (flmcr1) 7 fwe ? * r 6 swe 0 r/w 5 ? 0 ? 4 ? 0 ? 3 ev 0 r/w 0 p 0 r/w 2 pv 0 r/w 1 e 0 r/w bit initial value r/w : : : note: * determined by the state of the fwe pin. flmcr1 is an 8-bit register used for flash memory operating mode control. program-verify mode or erase-verify mode is entered by setting swe to 1 when fwe = 1. program mode is entered by setting swe to 1 when fwe = 1, then setting the psu bit in flmcr2, and finally setting the p bit. erase mode is entered by setting swe to 1 when fwe = 1, then setting the esu bit in flmcr2, and finally setting the e bit. flmcr1 is initialized by a reset, in power-down state (excluding the medium-speed mode, module stop mode, and sleep mode), or when a low level is input to the fwe pin. its initial value is h'80 when a high level is input to the fwe pin, and h'00 when a low level is input. when on-chip flash memory is disabled, a read will return h'00, and writes are invalid. writes to the swe bit in flmcr1 are enabled only when fwe = 1; writes to the ev and pv bits only when few = 1 and swe = 1; writes to the e bit only when fwe = 1, swe = 1, and esu = 1; and writes to the p bit only when fwe = 1, swe = 1, and psu = 1. bit 7 ? flash write enable (fwe): sets hardware protection against flash memory programming/erasing. bit 7 fwe description 0 when a low level is input to the fwe pin (hardware-protected state) 1 when a high level is input to the fwe pin section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 134 of 1038 rej09b0328-0300 bit 6 ? software write enable (swe): enables or disables flash memory programming. swe should be set before setting bits esu, psu, ev, pv, e, p, and eb9 to eb0, and should not be cleared at the same time as these bits. bit 6 swe description 0 writes are disabled (initial value) 1 writes are enabled [setting condition] setting is available when fwe = 1 is selected bits 5 and 4 ? reserved: these bits cannot be modified and are always read as 0. bit 3 ? erase-verify (ev): selects erase-verify mode transition or clearing. do not set the swe, esu, psu, pv, e, or p bit at the same time. bit 3 ev description 0 erase-verify mode cleared (initial value) 1 transition to erase-verify mode [setting condition] setting is available when fwe = 1 and swe = 1 are selected bit 2 ? program-verify (pv): selects program-verify mode transition or clearing. do not set the swe, esu, psu, ev, e, or p bit at the same time. bit 2 pv description 0 program-verify mode cleared (initial value) 1 transition to program-verify mode [setting condition] setting is available when fwe = 1 and swe = 1 are selected section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 135 of 1038 rej09b0328-0300 bit 1 ? erase (e): selects erase mode transition or clearin g. do not set the swe, esu, psu, ev, pv, or p bit at the same time. bit 1 e description 0 erase mode cleared (initial value) 1 transition to erase mode [setting condition] setting is available when fwe = 1, swe = 1, and esu = 1 are selected bit 0 ? program (p): selects program mode transition or clearing. do not set the swe, psu, esu, ev, pv, or e bit at the same time. bit 0 p description 0 program mode cleared (initial value) 1 transition to program mode [setting condition] setting is available when fwe = 1, swe = 1, and psu = 1 are selected section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 136 of 1038 rej09b0328-0300 7.3.2 flash memory control register 2 (flmcr2) 7 fler 0 r 6 ? 0 ? 5 ? 0 ? 4 ? 0 ? 3 ? 0 ? 0 psu 0 r/w 2 ? 0 ? 1 esu 0 r/w bit initial value r/w : : : flmcr2 is an 8-bit register that monitors the presence or absence of flash memory program/erase protection (error protection) and performs setup for flash memory program/erase mode. flmcr2 is initialized to h'00 by a reset. the esu and psu bits are cleared to 0 in power-down state (excluding the medium-speed mode, module stop mode, and sleep mode), hardware protect mode, or software protect mode. bit 7 ? flash memory error (fler): indicates that an error has occurred during an operation on flash memory (programming or erasing). when fler is set to 1, flash memory goes to the error- protection state. bit 7 fler description 0 flash memory is operating normally flash memory program/erase protection (error protection) is disabled [clearing condition] reset or hardware standby mode (initial value) 1 an error has occurred during flash memory programming/erasing flash memory program/erase protection (error protection) is enabled [setting condition] see section 7.6.3, error protection bits 6 to 2 ? reserved: these bits cannot be modified and are always read as 0. section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 137 of 1038 rej09b0328-0300 bit 1 ? erase setup (esu): prepares for a transition to erase mode. set this bit to 1 before setting the e bit to 1 in flmcr1. do not set the swe, psu, ev, pv, e, or p bit at the same time. bit 1 esu description 0 erase setup cleared (initial value) 1 erase setup [setting condition] when fwe = 1, and swe = 1 bit 0 ? program setup (psu): prepares for a transition to program mode. set this bit to 1 before setting the p bit to 1 in flmcr1. do not set the swe, esu, ev, pv, e, or p bit at the same time. bit 0 psu description 0 program setup cleared (initial value) 1 program setup [setting condition] when fwe = 1, and swe = 1 section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 138 of 1038 rej09b0328-0300 7.3.3 erase block registers 1 and 2 (ebr1, ebr2) 7 ? 0 ? 6 ? 0 ? 5 ? 0 ? 4 ? 0 ? 3 ? 0 ? 0 eb8 0 r/w 2 ? 0 ? 1 eb9 0 r/w 7 eb7 0 r/w 6 eb6 0 r/w 5 eb5 0 r/w 4 eb4 0 r/w 3 eb3 0 r/w 0 eb0 0 r/w 2 eb2 0 r/w 1 eb1 0 r/w bit ebr1 initial value r/w : : : : bit ebr2 initial value r/w : : : : ebr1 and ebr2 are registers that specify the fl ash memory erase area block by block; bits 1 and 0 in ebr1 (128-kbyte versions only) and bits 7 to 0 in ebr2 are readable/writable bits. ebr1 and ebr2 are each initialized to h'00 by a reset, in power-down state (excluding the medium-speed mode, module stop mode, and sleep mode), when a low level is input to the fwe pin, or when a high level is input to the fwe pin and the swe bit in flmcr1 is not set. when a bit in ebr1 or ebr2 is set, the corresponding block can be erased. other blocks are erase-protected. set only one bit in ebr1 or ebr2 (more than one bit cannot be set). the flash memory block configuration is shown in table 7.4. table 7.4 flash memory erase blocks block (size) 128-kbyte versions address eb0 (1 kbyte) h'000000 to h'0003ff eb1 (1 kbyte) h'000400 to h'0007ff eb2 (1 kbyte) h'000800 to h'000bff eb3 (1 kbyte) h'000c00 to h'000fff eb4 (28 kbytes) h'001000 to h'007fff eb5 (16 kbytes) h'008000 to h'00bfff eb6 (8 kbytes) h'00c000 to h'00dfff eb7 (8 kbytes) h'00e000 to h'00ffff eb8 (32 kbytes) h'010000 to h'017fff eb9 (32 kbytes) h'018000 to h'01ffff section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 139 of 1038 rej09b0328-0300 7.3.4 serial/timer control register (stcr) 7 ? 0 ? 6 iicx 0 r/w 5 iicrst 0 r/w 4 ? 0 ? 3 flshe 0 r/w 0 ? 0 ? 2 ? 0 ? 1 ? 0 ? bit initial value r/w : : : stcr is an 8-bit readable/writable regist er that controls register access, the i 2 c bus interface operating mode, and on-chip flash memory (in f-ztat versions), and also selects the i 2 c bus interface serial clock frequency. for details on func tions not related to on-chip flash memory, see section 25.2.7, serial/timer control register (stcr), and descriptions of individual modules. if a module controlled by stcr is not used, do not write 1 to the corresponding bit. stcr is initialized to h'00 by a reset. bits 6 and 5 ? i 2 c control (iicx, iicrst): these bits control the operation of the i 2 c bus interface. for details, see section 25, i 2 c bus interface (iic). bit 3 ? flash memory control register enable (flshe): setting the flshe bit to 1 enables read/write access to the flash me mory control registers. if flsh e is cleared to 0, the flash memory control registers are desel ected. in this case, the flash me mory control register contents are retained. bit 3 flshe description 0 flash memory control registers deselected (initial value) 1 flash memory control registers selected bits 7, 4, and 2 to 0 ? reserved section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 140 of 1038 rej09b0328-0300 7.4 on-board programming modes when pins are set to on-board programming mode, program/erase/verify operations can be performed on the on-chip flash memory. there are two on-board programming modes: boot mode and user program mode. the pin settings for transition to each of these modes are shown in table 7.5. for a diagram of the transitions to the various flash memory modes, see figure 7.3. table 7.5 setting on-board programming modes mode pin mode name fwe md0 p12 p13 p14 boot mode 1 0 1 * 2 1 * 2 1 * 2 user program mode 1 * 1 1 ? ? ? notes: 1. in user program mode, the fwe pin should not be constantly set to 1. set fwe to 1 to make a transition to user program mode before performing a program/erase/verify operation. 2. can be used as i/o ports after boot mode is initiated. section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 141 of 1038 rej09b0328-0300 7.4.1 boot mode when boot mode is used, the flash memory programming control program must be prepared in the host beforehand. the channel 1 sci to be used is set to asynchronous mode. when a reset-start is executed after the mcu's pins have been set to boot mode, the boot program built into the mcu is started and the programming control program prepared in the host is serially transmitted to the mcu via the sci1. in the mcu, the programming control program received via the sci1 is written into the programming control program area in on-chip ram. after the transfer is completed, control branches to the start address of the programming control program area and the programming control program execution state is entered (flash memory programming is performed). the transferred programming control program must therefore include coding that follows the programming algorithm given later. the system configuration in boot mode is shown in figure 7.7, and the boot program mode execution procedure in figure 7.8. si1 so1 sci1 this lsi flash memory write data reception verify data transmission host on-chip ram figure 7.7 system configuration in boot mode section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 142 of 1038 rej09b0328-0300 start set pins to boot mode and execute reset-start host transfers data (h'00) continuously at prescribed bit rate host transmits programming control program sequentially in byte units transfer received programming control program to on-chip ram this lsi calculates bit rate and sets value in bit rate register host transmits number of programming control program bytes (n), upper byte followed by lower byte this lsi transmits received programming control program to host as verify data (echo-back) n = 1 end of transmission n = n? n + 1 n note : yes no this lsi measures low period of h'00 data transmitted by host after bit rate adjustment, transmits one h'00 data byte to host to indicate end of adjustment upon receiving h'55, this lsi transmits one h'aa data byte to host host confirms normal reception of bit rate adjustment end indication (h'00) and transmits one h'55 data byte execute programming control program transferred to on-chip ram this lsi transmits received number of bytes to host as verify data (echo-back) if a memory cell does not operate normally and cannot be erased, one h'ff byte is transmitted as an erase error, and the erase operation and subsequent operations are halted. after confirming that all flash memory data has been erased, this lsi transmits one h'aa data byte to host check flash memory data, and if data has already been written, erase all blocks figure 7.8 boot mode execution procedure section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 143 of 1038 rej09b0328-0300 (1) automatic sci bit rate adjustment start bit stop bit d0 d1 d2 d3 d4 d5 d6 d7 low period (9 bits) measured (h'00 data) high period (1 or more bits) figure 7.9 automatic sci bit rate adjustment when boot mode is initiated, the mcu measures the low period of the asynchronous sci communication data (h'00) transmitted continuo usly from the host. the sci transmit/receive format should be set as follows: 8-bit data, 1 stop bit, no parity. the mcu calculates the bit rate of the transmission from the host from the measured low period, and transmits one h'00 byte to the host to indicate the end of bit rate adjustment. the host should confirm that this adjustment end indication (h'00) has been received normally, an d transmit one h'55 byte to the mcu. if reception cannot be performed normally, initiate boot mode ag ain (reset), and repeat the above operations. depending on the host's transmission bit rate and the mcu's system clock frequency, there will be a discrepancy between the bit rates of the host a nd the mcu. to ensure correct sci operation, the host's transfer bit rate should be set to (4800 or 9600) bps. table 7.6 shows typical host transfer bit rates and system clock frequencies for which automatic adjustment of the mcu's bit rate is possible. the boot program should be executed within this system clock range. table 7.6 system clock frequencies for which automatic adjustment of this lsi bit rate is possible host bit rate system clock frequency for which automatic adjustment of this lsi bit rate is possible 9600 bps 8 mhz to 10 mhz 4800 bps 4 mhz to 10 mhz section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 144 of 1038 rej09b0328-0300 (2) on-chip ram area divisions in boot mode in boot mode, the 2048-byte area from h'ffefb0 to h'fff7af is reserved for use by the boot program, as shown in figure 7.10. the area to which the programming control program is transferred is h'fff7b0 to h' ffff2f ( 1920 bytes). the boot program area can be used when the programming control program transferred in to ram enters the execution state. a stack area should be set up as required. h'ffefb0 h'fff7b0 programming control program area (1920 bytes) reserved area (128 bytes) h'ffffaf h'ffff30 boot program area * (2048 bytes) note: * the boot program area cannot be used until a transition is made to the execution state for the programming control program transferred to ram. note that the boot program reamins stored in this area after a branch is made to the programming control program. figure 7.10 ram areas in boot mode (3) notes on use of boot mode: (a) when reset is released in boot mode, it measures the low period of the input at the sci1?s si1 pin. the reset should end with si1 pin high. after the reset ends, it takes about 100 states for the chip to get ready to measure the low period of the si1 pin input. (b) in boot mode, if any data has been programmed into the flash memory (if all data is not 1), all flash memory blocks are erased. boot mode is for use when user program mode is unavailable, such as the first time on-board programming is performed, or if the program activated in user program m ode is accidentally erased. (c) interrupts cannot be used while the flash memory is being programmed or erased. (d) the si1 and so1 pins should be pulled up on the board. section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 145 of 1038 rej09b0328-0300 (e) before branching to the programming control program (ram area h'fff3b0), the chip terminates transmit and receive operations by the on-chip sci (channel 1) (by clearing the re and te bits in scr to 0), but the adjusted bit rate value remains set in brr. the transmit data output pin, so1, goes to the high-level output state (p21pcr = 1, p21pdr = 1). the contents of the cpu's internal general re gisters are undefined at this time, so these registers must be initialized immediately after branching to the programming control program. in particular, since the stack pointer (sp) is used implicitly in subroutine calls, etc., a stack area must be specified for use by the programming control program. the initial values of other on-chip registers are not changed. (f) boot mode can be entered by making the pin settings shown in table 7.5 and executing a reset-start. when the chip detects the boot mode setting at reset release * 1 , it retains that state internally. boot mode can be cleared by driving the reset pin low, waiting at least 20 states, then setting the fwe pin and mode pins, and executing reset release * 1 . boot mode can also be cleared by a wdt overflow reset. if the mode pin input levels are changed in boot mode, the boot mode state will be maintained in the microcomputer, and boot mode continued, unless a reset occurs. however, the fwe pin must not be driven low while the boot program is running or flash memory is being programmed or erased * 2 . notes: 1. mode pin and fwe pin input must satisfy the mode programming setup time (t mds = 4 states) with respect to the reset release timing. 2. for further information on fwe applicati on and disconnection, see section 7.9, flash memory programming and erasing precautions. section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 146 of 1038 rej09b0328-0300 7.4.2 user program mode when set to user program mode, the chip can pr ogram and erase its flash memory by executing a user program/erase control program. therefore, on-board reprogramming of the on-chip flash memory can be carried out by providing on-board means of fwe control and supply of programming data, and storing a program/erase control program in part of the program area as necessary. in this mode, the chip starts up in mode 1 and applies a high level to the fwe pin. the flash memory itself cannot be read while the swe bit is set to 1 to perform programming or erasing, so the control program that performs programming and erasing should be run in on-chip ram or external memory. figure 7.11 shows the procedure for executin g the program/erase control program when transferred to on-chip ram. clear fwe * fwe = high * branch to flash memory application program branch to program/erase control program in ram area execute program/erase control program (flash memory rewriting) transfer program/erase control program to ram md0 = 1 reset start write the fwe assessment program and transfer program (and the program/erase control program if necessary) beforehand notes: do not apply a constant high level to the fwe pin. apply a high level to the fwe pin only when the flash memory is programmed or erased. also, while a high level is applied to the fwe pin, the watchdog timer should be activated to prevent overprogramming or overerasing due to program runaway, etc. * for further information on fwe application and disconnection, see section 7.9, flash memory programming and erasing precautions. figure 7.11 user program mode execution procedure section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 147 of 1038 rej09b0328-0300 7.5 programming/erasing flash memory in the on-board programming modes, flash memory programming and erasing is performed by software, using the cpu. there are four flash memory operating modes: program mode, erase mode, program-verify mode, and erase-verify mode. transitions to these modes can be made by setting the psu and esu bits in flmcr2, and the p, e, pv, and ev bits in flmcr1. the flash memory cannot be read while being prog rammed or erased. therefore, the program that controls flash memory programming/erasing (the programming control program) should be located and executed in on-chip ram or external memory. notes: 1. operation is not guaranteed if setting/resetting of the swe, ev, pv, e, and p bits in flmcr1, and the esu and psu bits in flmcr2, is executed by a program in flash memory. 2. when programming or erasing, set fwe to 1 (programming/erasing will not be executed if fwe = 0). 3. perform programming in the erased state. do not perform additional programming on previously programmed addresses. 7.5.1 program mode follow the procedure shown in the program/program-verify flowchart in figure 7.12 to write data or programs to flash memory. performing prog ram operations according to this flowchart will enable data or programs to be written to flash memory without subjecting the device to voltage stress or sacrificing program data reliability. programming should be carri ed out 32 bytes at a time. table 29.12 lists wait time (x, y, z, , , , , and ) after setting or clearing each bit on the flash memory control registers 1 and 2 (flmcr1 and flmcr2) and the maximum write count (n). following the elapse of (x) s or more after the swe bit is set to 1 in flash memory control register 1 (flmcr1), 32-byte program data is stored in the program data area and reprogram data area, and the 32-byte data in the reprogram data area written consecutively to the write addresses. the lower 8 bits of the first address written to must be h'00, h'20, h'40, h'60, h'80, h'a0, h'c0, or h'e0. thirty-two consecutive byte data transfers are performed. the program address and program data are latched in the flash memory. a 32-byte data transfer must be performed even if writing fewer than 32 bytes; in this case, h'ff data must be written to the extra addresses. next, the watchdog timer is set to prevent overprogramming in the event of program runaway, etc. set more than (y + z + + ) s as the wdt overflow period. after this, preparation for program mode (program setup) is carried out by setting the psu bit in flmcr2, and after the elapse of (y) s or more, the operating mode is switched to program mode by setting the p bit in flmcr1. the time during which the p bit is set is the flash memory programming time. make a program setting so that the time for one programming operation is within the range of (z) s. section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 148 of 1038 rej09b0328-0300 7.5.2 program-verify mode in program-verify mode, the data written in program mode is read to check whether it has been correctly written in the flash memory. after the elapse of a given programming time, the programming mode is exited (the p bit in flmcr1 is cleared, then the psu bit in flmcr2 is cleared at least ( ) s later). the watchdog timer is cleared afte r the elapse of ( ) s or more, and the operating mode is switched to program- verify mode by setting the pv bit in flmcr1. before reading in program-verify mode, a dummy write of h'ff data should be made to the addresses to be read. the dummy write should be executed after the elapse of ( ) s or more. when the flash memory is read in this state (verify data is read in 16-bit units), the data at the latched address is read. wait at least ( ) s after the dummy write before performing this read operation. next, the originally written data is compared with the verify data, and reprogram data is computed (see figure 7.12) and transferred to the reprogram data area. after 32 bytes of data have been verified, exit program-verify mode, wait for at least ( ) s, then clear the swe bit in flmcr1. if reprogramming is necessary, set program mode again, and repeat the program/program-verify sequen ce as before. however, ensure that the program/program-verify sequence is not repeat ed more than (n) times on the same bits. section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 149 of 1038 rej09b0328-0300 start end of programming programming failure set swe bit in flmcr1 wait (x) s store 32-byte program data in program data area and reprogram data area n = 1 m = 0 enable wdt set psu bit in flmcr2 wait (y) s set p bit in flmcr1 wait (z) s start of programming clear p bit in flmcr1 wait ( ) s wait ( ) s no no no no yes yes yes wait ( ) s wait ( ) s * 5 * 3 * 2 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 4 * 1 * 5 wait ( ) s clear psu bit in flmcr2 disable wdt set pv bit in flmcr1 h'ff dummy write to verify address read verify data reprogram data computation * 4 transfer reprogram data to reprogram data area clear pv bit in flmcr1 clear swe bit in flmcr1 m = 1 end of programming program data = verify data? end of 32-byte data verification? m = 0? increment address yes clear swe bit in flmcr1 n n? n n +1 notes: program data 0 0 1 1 verify data 0 1 0 1 reprogram data 1 0 1 1 comments do not reprogram bits for which programming has been completed. programming incomplete; reprogramming should be performed. ? still in erased state; no action 1. 2. 3. 4. 5. write 32-byte data in ram reprogram data area consecutively to flash memory programming must be excuted in the erased state. do not perform additional programming on addresses that have already been programmed. ram program data storage area (32 bytes) reprogram data storage area (32 bytes) data transfer is performed by byte transfer. the lower 8 bits of the first address written to must be h'00, h'20, h'40, h'60, h'80, h'a0, h'c0, or h'e0. a 32-byte data transfer must be performed even if writing fewer than 32 bytes; in this case, h'ff data must be written to the extra addresses. verify data is read in 16-bit (word) units. even in case of the bit which is already-programmed in the 32-byte programming loop, perform additional programming if the bit fails at the next verify. an area for storing program data (32 bytes) and reprogram data (32 bytes) must be provided in ram. the contents of the latter are rewritten as programming progresses. the values of x, y, z, , , , , , and n are listed in section 29.2.7, flash memory characteristics. figure 7.12 program/program-verify flowchart section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 150 of 1038 rej09b0328-0300 7.5.3 erase mode flash memory erasing should be performed block by block following the procedure shown in the erase/erase-verify flowchart (single- block erase) shown in figure 7.13. table 29.12 lists wait time (x, y, z, , , , , and ) after setting or clearing each bit on the flash memory control registers 1 and 2 (flmcr1 and flmcr2) and the maximum clearing count (n). to perform data or program erasure, make a 1 bit setting for the flash memory area to be erased in erase block register 1 or 2 (ebr1 or ebr2) at least (x) s after setting the swe bit to 1 in flash memory control register 1 (flmcr1). next, the watchdog timer is set to prevent overerasing in the event of program runaway, etc. set more than (y + z + + ) ms as the wdt overflow period. after this, preparation for erase mode (erase setup) is carried out by setting the esu bit in flmcr2, and after the elapse of (y) s or more, the operating mode is switched to erase mode by setting the e bit in flmcr1. the time during which the e bit is set is the flash memory erase time. ensure that the erase time does not exceed (z) ms. note: with flash memory erasing, preprogramming (setting all data in the memory to be erased to 0) is not necessary before starting the erase procedure. 7.5.4 erase-verify mode in erase-verify mode, data is read after memory has been erased to ch eck whether it has been correctly erased. after the elapse of the erase time, erase mode is exited (the e bit in flmcr1 is cl eared, then the esu bit in flmcr2 is cleared at least ( ) s later), the watchdog timer is cleared after the elapse of ( ) s or more, and the operating mode is switched to erase-verify mode by setting the ev bit in flmcr1. before reading in erase-verify mode, a dummy write of h'ff data should be made to the addresses to be read. the dummy write should be executed after the elapse of ( ) s or more. when the flash memory is read in this state (verify data is read in 16-bit units), the data at the latched address is read. wait at least ( ) s after the dummy write before performing this read operation. if the read data has been erased (all 1), a dummy write is performed to the next address, and erase-verify is performed. if the read data has not been erased, set erase mode again, and repeat the erase/erase-verify sequence in the sa me way. however, ensure that the erase/erase- verify sequence is not repeated more than (n) times. when verification is completed, exit erase- verify mode, and wait for at least ( ) s. if erasure has been comple ted on all the erase blocks, clear the swe bit in flmcr1. if there are any unerased blocks, make a 1 bit setting in ebr1 or ebr2 for the flash memory area to be erased, a nd repeat the erase/erase-verify sequence in the same way. section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 151 of 1038 rej09b0328-0300 end of erasing start set swe bit in flmcr1 set esu bit in flmcr2 set e bit in flmcr1 wait (x) s wait (y) s n = 1 set ebr1, ebr2 enable wdt * 2 * 4 * 2 wait (z) ms * 2 wait ( ) s * 2 wait ( ) s * 2 wait ( ) s set block start address to verify address * 2 wait ( ) s * 2 wait ( ) s * 2 * 2 * 2 * 3 * 5 start of erase clear e bit in flmcr1 clear esu bit in flmcr2 set ev bit in flmcr1 h'ff dummy write to verify address read verify data clear ev bit in flmcr1 wait ( ) s clear ev bit in flmcr1 clear swe bit in flmcr1 disable wdt halt erase * 1 verify data = all 1? end of erasing of all erase blocks? erase failure clear swe bit in flmcr1 n n? no no no no yes yes yes yes notes: 1. 2. 3. 4. 5. increment address n n + 1 last address of block? preprogramming (setting erase block data to all 0) is not necessary. the values of x, y, z, , , , , , and n are listed in section 29.2.7, flash memory characteristics. verify data is read in 16-bit (word) units. set only one bit in ebr1 or ebr2. more than one bit cannot be set. erasing is performed in block units. to erase a number of blocks, the individual blocks must be erased sequentially. figure 7.13 erase/erase-verify flowchart (single-block erase) section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 152 of 1038 rej09b0328-0300 7.6 flash memory protection there are three kinds of flash memory program/er ase protection: hardware protection, software protection, and error protection. 7.6.1 hardware protection hardware protection refers to a state in which programming/erasing of flash memory is forcibly disabled or aborted. hardware protection is reset by settings in flash memory control registers 1 and 2 (flmcr1, flmcr2) and erase block registers 1 and 2 (ebr1, ebr2). in error protection mode, flmcr1, flmcr2, ebr1, and ebr2 settings are retained. (see table 7.7.) table 7.7 hardware protection functions item description program erase fwe pin protection ? when a low level is input to the fwe pin, flmcr1, flmcr2, ebr1, and ebr2 are initialized, and the program/erase-protected state is entered yes yes reset/standby protection ? in a reset (including a wdt overflow reset) and in power-down state (excluding the medium-speed mode, module stop mode, and sleep mode), flmcr1, flmcr2 (excluding the fler bit), ebr1, and ebr2 are initialized, and the program/erase-protected state is entered ? in a reset via the res pin, the reset state is not entered unless the res pin is held low until oscillation stabilizes after powering on. in the case of a reset during operation, hold the res pin low for the res pulse width specified in the ac characteristics section yes yes section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 153 of 1038 rej09b0328-0300 7.6.2 software protection software protection can be implemented by setting the swe bit in flmcr1 and erase block registers 1 and 2 (ebr1, ebr2). when software protection is in effect, setting the p or e bit in flash memory control register 1 (flmcr1) does not cause a transition to program mode or erase mode. (see table 7.8.) table 7.8 software protection functions item description program erase swe bit protection ? clearing the swe bit to 0 in flmcr1 sets the program/erase-protected state for all blocks (execute in on-chip ram or external memory) yes yes block specification protection ? erase protection can be set for individual blocks by settings in erase block registers 1 and 2 (ebr1, ebr2) ? setting ebr1 and ebr2 to h'00 places all blocks in the erase-protected state ? yes 7.6.3 error protection in error protection, an error is detected when mcu runaway occurs during flash memory programming/erasing, or operati on is not performed in accordance with the program/erase algorithm, and the program/erase operation is aborted. aborting the program/erase operation prevents damage to the flash memory due to overprogramming or overerasing. if the mcu malfunctions during flash memory programming/erasing, the fler bit is set to 1 in flmcr2 and the error protection state is entered. the flmcr1, flmcr2, ebr1, and ebr2 settings are retained, but program mode or erase mode is aborted at the point at which the error occurred. program mode or erase mode cannot be re-entered by re-setting the p or e bit. however, pv and ev bit setting is enabled, and a transition can be made to verify mode. fler bit setting conditions are as follows: (1) when flash memory is read during programming/erasing (including a vector read or instruction fetch) (2) immediately after exception handling (excluding a reset) during programming/erasing (3) when a sleep instruction is executed during programming/erasing error protection is released only by a reset and in hardware standby mode. section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 154 of 1038 rej09b0328-0300 figure 7.14 shows the flash memory state transition diagram. : memory read possible : verify-read possible : programming possible : erasing possible legend: rd vf pr er : memory read not possible : verify-read not possible : programming not possible : erasing not possible rd vf pr er rd vf pr er fler = 0 error occurrence error occurre nce sleep instru ction execution res = 0 res = 0 res = 0 rd vf pr er fler = 0 program mode erase mode reset (hardware protection) rd vf pr er fler = 1 rd vf pr er fler = 1 error protection mode error protection mode (power-down state) * power-down state * flmcr1, flmcr2 (except fler bit), ebr1, ebr2 initialization state flmcr1, flmcr2, ebr1, ebr2 initialization state power-down state * release note: * watch mode, standby mode, and subactive mode figure 7.14 flash memory state transitions section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 155 of 1038 rej09b0328-0300 7.7 interrupt handling when progr amming/erasing flash memory all interrupts, including nmi input is disabled when flash memory is being programmed or erased (when the p or e bit is set in flmcr1), and while the boot program is executing in boot mode * 1 , to give priority to the program or erase operation. there are three reasons for this: (1) interrupt during programming or erasing might cause a violation of the programming or erasing algorithm, with the result that normal operation could not be assured. (2) in the interrupt exception handling sequence during programming or erasing, the vector would not be read correctly * 2 , possibly resulting in mcu runaway. (3) if interrupt occurred during boot program execution, it would not be possible to execute the normal boot mode sequence. for these reasons, in on-board programming mode alone there are conditions for disabling interrupt, as an exception to the general rule. however, this provision does not guarantee normal erasing and programming or mcu operation. all requests, including nmi input, must therefore be disabled inside and outside the mcu during fwe application. interrupt is also disabled in the error-protection state while the p or e bit remains set in flmcr1. notes: 1. interrupt requests must be disabled inside and outside the mcu until data write by the write control program is complete. 2. the vector may not be read correctly in this case for the following two reasons: ? if flash memory is read while being programmed or erased (while the p or e bit is set in flmcr1), correct read data will not be obtained (undetermined values will be returned). ? if the interrupt entry in the interrupt vector table has not been programmed yet, interrupt exception handling will not be executed correctly. section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 156 of 1038 rej09b0328-0300 7.8 flash memory programmer mode 7.8.1 programmer mode setting programs and data can be written and erased in programmer mode as well as in the on-board programming modes. in programmer mode, the on-chip rom can be freely programmed using a prom programmer that supports renesas technology microcomputer device type with 128-kbyte on-chip flash memory. flash memory read mode, auto-program mode, auto-erase mode, and status read mode are supported with these device types. in auto-program mode, auto-erase mode, and status read mode, a status polling procedure is used, and in status read mode, detailed internal signals are output after execution of an auto-program or auto-erase operation. 7.8.2 socket adapt ers and memory map in programmer mode, a socket adapter is mounted on the writer programmer. the socket adapter product codes are listed in table 7.9. figure 7.15 shows the memory map in programmer mode. table 7.9 socket adapter product codes part no. package socket adapter product code HD64F2194 112-pin qfp me2194eshf1h this lsi h'000000 mcu mode programmmer mode h'01ffff h'00000 h'1ffff on-chip rom area (128 kbytes) figure 7.15 memory map in programmer mode section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 157 of 1038 rej09b0328-0300 7.8.3 programmer mode operation table 7.10 shows how the different operating mo des are set when using programmer mode, and table 7.11 lists the commands used in programmer mode. details of each mode are given below. (1) memory read mode memory read mode supports byte reads. (2) auto-program mode auto-program mode supports programming of 128 byt es at a time. status polling is used to confirm the end of auto-programming. (3) auto-erase mode auto-erase mode supports automatic erasing of the entire flash memory. status polling is used to confirm the end of auto-erasing. (4) status read mode status polling is used for auto-programming and auto-erasing, and normal termination can be confirmed by reading the fo6 signal. in status read mode, error information is output if an error occurs. table 7.10 settings for each opera ting mode in programmer mode pin names mode fwe ce oe we fo0 to fo7 fa0 to fa17 read h or l l l h data output ain output disable h or l l h h hi-z x command write h or l * 3 l h l data input ain * 2 chip disable * 1 h or l l x x hi-z x notes: 1. chip disable is not a standby state; internally, it is an operation state. 2. ain indicates that there is also address input in auto-program mode. 3. for command writes when making a transition to auto-program or auto-erase mode, input a high level to the fwe pin. section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 158 of 1038 rej09b0328-0300 table 7.11 programmer mode commands 1st cycle 2nd cycle command name number of cycles mode address data mode address data memory read mode 1 + n write x h'00 read ra dout auto-program mode 129 write x h'40 write wa din auto-erase mode 2 write x h'20 write x h'20 status read mode 2 write x h'71 write x h'71 notes: 1. in auto-program mode. 129 cycles are r equired for command writing by a simultaneous 128-byte write. 2. in memory read mode, the number of cycles depends on the number of address write cycles (n). 7.8.4 memory read mode (1) after the end of an auto-program, auto-erase, or status read operation, the command wait state is entered. to read memory contents, a trans ition must be made to memory read mode by means of a command write befo re the read is executed. (2) command writes can be performed in memory r ead mode, just as in the command wait state. (3) once memory read mode has been ente red, consecutive reads can be performed. (4) after power-on, memory read mode is entered. table 7.12 ac characteristics in memory read mode (1) (conditions: v cc = 5.0 v 10%, v ss = 0 v, ta = 25 c 5 c) item symbol min max unit command write cycle t nxtc 20 ? s ce hold time t ceh 0 ? ns ce setup time t ces 0 ? ns data hold time t dh 50 ? ns data setup time t ds 50 ? ns write pulse width t wep 70 ? ns we rise time t r ? 30 ns we fall time t f ? 30 ns section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 159 of 1038 rej09b0328-0300 ce address data h'00 oe we command write t wep t ceh t dh t ds t f t r t nxtc note: data is latched on the rising edge of we . t ces memory read mode address stable data figure 7.16 memory read mode timing waveforms after command write table 7.13 ac characteristics when entering another mode from memory read mode (conditions: v cc = 5.0 v 10%, v ss = 0 v, ta = 25 c 5 c) item symbol min max unit command write cycle t nxtc 20 ? s ce hold time t ceh 0 ? ns ce setup time t ces 0 ? ns data hold time t dh 50 ? ns data setup time t ds 50 ? ns write pulse width t wep 70 ? ns we rise time t r ? 30 ns we fall time t f ? 30 ns section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 160 of 1038 rej09b0328-0300 ce address data h'xx oe we xx mode command write t wep t ceh t dh t ds t nxtc note: do not enable we and oe at the same time. t ces address stable data t f t r figure 7.17 timing waveforms when entering another mode from memory read mode table 7.14 ac characteristics in memory read mode (2) (conditions: v cc = 5.0 v 10%, v ss = 0 v, ta = 25 c 5 c) item symbol min max unit access time t acc ? 20 s ce output delay time t ce ? 150 ns oe output delay time t oe ? 150 ns output disable delay time t df ? 100 ns data output hold time t oh 5 ? ns ce address data vil vil vih oe we t acc t oh t oh t acc address stable address stable data data figure 7.18 timing waveforms for ce / oe enable state read section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 161 of 1038 rej09b0328-0300 ce address data vih oe we t ce t acc t oe t oh t oh t df t ce t acc t oe address stable address stable data data t df figure 7.19 timing waveforms for ce / oe clocked read 7.8.5 auto-program mode (a) in auto-program mode, 128 bytes are programmed simultaneously. this should be carried out by executing 128 consecutive byte transfers. (b) a 128-byte data transfer is necessary even when programming fewer than 128 bytes. in this case, h'ff data must be written to the extra addresses. (c) the lower 8 bits of the transfer address must be h'00 or h'80. if a value other than an effective address is input, processing will switch to a memo ry write operation but a write error will be flagged. (d) memory address transfer is performed in the second cycle (figure 7.20). do not perform transfer after the second cycle. (e) do not perform a command write during a programming operation. (f) perform one auto-programming operation for a 128-byte block for each address. characteristics are not guaranteed for two or more programming operations. (g) confirm normal end of auto-programming by checking fo6. alternatively, status read mode can also be used for this purpose (fo7 status polling uses the auto-program operation end identification pin). (h) the status polling fo6 and fo7 pin information is retained until the next command write. until the next command write is performed, reading is possible by enabling ce and oe . section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 162 of 1038 rej09b0328-0300 table 7.15 ac characteristics in auto-program (conditions: v cc = 5.0 v 10%, v ss = 0 v, ta = 25 c 5 c) item symbol min max unit command write cycle t nxtc 20 ? s ce hold time t ceh 0 ? ns ce setup time t ces 0 ? ns data hold time t dh 50 ? ns data setup time t ds 50 ? ns write pulse width t wep 70 ? ns status polling start time t wsts 1 ? ms status polling access time t spa ? 150 ns address setup time t as 0 ? ns address hold time t ah 60 ? ns memory write time t write 1 3000 ms we rise time t r ? 30 ns we fall time t f ? 30 ns write setup time t pns 100 ? ns write end setup time t pnh 100 ? ns ce fwe address fo7 oe we t nxtc t wsts t spa t nxtc t ces t ds t dh t wep t as t pnh t pns t ah t ceh address stable data transfer 1 byte to 128 bytes fo6 programming wait data data h'40 data fo0 to 5 = 0 t f t r t write (1 to 3,000 ms) programming operation end identification signal programming normal end identification signal figure 7.20 auto-program mode timing waveforms section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 163 of 1038 rej09b0328-0300 7.8.6 auto-erase mode (a) auto-erase mode supports only entire memory erasing. (b) do not perform a command write during auto-erasing. (c) confirm normal end of auto-erasing by checking fo6. alternatively, status read mode can also be used for this purpose (fo7 status polling uses the auto-erase operation end identification pin). (d) the status polling fo6 and fo7 pin information is retained until the next command write. until the next command write is performed, reading is possible by enabling ce and oe . table 7.16 ac characteristics in auto-erase mode (conditions: v cc = 5.0 v 10%, v ss = 0 v, ta = 25 c 5 c) item symbol min max unit command write cycle t nxtc 20 ? s ce hold time t ceh 0 ? ns ce setup time t ces 0 ? ns data hold time t dh 50 ? ns data setup time t ds 50 ? ns write pulse width t wep 70 ? ns status polling start time t ests 1 ? ms status polling access time t spa ? 150 ns memory erase time t erase 100 40000 ms we rise time t r ? 30 ns we fall time t f ? 30 ns erase setup time t ens 100 ? ns erase end setup time t enh 100 ? ns section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 164 of 1038 rej09b0328-0300 ce fwe address fo5 to fo0 fo6 fo7 oe we t erase (100 to 40000 ms) t ests t spa t nxtc t nxtc t ces t ceh t dh cl in dl in t ds t wep t ens fo0 to 5 = 0 h'20 h'20 t enh erase end identification signal erase normal end identification signal t f t r figure 7.21 auto-erase mode timing waveforms 7.8.7 status read mode (1) status read mode is used to identify what type of abnormal end has occurred. use this mode when an abnormal end occurs in auto -program mode or auto-erase mode. (2) the return code is retained until a command write for other than status read mode is performed. section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 165 of 1038 rej09b0328-0300 table 7.17 ac characteristics in status read mode (conditions: v cc = 5.0 v 10%, v ss = 0 v, ta = 25 c 5 c) item symbol min max unit command write cycle t nxtc 20 ? s ce hold time t ceh 0 ? ns ce setup time t ces 0 ? ns data hold time t dh 50 ? ns data setup time t ds 50 ? ns write pulse width t wep 70 ? ns oe output delay time t oe ? 150 ns disable delay time t df ? 100 ns ce output delay time t ce ? 150 ns we rise time t r ? 30 ns we fall time t f ? 30 ns ce address data oe we t ces t nxtc t nxtc t df note: fo2 and fo3 are undefined. t ces t dh t ceh t ds t wep t wep data t dh t ceh t ds t oe t ce t nxtc h'71 h'71 t f t r t f t r figure 7.22 status read mode timing waveforms section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 166 of 1038 rej09b0328-0300 table 7.18 status read mode return commands pin name fo7 fo6 fo5 fo4 fo3 fo2 fo1 fo0 attribute normal end identification command error programming error erase error ? ? programming or erase count exceeded effective address error initial value 0 0 0 0 0 0 0 0 indications normal end: 0 abnormal end: 1 command error: 1 otherwise: 0 programming error: 1 otherwise: 0 erase error: 1 otherwise: 0 ? ? count exceeded: 1 otherwise: 0 effective address error: 1 otherwise: 0 note: fo2 and fo3 are undefined. 7.8.8 status polling (1) the fo7 status polling flag indicates the operating status in auto-program or auto-erase mode. (2) the fo6 status polling flag indicates a normal or abnormal end in auto-program or auto-erase mode. table 7.19 status polling output truth table pin names internal operation in progress abnormal end ? normal end fo7 0 1 0 1 fo6 0 0 1 1 fo0 to fo5 0 0 0 0 7.8.9 programmer mode transition time commands cannot be accepted during the oscillation stabilization period or the programmer mode setup period. after the programmer mode setup time, a transition is made to memory read mode. table 7.20 command wait state transition time specifications item symbol min max unit standby release (oscillation stabilization time) t osc1 10 ? ms programmer mode setup time t bmv 10 ? ms v cc hold time t dwn 0 ? ms section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 167 of 1038 rej09b0328-0300 v cc res fwe memory read mode command wait state command wait state normal/abnormal end identifica- tion auto-program mode auto-erase mode t osc1 t bmv t dwn note: except in auto-program mode and auto-erase mode, drive the fwe input pin low. don't care don't care figure 7.23 oscillation stabilization time, boot program transfer time, and power supply fall sequence 7.8.10 notes on memory programming (1) when programming addresses which have previously been programmed, carry out auto- erasing before auto-programming. (2) when performing programming using programmer mode on a chip that has been programmed/erased in an on-board programming mode, auto-erasing is recommended before carrying out auto-programming. notes: 1. the flash memory is initially in the erased state when the device is shipped by renesas. for other chips for which the erasure history is unknown, it is recommended that auto- erasing be executed to check and suppl ement the initialization (erase) level. 2. auto-programming should be performe d once only on the same address block. section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 168 of 1038 rej09b0328-0300 7.9 flash memory programming and erasing precautions precautions concerning the use of on-board programming mode and programmer mode are summarized below. (1) use the specified voltages and timing for programming and erasing applied voltages in excess of the rating can permanently damage the device. use a prom programmer that supports renesas technology microcomputer device type with 128-kbyte on- chip flash memory. do not select the hn28f101 setting for the prom programmer, and only use the specified socket adapter. incorrect use will result in damaging the device. (2) powering on and off do not apply a high level to the fwe pin until v cc has stabilized. also, drive the fwe pin low before turning off v cc . when applying or disconnecting v cc , fix the fwe pin low and place the flash memory in the hardware protection state. the power-on and power-off timing requirements should also be satisfied in the event of a power failure and subsequent recovery. (3) fwe application/disconnection fwe application should be carrie d out when mcu operation is in a stable condition. if mcu operation is not stable, fix the fwe pin low and set the protection state. the following points must be observed concerning fwe application and disconnection to prevent unintentional programming or erasing of flash memory: (a) apply fwe when the v cc voltage has stabilized within its rated voltage range. (b) in boot mode, apply and disconnect fwe during a reset. (c) in user program mode, fwe can be switched between high and low level regardless of the reset state. fwe input can also be switched during program execution in flash memory. (d) do not apply fwe if program runaway has occurred. (e) disconnect fwe only when the swe, esu, psu, ev, pv, p, and e bits in flmcr1 and flmcr2 are cleared. make sure that the swe, esu, psu, ev, pv, p, and e bits are not set by mistake when applying or disconnecting fwe. (4) do not apply a constant high level to the fwe pin apply a high level to the fwe pin only when programming or erasing flash memory. a system configuration in which a high level is constantly applied to the fwe should be avoided. also, while a high level is applied to the fwe pin, the watchdog timer should be activated to prevent overprogramming or overerasi ng due to program runaway, etc. section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 169 of 1038 rej09b0328-0300 (5) use the recommended algorithm when programming and erasing fash memory the recommended algorithm enables programming and erasing to be carried out without subjecting the device to voltage stress or sacrificing program data reliability. when setting the p or e bit in flmcr1, the watchdog timer should be set beforehand as a precaution against program runaway, etc. (6) do not set or clear the swe bit during program execution in flash memory clear the swe bit before executing a program or reading data in flash memory. when the swe bit is set, data in flash memory can be rewritten, but flash memory should only be accessed for verify operations (ver ification during pr ogramming/erasing). (7) do not use interrupts while flash memory is being programmed or erased all interrupt requests, including nmi, should be disabled during fwe application to give priority to program/erase operations. (8) do not perform additional aprogramming. erase the memory before reprogramming. in on-board programming, perform only one programming operation on a 32-byte programming unit block. in programmer mode, too, perform only one programming operation on a 128-byte programming unit block. programming should be carried out with the entire programming unit block erased. (9) before programming, check that the chip is correctly mounted in the prom programmer. overcurrent damage to the device can result if the index marks on the prom programmer socket, socket adapter, and ch ip are not correctly aligned. (10)do not touch the socket adapter or chip during programming. touching either of these can cause contact faults and write errors. section 7 rom (h8s/2194 group) rev.3.00 jan. 10, 2007 page 170 of 1038 rej09b0328-0300 7.10 note on switching from f-zta t version to mask rom version the mask rom version does not have the internal registers for flash memory control that are provided in the f-ztat version. table 7.21 lists the registers that are present in the f-ztat version but not in the mask rom version. if a register listed in table 7.21 is read in the mask rom version, an undefined value will be returned. therefore, if application software developed on the f-ztat version is switched to a mask rom version product, it must be modified to ensure that the registers in table 7.21 have no effect. table 7.21 registers present in f-ztat version but absent in mask rom version register abbreviation address flash memory control register 1 flmcr1 h'fff8 flash memory control register 2 flmcr2 h'fff9 erase block register 1 ebr1 h'fffa erase block register 2 ebr2 h'fffb section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 171 of 1038 rej09b0328-0300 section 8 rom (h8s/2194c group) 8.1 overview the h8s/2194c has 256 kbytes of on-chip rom (flash memory or mask rom), the h8s/2194b has 192 kbytes, the h8s/2194a has 160 kbytes. the rom is connected to the cpu by a 16-bit data bus. the cpu accesses both byte and word data in one state, enabling faster instruction fetches and higher processing speed. the flash memory versions of the h8s/2194c can be erased and programmed on-board as well as with a general-purpose prom programmer. 8.1.1 block diagram figure 8.1 shows a block diagram of the rom. internal data bus (upper 8 bits) internal data bus (lower 8 bits) h'000000 h'000002 h'03fffe h'000001 h'000003 h'03ffff figure 8.1 rom block diagram (h8s/2194c) section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 172 of 1038 rej09b0328-0300 8.2 overview of flash memory 8.2.1 features the features of the flash memory are summarized below. ? four flash memory operating modes ? program mode ? erase mode ? program-verify mode ? erase-verify mode ? programming/erase methods the flash memory is programmed 32 bytes at a time. erasing is performed by block erase (in single-block units). when erasing all blocks, the individual blocks must be erased sequentially. block erasing can be performed as required on 1-kbyte, 8-kbyte, 16-kbyte, 28-kbyte, and 32- kbyte blocks. ? programming/erase times the flash memory programming time is 10 ms (typ.) for simultaneous 32-byte programming, equivalent to 300 s (typ.) per byte, and the erase time is 100 ms (typ.) per block. ? reprogramming capability the flash memory can be reprogrammed up to 100 times. ? on-board programming modes there are two modes in which flash memory can be programmed/erased/verified on-board: ? boot mode ? user program mode ? automatic bit rate adjustment if data transfer on boot mode, automatic adjustment is possible at host transfer bit rates and mcu's bit rates. ? protect modes there are three protect modes, hardware, soft ware, and error protect, which allow protected status to be designated for flash memory program/erase/verify operations. ? programmer mode flash memory can be programmed/erased in programmer mode, using a prom programmer, as well as in on-board programming mode. section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 173 of 1038 rej09b0328-0300 8.2.2 block diagram module bus bus interface/controller flash memory (256 kbytes) operat- ing mode flmcr1 * * * * stcr flmcr1 flmcr2 ebr1 ebr2 : serial/timer control register : flash memory control register 1 : flash memory control register 2 : erase block register 1 : erase block register 2 legend: internal address bus internal data bus (16 bits) stcr fwe pin mode pin flmcr2 ebr1 ebr2 note: * these registers are exclusively used for the flash memory. if you try to read these addresses with the mask rom version, values read becomes uncertain. data write is also disabled with the above version. figure 8.2 block diagram of flash memory section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 174 of 1038 rej09b0328-0300 8.2.3 flash memory operating modes (1) mode transitions when each mode pin and the fwe pin are set in th e reset state and a reset-start is executed, the mcu enters one of the operating modes shown in figure 8.3. in user mode, flash memory can be read but not programmed or erased. flash memory can be programmed and erased in boot mode, user program mode, and programmer mode. boot mode on-board program mode user program mode user mode reset state programmer mode fwe = 1, md0 = 0, p12 = p13 = p14 = 1 res = 0 res = 0 fwe = 1 swe = 1 fwe = 0 or swe = 0 res = 0 md0 = 1, fwe = 0 res = 0 only make a transition between user mode and user program mode when the cpu is not accessing the flash memory. * md0 = 0, p12 = p13 = 1, p14 = 0 notes: * figure 8.3 flash memory mode transitions section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 175 of 1038 rej09b0328-0300 (2) on-board programming modes (a) boot mode flash memory ram host programming control program sci application program (old version) new application program new application program flash memory ? this lsi ? ? this lsi ? ? this lsi ? ? this lsi ? ram host sci application program (old version) boot program area programming control program new application program flash memory ram host sci flash memory preprograming erase boot program flash memory program execution state ram host sci new application program boot program programming control program 1. initial state the old program version or data remains written in the flash memory. the user should prepare the programming control program and new application program beforehand in the host. 2. programming control program transfer when boot mode is entered, the boot program in the lsi (originally incorporated in the chip) is started and the programing control program in the host is transferred to ram via sci communication. the boot program required for flash memory erasing is automatically transferred to the ram boot program area. 3. flash memory initialization the erase program in the boot program area (in ram) is executed, and the flash memory is initialized (to h'ff). in boot mode, entire flash memory erasure is performed, without regard to blocks. 4. writing new application program the programming control program transferred from the host to ram is executed, and the new application program in the host is written into the flash memory. boot program boot program boot program area boot program area programming control program figure 8.4 boot mode section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 176 of 1038 rej09b0328-0300 (b) user program mode section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 177 of 1038 rej09b0328-0300 (3) differences between boot mode and user program mode table 8.1 differences between boot mode and user program mode boot mode user program mode entire memory erase yes yes block erase no yes programming control program * program/program-verify erase/erase-verify program/program-verify note: * to be provided by the user, in accordance with the recommended algorithm. (4) block configuration the flash memory is divided into six 32-kbyte blocks, two 8-kbyte blocks, one 16-kbyte block, one 28-kbyte block, and four 1-kbyte blocks. 8 kbytes address h'000000 address h'03ffff 256 kbytes 32 kbytes 32 kbytes 32 kbytes 32 kbytes 32 kbytes 256-kbyte version 32 kbytes 28 kbytes 1 kbyte 1 kbyte 1 kbyte 1 kbyte 16 kbytes 8 kbytes figure 8.6 flash memory block configuration section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 178 of 1038 rej09b0328-0300 8.2.4 pin configuration the flash memory is controlled by means of the pins shown in table 8.2. table 8.2 flash memory pins pin name abbreviation i/o function reset res input reset flash write enable fwe input flash program/erase protection by hardware mode 0 md0 input sets this lsi operating mode port 12 p12 input sets this lsi operating mode when md0 = 0 port 13 p13 input sets this lsi operating mode when md0 = 0 port 14 p14 input sets this lsi operating mode when md0 = 0 transmit data so1 output serial transmit data output receive data si1 input serial receive data input 8.2.5 register configuration the registers used to control the on-chip flash memory when enabled are shown in table 8.3. in order to access these registers, the flshe bit in stcr must be set to 1. table 8.3 flash memory registers register name abbreviation r/w initial value address * 5 flash memory control register 1 flmcr1 * 4 r/w * 1 h'00 * 2 h'fff8 flash memory control register 2 flmcr2 * 4 r/w * 1 h'00 * 3 h'fff9 erase block register 1 ebr1 * 4 r/w * 1 h'00 * 3 h'fffa erase block register 2 ebr2 * 4 r/w * 1 h'00 * 3 h'fffb serial/timer control register stcr r/w h'00 h'ffee notes: 1. when the fwe bit in flmcr1 is not set at 1, writes are disabled. 2. when a high level is input to the fwe pin, the initial value is h'80. 3. when a low level is input to the fwe pin, or if a high level is input and the swe bit in flmcr1 is not set, these registers are initialized to h'00. 4. flmcr1, flmcr2, ebr1, and ebr2 are 8-bit registers. only byte accesses are valid for these registers, the access requiring 2 states. 5. lower 16 bits of the address. section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 179 of 1038 rej09b0328-0300 8.3 flash memory register descriptions 8.3.1 flash memory control register 1 (flmcr1) 7 fwe ? * r 6 swe 0 r/w 5 esu1 0 r/w 4 psu1 0 r/w 3 ev1 0 r/w 0 p1 0 r/w 2 pv1 0 r/w 1 e1 0 r/w bit initial value r/w : : : note: * determined by the state of the fwe pin. flmcr1 is an 8-bit register used for flash memory operating mode control. program-verify mode or erase-verify mode for addresses h'00000 to h'1ffff is entered by setting swe to 1 while fwe is 1 and then setting the ev1 bit or pv1 bit. program mode for addresses h'00000 to h'1ffff is entered by setting swe to 1 while fwe is 1, then setting the psu1 bit, and finally setting the p1 bit. erase mode for addresses h'00000 to h'1ffff is entered by setting swe to 1 while fwe is 1, then setting the esu1 bit, and fi nally setting the e1 bit. flmcr1 is initialized by a reset, in power-down state (excluding the medium-speed mode, module stop mode, and sleep mode), or when a low level is input to the fwe pin. when a high level is input to the fwe pin, its initial value is h'80 and when a low leve l is input, its initial value is h'00. writes to the swe, esu1, psu1, ev1, and pv1 bits in flmcr1 are enabled only when fwe = 1 and swe = 1; writes to the e1 bit only when fwe = 1, swe = 1, and esu1 = 1; and writes to the p1 bit only when fwe = 1, swe = 1, and psu1 = 1. bit 7 ? flash write enable (fwe): sets hardware protection against flash memory programming/erasing. bit 7 fwe description 0 when a low level is input to the fwe pin (hardware-protected state) 1 when a high level is input to the fwe pin section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 180 of 1038 rej09b0328-0300 bit 6 ? software write enable (swe): enables or disables flash memory programming. swe should be set before setting bits 5 to 0, bits 5 to 0 in flmcr2, bits 5 to 0 in ebr1 and bits 7 to 0 in ebr2. bit 6 swe description 0 writes are disabled (initial value) 1 writes are enabled [setting condition] setting is available when fwe = 1 is selected bit 5 ? erase-setup bit 1 (esu1): prepares erase-mode transition for addresses h'00000 to h'1ffff. set esu1 to 1 before setting the e1 bit to 1. do not set the swe, psu1, ev1, pv1, e1, or p1 bit at the same time. bit 5 esu1 description 0 erase-setup cleared (initial value) 1 erase-setup [setting condition] when fwe = 1 and swe = 1 bit 4 ? program-setup bit 1 (psu1): prepares erase-mode transition for addresses h'00000 to h'1ffff. set psu1 to 1 before setting the p1 bit to 1. do not set the swe, esu1, ev1, pv1, e1, or p1 bit at the same time. bit 4 psu1 description 0 program-setup cleared (initial value) 1 program-setup [setting condition] when fwe = 1 and swe = 1 section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 181 of 1038 rej09b0328-0300 bit 3 ? erase-verify (ev1): selects erase-verify mode transition or clearing. do not set the swe, esu1, psu1, pv1, e1, or p1 bit at the same time. bit 3 ev1 description 0 erase-verify mode cleared (initial value) 1 transition to erase-verify mode [setting condition] setting is available when fwe = 1 and swe = 1 are selected bit 2 ? program-verify (pv1) selects program-verify mode transition or clearing. do not set the swe, esu1, psu1, ev1, e1, or p1 bit at the same time. bit 2 pv1 description 0 program-verify mode cleared (initial value) 1 transition to program-verify mode [setting condition] setting is available when fwe = 1 and swe = 1 are selected bit 1 ? erase (e1): selects erase mode transition or clearin g. do not set the swe, esu1, psu1, ev1, pv1, or p1 bit at the same time. bit 1 e1 description 0 erase mode cleared (initial value) 1 transition to erase mode [setting condition] setting is available when fwe = 1, swe = 1, and esu = 1 are selected section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 182 of 1038 rej09b0328-0300 bit 0 ? program (p1): selects program mode transition or clearing. do not set the swe, psu1, esu1, ev1, pv1, or e1 bit at the same time. bit 0 p1 description 0 program mode cleared (initial value) 1 transition to program mode [setting condition] setting is available when fwe = 1, swe = 1, and psu = 1 are selected section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 183 of 1038 rej09b0328-0300 8.3.2 flash memory control register 2 (flmcr2) 7 fler 0 r 6 ? 0 ? 5 esu2 0 r/w 4 psu2 0 r/w 3 ev2 0 r/w 0 p2 0 r/w 2 pv2 0 r/w 1 e2 0 r/w bit initial value r/w : : : flmcr2 is an 8-bit register used for flash memory operating mode control. program-verify mode or erase-verify mode for addresses h'20000 to h'3ffff is entered by setting swe in flmcr1 to 1 while fwe in flmcr1 is 1 and then setting the ev2 bit or pv2 bit. program mode for addresses h'20000 to h' 3ffff is entered by setting swe in flmcr1 to 1 while fwe in flmcr1 is 1, then setting the psu2 bit, and finally setting the p2 bit. erase mode for addresses h'20000 to h'3ffff is entered by setting swe in flmcr1 to 1 while fwe in flmcr1 is 1, then setting the esu2 bit, and finally setting the e2 bit. flmcr2 is initialized to h'00 by a reset, in power-down state (excluding the medium-speed mode, module stop mode, and sleep mode), when a low level is input to the fwe pin, or when a high level is input to the fwe pin and the swe bit in flmcr1 is not set. however, fler is initialized only by a reset. writes to the esu2, psu2, ev2, and pv2 bits in flmcr2 are enabled only when fwe in flmcr1 = 1 and swe in flmcr1 = 1; writes to the e2 bit only when fwe in flmcr1 = 1, swe in flmcr1 = 1, and esu2 = 1; and writes to the p2 bit only when fwe in flmcr1 = 1, swe in flmcr1 = 1, and psu2 = 1. bit 7 ? flash memory error (fler): indicates that an error has occurred during an operation on flash memory (programming or erasing). when fler is set to 1, flash memory goes to the error- protection state. bit 7 fler description 0 flash memory is operating normally flash memory program/erase protection (error protection) is disabled [clearing condition] reset or hardware standby mode (initial value) 1 an error has occurred during flash memory programming/erasing flash memory program/erase protection (error protection) is enabled [setting condition] see section 8.6.3, error protection bit 6 ? reserved: this bit cannot be modified and is always read as 0. section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 184 of 1038 rej09b0328-0300 bit 5 ? erase-setup bit 2 (esu2): prepares erase-mode transition for addresses h'20000 to h'3ffff. set esu2 to 1 before setting the e2 bit to 1. do not set the psu2, ev2, pv2, e2, or p2 bit at the same time. bit 5 esu2 description 0 erase-setup cleared (initial value) 1 erase-setup [setting condition] when fwe = 1 and swe = 1 bit 4 ? program-setup bit 2 (psu2): prepares erase-mode transition for addresses h'20000 to h'3ffff. set psu2 to 1 before setting the p2 bit to 1. do not set the esu2, ev2, pv2, e2, or p2 bit at the same time. bit 4 psu2 description 0 program-setup cleared (initial value) 1 program-setup [setting condition] when fwe = 1 and swe = 1 bit 3 ? erase-verify 2 (ev2): selects erase-verify mode tran sition or clearing for addresses h'20000 to h'3ffff. do not set the esu2, psu2, pv2, e2, or p2 bit at the same time. bit 3 ev2 description 0 erase-verify mode cleared (initial value) 1 transition to erase-verify mode [setting condition] when fwe = 1 and swe = 1 section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 185 of 1038 rej09b0328-0300 bit 2 ? program-verify 2 (pv2): selects program-verify mode transition or clearing for addresses h'20000 to h' 3ffff. do not set the esu2, psu2, ev2, e2, or p2 bit at the same time. bit 2 pv2 description 0 program-verify mode cleared (initial value) 1 transition to program-verify mode [setting condition] when fwe = 1 and swe = 1 bit 1 ? erase 2 (e2): selects erase mode transition or cl earing for addresse s h'20000 to h'3ffff. do not set the esu2, psu2, ev2, pv2, or p2 bit at the same time. bit 1 e2 description 0 erase mode cleared (initial value) 1 transition to erase mode [setting condition] when fwe = 1, swe = 1, and esu2 = 1 bit 0 ? program 2 (p2) selects program-mode transition or clearing for addresses h'2000 0 to h'3ffff. do not set the esu2, psu2, ev2, pv2, or e2 bit at the same time. bit 0 p2 description 0 program-mode cleared (initial value) 1 transition to program-mode [setting condition] when fwe = 1, swe = 1, and psu2 = 1 section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 186 of 1038 rej09b0328-0300 8.3.3 erase block registers 1 (ebr1) 7 ? 0 ? 6 ? 0 ? 5 eb13 0 r/w 4 eb12 0 r/w 3 eb11 0 r/w 0 eb8 0 r/w 2 eb10 0 r/w 1 eb9 0 r/w bit ebr1 initial value r/w : : : : ebr1 is a register that specifies the flash memory erase area block by block. ebr1 is initialized to h'00 by a reset, in power-down state (excluding the medium-speed mode, module stop mode, and sleep mode), when a low level is input to the fwe pin, or when a high level is input to the fwe pin and the swe bit in flmcr1 is not set. when a bit in ebr1 is set, the corresponding block can be erased. other blocks are erase-protected. set only one bit in ebr1 or ebr2 (more than one bit cannot be set). the flash memory block configuration is shown in table 8.3. 8.3.4 erase block registers 2 (ebr2) 7 eb7 0 r/w 6 eb6 0 r/w 5 eb5 0 r/w 4 eb4 0 r/w 3 eb3 0 r/w 0 eb0 0 r/w 2 eb2 0 r/w 1 eb1 0 r/w bit ebr2 initial value r/w : : : : ebr2 is a register that specifies the flash memory erase area block by block. ebr2 is initialized to h'00 by a reset, in power-down state (excluding the medium-speed mode, module stop mode, and sleep mode), when a low level is input to the fwe pin, or when a high level is input to the fwe pin and the swe bit in flmcr1 is not set. when a bit in ebr2 is set, the corresponding block can be erased. other blocks are erase-protected. set only one bit in ebr1 or ebr2 (more than one bit cannot be set). the flash memory block configuration is shown in table 8.4. section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 187 of 1038 rej09b0328-0300 table 8.4 flash memory erase blocks block (size) 128-kbyte versions address eb0 (1 kbyte) h'000000 to h'0003ff eb1 (1 kbyte) h'000400 to h'0007ff eb2 (1 kbyte) h'000800 to h'000bff eb3 (1 kbyte) h'000c00 to h'000fff eb4 (28 kbytes) h'001000 to h'007fff eb5 (16 kbytes) h'008000 to h'00bfff eb6 (8 kbytes) h'00c000 to h'00dfff eb7 (8 kbytes) h'00e000 to h'00ffff eb8 (32 kbytes) h'010000 to h'017fff eb9 (32 kbytes) h'018000 to h'01ffff eb10 (32 kbytes) h'020000 to h'027fff eb11 (32 kbytes) h'028000 to h'02ffff eb12 (32 kbytes) h'030000 to h'037fff eb13 (32 kbytes) h'038000 to h'03ffff 8.3.5 serial/timer control register (stcr) 7 ? 0 ? 6 iicx 0 r/w 5 iicrst 0 r/w 4 ? 0 ? 3 flshe 0 r/w 0 ? 0 ? 2 ? 0 ? 1 ? 0 ? bit initial value r/w : : : stcr is an 8-bit readable/writable regist er that controls register access, the i 2 c bus interface operating mode, and on-chip flash memory (in f-ztat versions), and also selects the i 2 c bus interface serial clock frequency. for details on func tions not related to on-chip flash memory, see section 25.2.7, serial/timer control register (stcr), and descriptions of individual modules. if a module controlled by stcr is not used, do not write 1 to the corresponding bit. stcr is initialized to h'00 by a reset. bits 6 and 5 ? i 2 c control (iicx, iicrst): these bits control the operation of the i 2 c bus interface. for details, see section 25, i 2 c bus interface (iic). section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 188 of 1038 rej09b0328-0300 bit 3 ? flash memory control re gister enable (flshe): setting the flshe bit to 1 enables read/write access to the flash memo ry control registers. if flsh e is cleared to 0, the flash memory control registers are desel ected. in this case, the flash me mory control register contents are retained. bit 3 flshe description 0 flash memory control registers deselected (initial value) 1 flash memory control registers selected bits 7, 4 and 2 to 0 ? reserved 8.4 on-board programming modes when pins are set to on-board programming mode, program/erase/verify operations can be performed on the on-chip flash memory. there are two on-board programming modes: boot mode and user program mode. the pin settings for transition to each of these modes are shown in table 8.5. for a diagram of the transitions to the various flash memory modes, see figure 8.3. table 8.5 setting on-board programming modes mode pin mode name fwe md0 p12 p13 p14 boot mode 1 0 1 * 2 1 * 2 1 * 2 user program mode 1 * 1 1 ? ? ? notes: 1. in user program mode, the fwe pin should not be constantly set to 1. set fwe to 1 to make a transition to user program mode before performing a program/erase/verify operation. 2. can be used as i/o ports after boot mode is initiated. section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 189 of 1038 rej09b0328-0300 8.4.1 boot mode when boot mode is used, the flash memory programming control program must be prepared in the host beforehand. the channel 1 sci to be used is set to asynchronous mode. when a reset-start is executed after the mcu's pins have been set to boot mode, the boot program built into the mcu is started and the programming control program prepared in the host is serially transmitted to the mcu via the sci1. in the mcu, the programming control program received via the sci1 is written into the programming control program area in on-chip ram. after the transfer is completed, control branches to the start address of the programming control program area and the programming control program execution state is entered (flash memory programming is performed). the transferred programming control program must therefore include coding that follows the programming algorithm given later. the system configuration in boot mode is shown in figure 8.7, and the boot program mode execution procedure in figure 8.8. si1 so1 sci1 this lsi flash memory write data reception verify data transmission host on-chip ram figure 8.7 system configuration in boot mode section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 190 of 1038 rej09b0328-0300 start set pins to boot mode and execute reset-start host transfers data (h'00) continuously at prescribed bit rate host transmits programming control program sequentially in byte units transfer received programming control program to on-chip ram this lsi calculates bit rate and sets value in bit rate register host transmits number of programming control program bytes (n), upper byte followed by lower byte this lsi transmits received programming control program to host as verify data (echo-back) n = 1 end of transmission n = n? n + 1 n yes no this lsi measures low period of h'00 data transmitted by host after bit rate adjustment, transmits one h'00 data byte to host to indicate end of adjustment upon receiving h'55, this lsi transmits one h'aa data byte to host host confirms normal reception of bit rate adjustment end indication (h'00) and transmits one h'55 data byte execute programming control program transferred to on-chip ram this lsi transmits received number of bytes to host as verify data (echo-back) note : if a memory cell does not operate normally and cannot be erased, one h'ff byte is transmitted as an erase error, and the erase operation and subsequent operations are halted. after confirming that all flash memory data has been erased, this lsi transmits one h'aa data byte to host check flash memory data, and if data has already been written, erase all blocks figure 8.8 boot mode execution procedure section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 191 of 1038 rej09b0328-0300 (1) automatic sci bit rate adjustment start bit stop bit d0 d1 d2 d3 d4 d5 d6 d7 low period (9 bits) measured (h'00 data) high period (1 or more bits) figure 8.9 automatic sci bit rate adjustment when boot mode is initiated, the mcu measures the low period of the asynchronous sci communication data (h'00) transmitted continuo usly from the host. the sci transmit/receive format should be set as follows: 8-bit data, 1 stop bit, no parity. the mcu calculates the bit rate of the transmission from the host from the measured low period, and transmits one h'00 byte to the host to indicate the end of bit rate adjustment. the host should confirm that this adjustment end indication (h'00) has been received normally, and transmit one h'55 byte to the mcu. if reception cannot be performed normally, initiate boot mode again (reset), and repeat the above operations. depending on the host's transmission bit rate and the mcu's system clock frequency, there will be a discrepancy between the bit rates of the host and the mcu. to ensure correct sci operation, the host's transfer bit rate should be set to (4800 or 9600) bps. table 8.6 shows typical host transfer bit rates and system clock frequencies for which automatic adjustment of the mcu's bit rate is possible. the boot program should be executed within this system clock range. table 8.6 system clock frequencies for which automatic adjustment of this lsi bit rate is possible host bit rate system clock frequency for which automatic adjustment of this lsi bit rate is possible 9600 bps 8 mhz to 10 mhz 4800 bps 4 mhz to 10 mhz section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 192 of 1038 rej09b0328-0300 (2) on-chip ram area divisions in boot mode in boot mode, the ram area is divided into; the area for use by the boot program and the area to which programming control program is transferred by the sci, as shown in figure 8.10. the boot program area cannot be used until a transition is made to the execution state in boot mode for the programming control program transferred to ram. h'ffe7b0 h'fff3af programming control program area (2944 bytes) reserved area (128 bytes) h'ffffaf h'ffff2f boot program area * (3 kbytes) note: * the boot program area cannot be used until a transition is made to the execution state for the programming control program transferred to ram. note that the boot program reamins stored in this area after a branch is made to the programming control program. figure 8.10 ram areas in boot mode (3) notes on use of boot mode: (a) when reset is released in boot mode, it measures the low period of the input at the sci1?s si1 pin. the reset should end with si1 pin high. after the reset ends, it takes about 100 states for the chip to get ready to measure the low period of the si1 pin input. (b) in boot mode, if any data has been programmed into the flash memory (if all data is not 1), all flash memory blocks are erased. boot mode is for use when user program mode is unavailable, such as the first time on-board programming is performed, or if the program activated in user program m ode is accidentally erased. (c) interrupts cannot be used while the flash memory is being programmed or erased. (d) the si1 and so1 pins should be pulled up on the board. section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 193 of 1038 rej09b0328-0300 (e) before branching to the programming control program (ram area h'fff3b0), the chip terminates transmit and receive operations by the on-chip sci (channel 1) (by clearing the re and te bits in scr to 0), but the adjusted bit rate value remains set in brr. the transmit data output pin, so1, goes to the high-level output state (p21pcr = 1, p21pdr = 1). the contents of the cpu's internal general re gisters are undefined at this time, so these registers must be initialized immediately after branching to the programming control program. in particular, since the stack pointer (sp) is used implicitly in subroutine calls, etc., a stack area must be specified for use by the programming control program. the initial values of other on-chip registers are not changed. (f) boot mode can be entered by making the pin settings shown in table 8.6 and executing a reset-start. when the chip detects the boot mode setting at reset release * 1 , it retains that state internally. boot mode can be cleared by driving the reset pin low, waiting at least 20 states, then setting the fwe pin and mode pins, and executing reset release * 1 . boot mode can also be cleared by a wdt overflow reset. if the mode pin input levels are changed in boot mode, the boot mode state will be maintained in the microcomputer, and boot mode continued, unless a reset occurs. however, the fwe pin must not be driven low while the boot program is running or flash memory is being programmed or erased * 2 . notes: 1. mode pin and fwe pin input must satisfy the mode programming setup time (t mds = 4 states) with respect to the reset release timing. 2. for further information on fwe applicati on and disconnection, see section 8.9, flash memory programming and erasing precautions. 8.4.2 user program mode when set to user program mode, the chip can pr ogram and erase its flash memory by executing a user program/erase control program. therefore, on-board reprogramming of the on-chip flash memory can be carried out by providing on-board means of fwe control and supply of programming data, and storing a program/erase control program in part of the program area as necessary. in this mode, the chip starts up in mode 1 and applies a high level to the fwe pin. the flash memory itself cannot be read while the swe bit is set to 1 to perform programming or erasing, so the control program that performs programming and erasing should be run in on-chip ram or external memory. figure 8.11 shows the procedure for executin g the program/erase control program when transferred to on-chip ram. section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 194 of 1038 rej09b0328-0300 clear fwe * fwe = high * branch to flash memory application program branch to program/erase control program in ram area execute program/erase control program (flash memory rewriting) transfer program/erase control program to ram md0 = 1 reset start write the fwe assessment program and transfer program (and the program/erase control program if necessary) beforehand notes: do not apply a constant high level to the fwe pin. apply a high level to the fwe pin only when the flash memory is programmed or erased. also, while a high level is applied to the fwe pin, the watchdog timer should be activated to prevent overprogramming or overerasing due to program runaway, etc. * for further information on fwe application and disconnection, see section 8.9, flash memory programming and erasing precautions. figure 8.11 user program mode execution procedure (preliminary) section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 195 of 1038 rej09b0328-0300 8.5 programming/erasing flash memory in the on-board programming modes, flash memory programming and erasing is performed by software, using the cpu. there are four flash memory operating modes: program mode, erase mode, program-verify mode, and erase-veri fy mode. for addre sses h'00000 to h'1ffff, transitions to these modes can be made by setting the psu1, esu1, p1, e1, pv1 and ev1 bits in flmcr1 and for addresses h'2000 0 to h'3ffff, trans itions to these modes can be made by setting the psu2, esu2, p2, e2, pv 2, and ev2 bits in flmcr2. the flash memory cannot be read while being prog rammed or erased. therefore, the program that controls flash memory programming/erasing (the programming control program) should be located and executed in on-chip ram or external memory. notes: 1. operation is not guaranteed if setting/resetting of the swe, esu1, psu1, ev1, pv1, e1, and p1 bits in flmcr1 , and the esu2, psu2, ev2, pv2, e2 and p2 bits in flmcr2, is executed by a program in flash memory. 2. when programming or erasing, set fwe to 1 (programming/erasing will not be executed if fwe = 0). 3. perform programming in the erased state. do not perform additional programming on previously programmed addresses. do not program addresses h'00000 to h'1 ffff and h'20000 to h'3ffff at the same time. operation is not guaranteed if both areas are programmed at the same time. 8.5.1 program mode (n = 1 for addresses h'00000 to h'1ffff and n = 2 for addresses h'20000 to h'3ffff) follow the procedure shown in the program/program-verify flowchart in figure 8.12 to write data or programs to flash memory. performing prog ram operations according to this flowchart will enable data or programs to be written to flash memory without subjecting the device to voltage stress or sacrificing program data reliability. programming should be carri ed out 32 bytes at a time. table 29.12 lists wait time (x, y, z, , , , , and ) after setting or clearing each bit on the flash memory control registers 1 and 2 (flmcr1 and flmcr2) and the maximum write count (n). following the elapse of (x) s or more after the swe bit is set to 1 in flash memory control register 1 (flmcr1), 32-byte program data is stored in the program data area and reprogram data area, and the 32-byte data in the reprogram data area written consecutively to the write addresses. the lower 8 bits of the first address written to must be h'00, h'20, h'40, h'60, h'80, h'a0, h'c0, or h'e0. thirty-two consecutive byte data transfers are performed. the program address and program data are latched in the flash memory. a 32-byte data transfer must be performed even if writing fewer than 32 bytes; in this case, h'ff data must be written to the extra addresses. next, the watchdog timer is set to prevent overprogramming in the event of program runaway, etc. section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 196 of 1038 rej09b0328-0300 set more than (y + z + + ) s as the wdt overflow period. after this, preparation for program mode (program setup) is carried out by setting the psun bit in flmcrn, and after the elapse of (y) s or more, the operating mode is switched to program mode by setting the pn bit in flmcrn. the time during which the pn bit is set is the flash memory programming time. make a program setting so that the time for one programming operation is within the range of (z) s. 8.5.2 program-verify mode (n = 1 for addresses h'00000 to h'1ffff and n = 2 for addresses h'20000 to h'3ffff) in program-verify mode, the data written in program mode is read to check whether it has been correctly written in the flash memory. after the elapse of a given programming time, the programming mode is exited (the pn bit in flmcrn is cleared, then the psun bit in flmcrn is cleared at least ( ) s later). the watchdog timer is cleared afte r the elapse of ( ) s or more, and the operating mode is switched to program- verify mode by setting the pvn bit in flmcrn. before reading in program-verify mode, a dummy write of h'ff data should be made to the addresses to be read. the dummy write should be executed after the elapse of ( ) s or more. when the flash memory is read in this state (verify data is read in 16-bit units), the data at the latched address is read. wait at least ( ) s after the dummy write before performing this read operation. next, the originally written data is compared with the verify data, and reprogram data is computed (see figure 8.12) and transferred to the reprogram data area. after 32 bytes of data have been verified, exit program-verify mode, wait for at least ( ) s, then clear the swe bit in flmcr1. if reprogramming is necessary, set program mode again, and repeat the program/program-verify sequen ce as before. however, ensure that the program/program-verify sequence is not repeat ed more than (n) times on the same bits. section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 197 of 1038 rej09b0328-0300 start end of programming programming failure set swe bit in flmcr1 wait (x) s store 32-byte program data in program data area and reprogram data area n = 1 m = 0 enable wdt set psu bit in flmcr1 or flmcr2 wait (y) s set p bit in flmcr1 or flmcr2 wait (z) s start of programming clear p bit in flmcr1 or flmcr2 wait ( ) s wait ( ) s no no no no yes yes yes wait ( ) s wait ( ) s * 5 * 3 * 2 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 4 * 1 * 5 wait ( ) s clear psu bit in flmcr1 or flmcr2 disable wdt set pv bit in flmcr1 or flmcr2 h'ff dummy write to verify address read verify data reprogram data computation * 4 transfer reprogram data to reprogram data area clear pv bit in flmcr1 or flmcr2 clear swe bit in flmcr1 m = 1 end of programming program data = verify data? end of 32-byte data verification? m = 0? increment address yes clear swe bit in flmcr1 n n? n n + 1 notes: program data 0 0 1 1 verify data 0 1 0 1 reprogram data 1 0 1 1 comments do not reprogram bits for which programming has been completed. programming incomplete; reprogramming should be performed. ? still in erased state; no action 1. 2. 3. 4. 5. write 32-byte data in ram reprogram data area consecutively to flash memory programming must be excuted in the erased state. do not perform additional programming on addresses that have already been programmed. ram program data storage area (32 bytes) reprogram data storage area (32 bytes) data transfer is performed by byte transfer. the lower 8 bits of the first address written to must be h'00, h'20, h'40, h'60, h'80, h'a0, h'c0, or h'e0. a 32-byte data transfer must be performed even if writing fewer than 32 bytes; in this case, h'ff data must be written to the extra addresses. verify data is read in 16-bit (word) units. even in case of the bit which is already-programmed in the 32-byte programming loop, perform additional programming if the bit fails at the next verify. an area for storing program data (32 bytes) and reprogram data (32 bytes) must be provided in ram. the contents of the latter are rewritten as programming progresses. the values of x, y, z, , , , , , and n are listed in section 29.2.7, flash memory characteristics. figure 8.12 program/program-verify flowchart section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 198 of 1038 rej09b0328-0300 8.5.3 erase mode (n = 1 for addresses h'00000 to h'1ffff and n = 2 for addresses h'20000 to h'3ffff) flash memory erasing should be performed block by block following the procedure shown in the erase/erase-verify flowchart (single- block erase) shown in figure 8.13. table 29.12 lists wait time (x, y, z, , , , , and ) after setting or clearing each bit on the flash memory control registers 1 and 2 (flmcr1 and flmcr2) and the maximum clearing count (n). to perform data or program erasure, make a 1 bit setting for the flash memory area to be erased in erase block register 1 or 2 (ebr1 or ebr2) at least (x) s after setting the swe bit to 1 in flash memory control register 1 (flmcr1). next, the watchdog timer is set to prevent overerasing in the event of program runaway, etc. set more than (y + z + + ) ms as the wdt overflow period. after this, preparation for erase mode (erase setup) is carried out by setting the esun bit in flmcrn, and after the elapse of (y) s or more, the operating mode is switched to erase mode by setting the en bit in flmcrn. the time during which the en bit is set is the flash memory erase time. ensure that the erase time does not exceed (z) ms. note: with flash memory erasing, preprogramming (setting all data in the memory to be erased to 0) is not necessary before starting the erase procedure. 8.5.4 erase-verify mode (n = 1 for addresses h'00000 to h'1ffff and n = 2 for addresses h'20000 to h'3ffff) in erase-verify mode, data is read after memory has been erased to ch eck whether it has been correctly erased. after the elapse of the erase time, erase mode is exited (the en b it in flmcrn is cleared, then the esu bit in flmcr2 is cleared at least ( ) s later), the watchdog timer is cleared after the elapse of ( ) s or more, and the operating mode is switched to erase-verify mode by setting the evn bit in flmcrn. before reading in erase-verify mode, a dummy write of h'ff data should be made to the addresses to be read. the dummy write should be executed after the elapse of ( ) s or more. when the flash memory is read in this state (verify data is read in 16-bit units), the data at the latched address is read. wait at least ( ) s after the dummy write before performing this read operation. if the read data has been erased (all 1), a dummy write is performed to the next address, and erase-verify is performed. if the read data has not been erased, set erase mode again, and repeat the erase/erase-verify sequence in the sa me way. however, ensure that the erase/erase- verify sequence is not repeated more than (n) times. when verification is completed, exit erase- verify mode, and wait for at least ( ) s. if erasure has been comple ted on all the erase blocks, clear the swe bit in flmcr1. if there are any unerased blocks, make a 1 bit setting in ebr1 or ebr2 for the flash memory area to be erased, a nd repeat the erase/erase-verify sequence in the same way. section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 199 of 1038 rej09b0328-0300 end of erasing start set swe bit in flmcr1 set esu bit in flmcr1 or flmcr2 set e bit in flmcr1 or flmcr2 wait (x) s wait (y) s n = 1 set ebr1, ebr2 enable wdt * 2 * 4 * 2 wait (z) ms * 2 wait ( ) s * 2 wait ( ) s * 2 wait ( ) s set block start address to verify address * 2 wait ( ) s * 2 wait ( ) s * 2 * 2 * 2 * 3 * 5 start of erase clear e bit in flmcr1 or flmcr2 clear esu bit in flmcr1 or flmcr2 set ev bit in flmcr1 or flmcr2 h'ff dummy write to verify address read verify data clear ev bit in flmcr1 or flmcr2 wait ( ) s clear ev bit in flmcr1 or flmcr2 clear swe bit in flmcr1 disable wdt halt erase * 1 verify data = all 1? end of erasing of all erase blocks? erase failure clear swe bit in flmcr1 n n? no no no no yes yes yes yes notes: 1. 2. 3. 4. 5. increment address n n + 1 last address of block? preprogramming (setting erase block data to all 0) is not necessary. the values of x, y, z, , , , , , and n are listed in section 29.2.7, flash memory characteristics. verify data is read in 16-bit (word) units. set only one bit in ebr1 or ebr2. more than one bit cannot be set. erasing is performed in block units. to erase a number of blocks, the individual blocks must be erased sequentially. figure 8.13 erase/erase-verify flowchart (single-block erase) section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 200 of 1038 rej09b0328-0300 8.6 flash memory protection there are three kinds of flash memory program/er ase protection: hardware protection, software protection, and error protection. 8.6.1 hardware protection hardware protection refers to a state in which programming/erasing of flash memory is forcibly disabled or aborted. hardware protection is reset by settings in flash memory control registers 1 and 2 (flmcr1, flmcr2) and erase block registers 1 and 2 (ebr1, ebr2). (see table 8.7.) table 8.7 hardware protection functions item description program erase fwe pin protection ? when a low level is input to the fwe pin, flmcr1, flmcr2, ebr1, and ebr2 are initialized, and the program/erase-protected state is entered yes yes reset/standby protection ? in a reset (including a wdt overflow reset) and in power-down state (excluding the medium-speed mode, module stop mode, and sleep mode), flmcr1, flmcr2 (excluding the fler bit), ebr1, and ebr2 are initialized, and the program/erase- protected state is entered ? in a reset via the res pin, the reset state is not entered unless the res pin is held low until oscillation stabilizes after powering on. in the case of a reset during operation, hold the res pin low for the res pulse width specified in the ac characteristics section yes yes section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 201 of 1038 rej09b0328-0300 8.6.2 software protection software protection can be implemented by setting the swe bit in flmcr1 and erase block registers 1 and 2 (ebr1, ebr2). when software protection is in effect, setting the p1 or e1 bit in flash memory control register 1 (flmcr1), or setting the p2 or e2 bit in flash memory control register 2 (flmcr2) does not cause a transition to program mode or erase mode. (see table 8.8.) table 8.8 software protection functions item description program erase swe bit protection ? clearing the swe bit to 0 in flmcr1 sets the program/erase-protected state for all blocks (execute in on-chip ram or external memory) yes yes block specification protection ? erase protection can be set for individual blocks by settings in erase block registers 1 and 2 (ebr1, ebr2) ? setting ebr1 and ebr2 to h'00 places all blocks in the erase-protected state ? yes section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 202 of 1038 rej09b0328-0300 8.6.3 error protection in error protection, an error is detected when mcu runaway occurs during flash memory programming/erasing, or operati on is not performed in accordance with the program/erase algorithm, and the program/erase operation is aborted. aborting the program/erase operation prevents damage to the flash memory due to overprogramming or overerasing. if the mcu malfunctions during flash memory programming/erasing, the fler bit is set to 1 in flmcr2 and the error protection state is entered. the flmcr1, flmcr2, ebr1, and ebr2 settings are retained, but program mode or erase mode is aborted at the point at which the error occurred. program mode or erase mode cannot be re -entered by re-setting the p1, e1, p2 or e2 bit. however, pv1, ev1, pv2, or ev2 bit setting is enabled, and a transition can be made to verify mode. fler bit setting conditions are as follows: (1) when flash memory is read during programming/erasing (including a vector read or instruction fetch) (2) immediately after exception handling (excluding a reset) during programming/erasing (3) when a sleep instruction is executed during programming/erasing error protection is released only by a reset and in hardware standby mode. figure 8.14 shows the flash memory state transition diagram. section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 203 of 1038 rej09b0328-0300 : memory read not possible : verify-read not possible : programming not possible : erasing not possible rd vf pr er rd vf pr er fler = 0 error occurrence error occurre nce sleep instru ction execution res = 0 res = 0 res = 0 rd vf pr er fler = 0 program mode erase mode reset (hardware protection) rd vf pr er fler = 1 rd vf pr er fler = 1 error protection mode error protection mode (power-down state) * power-down state * flmcr1, flmcr2 (except fler bit), ebr1, ebr2 initialization state flmcr1, flmcr2, ebr1, ebr2 initialization state power-down state * release : memory read possible : verify-read possible : programming possible : erasing possible legend: rd vf pr er note: * watch mode, standby mode, and subactive mode figure 8.14 flash memory state transitions section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 204 of 1038 rej09b0328-0300 8.7 interrupt handling when progr amming/erasing flash memory all interrupts, including nmi input is disabled when flash memory is being programmed or erased (when the pn or en bit is set in flmcrn), and while the boot program is executing in boot mode * 1 , to give priority to the program or eras e operation. there are three reasons for this: (1) interrupt during programming or erasing might cause a violation of the programming or erasing algorithm, with the result that normal operation could not be assured. (2) in the interrupt exception handling sequence during programming or erasing, the vector would not be read correctly * 2 , possibly resulting in mcu runaway. (3) if interrupt occurred during boot program execution, it would not be possible to execute the normal boot mode sequence. for these reasons, in on-board programming mode alone there are conditions for disabling interrupt, as an exception to the general rule. however, this provision does not guarantee normal erasing and programming or mcu operation. all requests, including nmi input, must therefore be disabled inside and outside the mcu during fwe application. interrupt is also disabled in the error-protection state while the pn or en bit remains set in flmcrn. notes: 1. interrupt requests must be disabled inside and outside the mcu until data write by the write control program is complete. 2. the vector may not be read correctly in this case for the following two reasons: ? if flash memory is read while being programmed or erased (while the pn or en bit is set in flmcrn), correct read data will not be obtained (undetermined values will be returned). ? if the interrupt entry in the interrupt vector table has not been programmed yet, interrupt exception handling will not be executed correctly. section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 205 of 1038 rej09b0328-0300 8.8 flash memory programmer mode 8.8.1 programmer mode setting programs and data can be written and erased in programmer mode as well as in the on-board programming modes. in programmer mode, the on-chip rom can be freely programmed using a prom programmer that supports renesas technology microcomputer device type with 256-kbyte on-chip flash memory. flash memory read mode, auto-program mode, auto-erase mode, and status read mode are supported with these device types. in auto-program mode, auto-erase mode, and status read mode, a status polling procedure is used, and in status read mode, detailed internal signals are output after execution of an auto-program or auto-erase operation. 8.8.2 socket adapt ers and memory map in programmer mode, a socket adapter is mounted on the writer programmer. the socket adapter product codes are listed in table 8.9. figure 8.15 shows the memory map in programmer mode. table 8.9 socket adapter product codes part no. package socket adapter product code HD64F2194c 112-pin qfp me2194eshf1h this lsi h'000000 mcu mode programmmer mode h'03ffff h'00000 h'3ffff on-chip rom area (256 kbytes) figure 8.15 memory map in programmer mode section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 206 of 1038 rej09b0328-0300 8.8.3 programmer mode operation table 8.10 shows how the different operating mo des are set when using programmer mode, and table 8.11 lists the commands used in programmer mode. details of each mode are given below. (1) memory read mode memory read mode supports byte reads. (2) auto-program mode auto-program mode supports programming of 128 byt es at a time. status polling is used to confirm the end of auto-programming. (3) auto-erase mode auto-erase mode supports automatic erasing of the entire flash memory. status polling is used to confirm the end of auto-erasing. (4) status read mode status polling is used for auto-programming and auto-erasing, and normal termination can be confirmed by reading the fo6 signal. in status read mode, error information is output if an error occurs. table 8.10 settings for each opera ting mode in programmer mode pin names mode fwe ce oe we fo0 to fo7 fa0 to fa17 read h or l l l h data output ain output disable h or l l h h hi-z x command write h or l * 3 l h l data input ain * 2 chip disable * 1 h or l h x x hi-z x notes: 1. chip disable is not a standby state; internally, it is an operation state. 2. ain indicates that there is also address input in auto-program mode. 3. for command writes when making a transition to auto-program or auto-erase mode, input a high level to the fwe pin. section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 207 of 1038 rej09b0328-0300 table 8.11 programmer mode commands 1st cycle 2nd cycle command name number of cycles mode address data mode address data memory read mode 1 + n write x h'00 read ra dout auto-program mode 129 write x h'40 write wa din auto-erase mode 2 write x h'20 write x h'20 status read mode 2 write x h'71 write x h'71 notes: 1. in auto-program mode. 129 cycles are r equired for command writing by a simultaneous 128-byte write. 2. in memory read mode, the number of cycles depends on the number of address write cycles (n). 8.8.4 memory read mode (1) after the end of an auto-program, auto-erase, or status read operation, the command wait state is entered. to read memory contents, a trans ition must be made to memory read mode by means of a command write befo re the read is executed. (2) command writes can be performed in memory r ead mode, just as in the command wait state. (3) once memory read mode has been ente red, consecutive reads can be performed. (4) after power-on, memory read mode is entered. table 8.12 ac characteristics in memory read mode (1) (conditions: v cc = 5.0 v 10%, v ss = 0 v, ta = 25 c 5 c) item symbol min max unit command write cycle t nxtc 20 ? s ce hold time t ceh 0 ? ns ce setup time t ces 0 ? ns data hold time t dh 50 ? ns data setup time t ds 50 ? ns write pulse width t wep 70 ? ns we rise time t r ? 30 ns we fall time t f ? 30 ns section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 208 of 1038 rej09b0328-0300 ce address data h'00 oe we command write t wep t ceh t dh t ds t f t r t nxtc note: data is latched on the rising edge of we . t ces memory read mode address stable data figure 8.16 memory read mode timing waveforms after command write table 8.13 ac characteristics when entering another mode from memory read mode (conditions: v cc = 5.0 v 10%, v ss = 0 v, ta = 25 c 5 c) item symbol min max unit command write cycle t nxtc 20 ? s ce hold time t ceh 0 ? ns ce setup time t ces 0 ? ns data hold time t dh 50 ? ns data setup time t ds 50 ? ns write pulse width t wep 70 ? ns we rise time t r ? 30 ns we fall time t f ? 30 ns section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 209 of 1038 rej09b0328-0300 ce address data h'xx oe we xx mode command write t wep t ceh t dh t ds t nxtc note: do not enable we and oe at the same time. t ces address stable data t f t r figure 8.17 timing waveforms when entering another mode from memory read mode table 8.14 ac characteristics in memory read mode (2) (conditions: v cc = 5.0 v 10%, v ss = 0 v, ta = 25 c 5 c) item symbol min max unit access time t acc ? 20 s ce output delay time t ce ? 150 ns oe output delay time t oe ? 150 ns output disable delay time t df ? 100 ns data output hold time t oh 5 ? ns section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 210 of 1038 rej09b0328-0300 ce address data vil vil vih oe we t acc t oh t oh t acc address stable address stable data data figure 8.18 timing waveforms for ce / oe enable state read ce address data vih oe we t ce t acc t oe t oh t oh t df t ce t acc t oe address stable address stable data data t df figure 8.19 timing waveforms for ce / oe clocked read section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 211 of 1038 rej09b0328-0300 8.8.5 auto-program mode (a) in auto-program mode, 128 bytes are programmed simultaneously. this should be carried out by executing 128 consecutive byte transfers. (b) a 128-byte data transfer is necessary even when programming fewer than 128 bytes. in this case, h'ff data must be written to the extra addresses. (c) the lower 8 bits of the transfer address must be h'00 or h'80. if a value other than an effective address is input, processing will switch to a memo ry write operation but a write error will be flagged. (d) memory address transfer is performed in the second cycle (figure 8.20). do not perform transfer after the third cycle. (e) do not perform a command write during a programming operation. (f) perform one auto-programming operation for a 128-byte block for each address. characteristics are not guaranteed for two or more programming operations. (g) confirm normal end of auto-programming by checking fo6. alternatively, status read mode can also be used for this purpose (fo7 status polling uses the auto-program operation end identification pin). (h) the status polling fo6 and fo7 pin information is retained until the next command write. until the next command write is performed, reading is possible by enabling ce and oe . section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 212 of 1038 rej09b0328-0300 table 8.15 ac characteristics in auto-program (conditions: v cc = 5.0 v 10%, v ss = 0 v, ta = 25 c 5 c) item symbol min max unit command write cycle t nxtc 20 ? s ce hold time t ceh 0 ? ns ce setup time t ces 0 ? ns data hold time t dh 50 ? ns data setup time t ds 50 ? ns write pulse width t wep 70 ? ns status polling start time t wsts 1 ? ms status polling access time t spa ? 150 ns address setup time t as 0 ? ns address hold time t ah 60 ? ns memory write time t write 1 3000 ms we rise time t r ? 30 ns we fall time t f ? 30 ns write setup time t pns 100 ? ns write end setup time t pnh 100 ? ns ce fwe address fo7 oe we t nxtc t wsts t spa t nxtc t ces t ds t dh t wep t as t pnh t pns t ah t ceh address stable data transfer 1 byte to 128 bytes fo6 programming wait data data h'40 data fo0 to 5 = 0 t f t r t write (1 to 3,000 ms) programming operation end identification signal programming normal end identification signal figure 8.20 auto-program mode timing waveforms section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 213 of 1038 rej09b0328-0300 8.8.6 auto-erase mode (a) auto-erase mode supports only entire memory erasing. (b) do not perform a command write during auto-erasing. (c) confirm normal end of auto-erasing by checking fo6. alternatively, status read mode can also be used for this purpose (fo7 status polling uses the auto-erase operation end identification pin). (d) the status polling fo6 and fo7 pin information is retained until the next command write. until the next command write is performed, reading is possible by enabling ce and oe . table 8.16 ac characteristics in auto-erase mode (conditions: v cc = 5.0 v 10%, v ss = 0 v, ta = 25 c 5 c) item symbol min max unit command write cycle t nxtc 20 ? s ce hold time t ceh 0 ? ns ce setup time t ces 0 ? ns data hold time t dh 50 ? ns data setup time t ds 50 ? ns write pulse width t wep 70 ? ns status polling start time t ests 1 ? ms status polling access time t spa ? 150 ns memory erase time t erase 100 40000 ms we rise time t r ? 30 ns we fall time t f ? 30 ns erase setup time t ens 100 ? ns erase end setup time t enh 100 ? ns section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 214 of 1038 rej09b0328-0300 ce fwe address fo5 to fo0 fo6 fo7 oe we t erase (100 to 40000 ms) t ests t spa t nxtc t nxtc t ces t ceh t dh cl in dl in t ds t wep t ens fo0 to 5 = 0 h'20 h'20 t enh erase end identification signal erase normal end identification signal t f t r figure 8.21 auto-erase mode timing waveforms 8.8.7 status read mode (1) status read mode is used to identify what type of abnormal end has occurred. use this mode when an abnormal end occurs in auto -program mode or auto-erase mode. (2) the return code is retained until a command write for other than status read mode is performed. section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 215 of 1038 rej09b0328-0300 table 8.17 ac characteristics in status read mode (conditions: v cc = 5.0 v 10%, v ss = 0 v, ta = 25 c 5 c) item symbol min max unit command write cycle t nxtc 20 ? s ce hold time t ceh 0 ? ns ce setup time t ces 0 ? ns data hold time t dh 50 ? ns data setup time t ds 50 ? ns write pulse width t wep 70 ? ns oe output delay time t oe ? 150 ns disable delay time t df ? 100 ns ce output delay time t ce ? 150 ns we rise time t r ? 30 ns we fall time t f ? 30 ns ce address data oe we t ces t nxtc t nxtc t df note: fo2 and fo3 are undefined. t ces t dh t ceh t ds t wep t wep data t dh t ceh t ds t oe t ce t nxtc h'71 h'71 t f t r t f t r figure 8.22 status read mode timing waveforms section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 216 of 1038 rej09b0328-0300 table 8.18 status read mode return commands pin name fo7 fo6 fo5 fo4 fo3 fo2 fo1 fo0 attribute normal end identifica- tion command error program- ming error erase error ? ? program- ming or erase count exceeded effective address error initial value 0 0 0 0 0 0 0 0 indica-tions normal end: 0 abnormal end: 1 command error: 1 otherwise: 0 program- ming error: 1 otherwise: 0 erase error: 1 otherwise: 0 ? ? count exceeded: 1 otherwise: 0 effective address error: 1 otherwise: 0 note: fo2 and fo3 are undefined. 8.8.8 status polling (1) the fo7 status polling flag indicates the operating status in auto-program or auto-erase mode. (2) the fo6 status polling flag indicates a normal or abnormal end in auto-program or auto-erase mode. table 8.19 status polling output truth table pin names internal operation in progress abnormal end ? normal end fo7 0 1 0 1 fo6 0 0 1 1 fo0 to fo5 0 0 0 0 section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 217 of 1038 rej09b0328-0300 8.8.9 programmer mode transition time commands cannot be accepted during the oscillation stabilization period or the programmer mode setup period. after the programmer mode setup time, a transition is made to memory read mode. table 8.20 command wait state transition time specifications item symbol min max unit standby release (oscillation stabilization time) t osc1 10 ? ms programmer mode setup time t bmv 10 ? ms v cc hold time t dwn 0 ? ms v cc res fwe memory read mode command wait state command wait state normal/abnormal end identifica- tion auto-program mode auto-erase mode t osc1 t bmv t dwn note: except in auto-program mode and auto-erase mode, drive the fwe input pin low. don't care don't care figure 8.23 oscillation stabilization time, boot program transfer time, and power supply fall sequence 8.8.10 notes on memory programming (1) when programming addresses which have previously been programmed, carry out auto- erasing before auto-programming. (2) when performing programming using programmer mode on a chip that has been programmed/erased in an on-board programming mode, auto-erasing is recommended before carrying out auto-programming. notes: 1. the flash memory is initially in the erased state when the device is shipped by renesas. for other chips for which the erasure history is unknown, it is recommended that auto- erasing be executed to check and suppl ement the initialization (erase) level. 2. auto-programming should be performe d once only on the same address block. section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 218 of 1038 rej09b0328-0300 8.9 flash memory programming and erasing precautions precautions concerning the use of on-board programming mode and programmer mode are summarized below. (1) use the specified voltages and timing for programming and erasing applied voltages in excess of the rating can permanently damage the device. use a prom programmer that supports renesas technology microcomputer device type with 256-kbyte on- chip flash memory. do not select the hn28f101 setting for the prom programmer, and only use the specified socket adapter. incorrect use will result in damaging the device. (2) powering on and off do not apply a high level to the fwe pin until v cc has stabilized. also, drive the fwe pin low before turning off v cc . when applying or disconnecting v cc , fix the fwe pin low and place the flash memory in the hardware protection state. the power-on and power-off timing requirements should also be satisfied in the event of a power failure and subsequent recovery. (3) fwe application/disconnection fwe application should be carr ied out when mcu operation is in a stable condition. if mcu operation is not stable, fix the fwe pin low and set the protection state. the following points must be observed concerning fwe application and disconnection to prevent unintentional programming or erasing of flash memory: (a) apply fwe when the v cc voltage has stabilized within its rated voltage range. (b) in boot mode, apply and disconnect fwe during a reset. (c) in user program mode, fwe can be switched between high and low level regardless of the reset state. fwe input can also be switched during program execution in flash memory. (d) do not apply fwe if program runaway has occurred. (e) disconnect fwe only when the swe, esu1, esu2, psu1, psu2, ev1, ev2, pv1, pv2, p1, p2, e1, and e2 bits in fl mcr1 and flmcr2 are cleared. make sure that the swe, esu1, esu2, psu1, psu2, ev1, ev2, pv1, pv2, p1, p2, e1, and e2 bits are not set by mistake when applying or disconnecting fwe. (4) do not apply a constant high level to the fwe pin apply a high level to the fwe pin only when programming or erasing flash memory. a system configuration in which a high level is constantly applied to the fwe should be avoided. also, while a high level is applied to the fwe pin, the watchdog timer should be activated to prevent overprogramming or overerasi ng due to program runaway, etc. section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 219 of 1038 rej09b0328-0300 (5) use the recommended algorithm when programming and erasing flash memory the recommended algorithm enables programming and erasing to be carried out without subjecting the device to voltage stress or sacrificing program data reliability. when setting the pn or en bit in flmcr1 and flmcr2, the watchdog timer should be set beforehand as a precaution against program runaway, etc. (6) do not set or clear the swe bit during program execution in flash memory clear the swe bit before executing a program or reading data in flash memory. when the swe bit is set, data in flash memory can be rewritten, but flash memory should only be accessed for verify operations (ver ification during pr ogramming/erasing). (7) do not use interrupts while flash memory is being programmed or erased all interrupt requests, including nmi, should be disabled during fwe application to give priority to program/erase operations. (8) do not perform additional programming. erase the memory before reprogramming. in on-board programming, perform only one programming operation on a 32-byte programming unit block. in programmer mode, too, perform only one programming operation on a 128-byte programming unit block. programming should be carried out with the entire programming unit block erased. (9) before programming, check that the chip is correctly mounted in the prom programmer. overcurrent damage to the device can result if the index marks on the prom programmer socket, socket adapter, and ch ip are not correctly aligned. (10)do not touch the socket adapter or chip during programming. touching either of these can cause contact faults and write errors. section 8 rom (h8s/2194c group) rev.3.00 jan. 10, 2007 page 220 of 1038 rej09b0328-0300 8.10 note on switching from f-zta t version to mask rom version the mask rom version does not have the internal registers for flash memory control that are provided in the f-ztat version. table 8.21 lists the registers that are present in the f-ztat version but not in the mask rom version. if a register listed in table 8.21 is read in the mask rom version, an undefined value will be returned. therefore, if application software developed on the f-ztat version is switched to a mask rom version product, it must be modified to ensure that the registers in table 8.21 have no effect. table 8.21 registers present in f-ztat version but absent in mask rom version register abbreviation address flash memory control register 1 flmcr1 h'fff8 flash memory control register 2 flmcr2 h'fff9 erase block register 1 ebr1 h'fffa erase block register 2 ebr2 h'fffb section 9 ram rev.3.00 jan. 10, 2007 page 221 of 1038 rej09b0328-0300 section 9 ram 9.1 overview the h8s/2194c, h8s/2194b, and h8s/2194a have 6 kbytes, and the h8s/2194, h8s/2193, h8s/2192, and h8s/2191 have 3 kbytes, of on-chip high-speed static ram. the on-chip ram is connected to the cpu by a 16-bit data bus, enabling both byte data and word data to be accessed in one state. this makes it possible to perform fast word data transfer. 9.1.1 block diagram figure 9.1 shows a block diagram of the on-chip ram. internal data bus (upper 8 bits) internal data bus (lower 8 bits) h'fff3b0 h'fff3b2 h'fff3b4 h'ffffae h'fff3b1 h'fff3b3 h'fff3b5 h'ffffaf figure 9.1 block diagram of ram (h8s/2194) section 9 ram rev.3.00 jan. 10, 2007 page 222 of 1038 rej09b0328-0300 section 10 clock pulse generator rev.3.00 jan. 10, 2007 page 223 of 1038 rej09b0328-0300 section 10 clock pulse generator 10.1 overview this lsi has a built-in clock pulse generator (cpg) that generates the system clock ( ), the bus master clock, and internal clocks. the clock pulse generator consists of a system clock oscillator, a duty adjustment circuit, clock selection circuit, medium-speed clock divider, subclock oscillator, and subclock division circuit. 10.1.1 block diagram figure 10.1 shows a block diagram of the clock pulse generator. system clock oscillator duty adjustment circuit clock selection circuit medium- speed clock divider subclock oscillator subclock division circuit osc1 osc2 x1 x2 /16, /32, /64 w/2, w/4, w/8 sub or sub timer a count clock internal clock to supporting modules bus master cloc k to cpu sub ( w/2, w/4, w/8) figure 10.1 block diagram of clock pulse generator 10.1.2 register configuration the clock pulse generator is controlled by sbycr and lpwrcr. table 10.1 shows the register configuration. table 10.1 cpg registers name abbreviation r/w initial value address * standby control register sbycr r/w h'00 h'ffea low-power control register lpwrcr r/w h'00 h'ffeb note: * lower 16 bits of the address. section 10 clock pulse generator rev.3.00 jan. 10, 2007 page 224 of 1038 rej09b0328-0300 10.2 register descriptions 10.2.1 standby control register (sbycr) 7 ssby 0 r/w 6 sts2 0 r/w 5 sts1 0 r/w 4 sts0 0 r/w 3 ? 0 ? 0 sck0 0 r/w 2 ? 0 ? 1 sck1 0 r/w bit initial value r/w : : : sbycr is an 8-bit readable/writable register that performs power-down mode control. only bits 0 and 1 are described here. for a descri ption of the other bits, see section 4.2.1, standby control register (sbycr). sbycr is initialized to h'00 by a reset. bits 1 and 0 ? system clock select 1 and 0 (sck1, sck0): these bits select the bus master clock for high-speed mode and medium-speed mode. bit 1 bit 0 sck1 sck0 description 0 bus master is in high-speed mode (initial value) 0 1 medium-speed clock is /16 1 0 medium-speed clock is /32 1 medium-speed clock is /64 section 10 clock pulse generator rev.3.00 jan. 10, 2007 page 225 of 1038 rej09b0328-0300 10.2.2 low-power control register (lpwrcr) 7 dton 0 r/w 6 lson 0 r/w 5 nesel 0 r/w 4 ? 0 ? 3 ? 0 ? 0 sa0 0 r/w 2 ? 0 ? 1 sa1 0 r/w bit initial value r/w : : : lpwrcr is an 8-bit readable/writable register that performs power-down mode control. only bit 1 and 0 is described here. for a description of the other bits, see section 4.2.2, low- power control register (lpwrcr). lpwrcr is initialized to h'00 by a reset. bits 1 and 0 ? subactive mode clock select (sa1, sa0): selects cpu clock for subactive mode. in subactive mode, writes are disabled. bit 1 bit 0 sa1 sa0 description 0 cpu operating clock is w/8 (initial value) 0 1 cpu operating clock is w/4 1 * cpu operating clock is w/2 legend: * don't care section 10 clock pulse generator rev.3.00 jan. 10, 2007 page 226 of 1038 rej09b0328-0300 10.3 oscillator clock pulses can be supplied by connecting a crystal resonator, or by input of an external clock. 10.3.1 connecting a crystal resonator (1) circuit configuration a crystal resonator can be connected as shown in the example in figure 10.2. an at-cut parallel-resonance crystal should be used. osc1 osc2 r f c l2 c l1 c l1 = c l2 = 10 to 22 pf r f = 1m 20% figure 10.2 connection of crystal resonator (example) (2) crystal resonator figure 10.3 shows the equivalent circuit of the crystal resonator. use a crystal resonator that has the characteristics shown in table 10.2 and the same frequency as the system clock ( ). osc1 c l at-cut parallel-resonance type osc2 c 0 lr s figure 10.3 crystal resonator equivalent circuit table 10.2 crystal resonator parameters frequency (mhz) 8 10 r s max ( ) 80 60 c o max (pf) 7 7 section 10 clock pulse generator rev.3.00 jan. 10, 2007 page 227 of 1038 rej09b0328-0300 (3) note on board design when a crystal resonator is connected, the following points should be noted. other signal lines should be routed away from th e oscillator circuit to prevent induction from interfering with correct oscillation. see figure 10.4. when designing the board, place the crystal res onator and its load capacitors as close as possible to the osc1 and osc2 pins. c l2 signal a signal b c l1 this chip osc1 osc2 avoid r f figure 10.4 example of incorrect board design section 10 clock pulse generator rev.3.00 jan. 10, 2007 page 228 of 1038 rej09b0328-0300 10.3.2 external clock input (1) circuit configuration an external clock signal can be input as shown in the examples in figure 10.5. if the osc2 pin is left open, make sure that stray capacitance is no more than 10 pf. in example (b), make sure that the external clock is held high in standby mode, subactive mode, subsleep mode, and watch mode. osc1 osc2 external clock input open (a) osc2 pin left open osc1 osc2 external clock input (b) completely clock input at osc2 pin figure 10.5 external clock input (examples) (2) external clock the external clock signal should have the same frequency as the system clock ( ). table 10.3 and figure 10.6 show the i nput conditions for the external clock. table 10.3 external clock input conditions v cc = 4.0 to 5.5 v item symbol min max unit test conditions external clock input low pulse width t cpl 40 ? ns external clock input high pulse width t cph 40 ? ns figure 10.6 external clock rise time t cpr ? 10 ns external clock fall time t cpf ? 10 ns section 10 clock pulse generator rev.3.00 jan. 10, 2007 page 229 of 1038 rej09b0328-0300 t cph t cpl t cpr t cpf osc1 figure 10.6 external clock input timing table 10.4 shows the external clock output settling delay time, and figure 10.7 shows the external clock output settling delay timing. the oscillator and duty adjustment circuit have a function for adjusting the waveform of the external clock input at the osc1 pin. when the prescribed clock signal is input at the osc1 pin, internal clock signal output is fixed after the elapse of the external clock output settling delay time (t dext ). as the clock signal output is not fixed during the t dext period, the reset signal should be driven low to maintain the reset state. table 10.4 external clock output settling delay time (conditions: v cc = 4.0 v to 5.5 v, av cc = 4.0 v to 5.5 v, v ss = av ss = 0 v) item symbol min max unit notes external clock output settling delay time t dext * 500 ? s figure 10.7 note: * t dext includes 20 t cyc of res pulse width (t resw ). section 10 clock pulse generator rev.3.00 jan. 10, 2007 page 230 of 1038 rej09b0328-0300 t dext * res (internal) osc1 v cc 4.0 v note: * t dext includes 20 t cyc of res pulse width (t resw ). figure 10.7 external clock output settling delay timing 10.4 duty adjustment circuit when the oscillator frequency is 5 mhz or higher, the duty adjustment circuit adjusts the duty cycle of the clock signal from the oscillator to generate the system clock ( ). 10.5 medium-speed clock divider the medium-speed divider divides the system clock to generate /16, /32, and /64 clocks. 10.6 bus master clock selection circuit the bus master clock selection ci rcuit selects the system clock ( ) or one of the medium-speed clocks ( /16, /32 or /64) to be supplied to the bus master (cpu), according to the settings of bits sck2 to sck0 in sbycr. section 10 clock pulse generator rev.3.00 jan. 10, 2007 page 231 of 1038 rej09b0328-0300 10.7 subclock oscillator circuit 10.7.1 connecting 32.768 khz crystal resonator when using a subclock, connect a 32.768 khz crystal resonator to x1 and x2 pins as shown in figure 10.8. for precautions on connecting, see section 10.3.1 (3), note on board design. the subclock input conditions are shown in figure 10.10. x1 x2 c 2 c 1 c 1 = c 2 = 15 pf (typ) figure 10.8 connecting a 32.768 khz crystal resonator (example) figure 10.9 shows a crystal resonator equivalent circuit. x1 c s c 0 = 1.5 pf (typ) r s = 14 k (typ) f w = 32.768 khz note: values shown are the reference values. x2 c 0 l s r s figure 10.9 32.768 khz crystal resonator equivalent circuit section 10 clock pulse generator rev.3.00 jan. 10, 2007 page 232 of 1038 rej09b0328-0300 10.7.2 external clock input (1) circuit configuration when external clock input connect to the x1 pin, and x2 pin should remain open as connection example of figure 10.10. x1 x2 open external clock input figure 10.10 connection example when inputting external clock 10.7.3 when subclock is not needed connect x1 pin to v cc , and x2 pin should remain open as shown in figure 10.11. x1 x2 v cc open figure 10.11 terminal when subclock is not needed section 10 clock pulse generator rev.3.00 jan. 10, 2007 page 233 of 1038 rej09b0328-0300 10.8 subclock waveform shaping circuit to eliminate noise in the subclock input from the x1 pin, this circuit samples the clock using a clock obtained by dividing the clock. the sampling frequency is set with the nesel bit in lpwrcr. for details, see section 4.2.2, low-power control register (lpwrcr). the clock is not sampled in subactive mode, subsleep mode, or watch mode. 10.9 notes on the resonator resonator characteristics are closely related to the user board design. perform appropriate assessment of resonator connection, mask vers ion and f-ztat, by referring to the connection example given in this section. the resonator circuit rate differs depending on the free capacity of the resonator and the execution circuit, so consult with the resonator manufacturer before determination. make sure the voltage applied to the resonator pin does not exceed the maximum rated voltage. section 10 clock pulse generator rev.3.00 jan. 10, 2007 page 234 of 1038 rej09b0328-0300 section 11 i/o port rev.3.00 jan. 10, 2007 page 235 of 1038 rej09b0328-0300 section 11 i/o port 11.1 overview 11.1.1 port functions this lsi has seven 8-bit i/o ports (including one cmos high-current port), one 4-bit i/o port, and one 8-bit input port. table 11.1 shows the functions of each port. each i/o part a port control register (pcr) that controls an input and output and a port data register (pdr) for storing output data. the input and output can be controlled in a unit of bit. the pin whose peripheral function is used both as an alternative function can set the pin function in a unit of bit by a port mode register (pmr). 11.1.2 port input ? reading a port ? when a general port of pcr = 0 (input) is read, the pin level is read. ? when a general port of pcr = 1 (output) is read, the value of the corresponding pdr bit is read. ? when the pins (excluding an7 to an0 and rp7 to rp0 pins) set to the peripheral function are read, the results are as given in items (1) and (2) according to the pcr value. ? processing input pins the general input port or general i/o port is gated by read signals. unused pins can be left open if they are not read. however, if an open pin is read, a feedthrough current may apply during the read period according to an intermediate level. the read period is about one-state. relevant ports: p0, p1, p2, p3, p4, p5, p6, p7, p8 when an alternative pin is set to an alternative function other than the general i/o, always set the pin level to a high or low level. if the pin is left open, a feedthrough current applies according to an intermediate level, which ad versely affects reliability, causes malfunctions, and in the worst case may damage the pin. because the pmr is not initialized in low power consumption mode, pay attention to the pin input level after the mode has been shifted to the low power consumption mode. relevant pins: ic , irq0 to irq5 , sck1, sck2, si1, si2, cs , ftia, ftib, ftic, ftid, trig, tmbi, adtrg , excap, exttrg section 11 i/o port rev.3.00 jan. 10, 2007 page 236 of 1038 rej09b0328-0300 table 11.1 port functions port description pins alternative functions function switching register port 0 p07 to p00 input-only ports p07/an7 to p00/an0 analog data input channels 7 to 0 pmr0 p17/tmow prescalar unit frequency division clock output p16/ ic prescalar unit input capture input port 1 p17 to p10 i/o ports (built-in mos pull-up transistors) p15/ irq5 to p10/ irq0 external interrupt request input pmr1 p27/sck2 sci2 clock i/o p26/so2 sci2 transmit data output p25/si2 sci2 receive data input pmr2 p24/scl i 2 c bus interface clock i/o p23/sda i 2 c bus interface data i/o iccr p22/sck1 sci1 clock i/o p21/so1 sci1 transmit data output port 2 p27 to p20 i/o ports (built-in mos pull-up transistors) p20/si1 sci1 receive data input smr scr p37/tmo timer j timer output p36/buzz timer j buzzer output p35/pwm3 to p32/pwm0 8-bit pwm output p31/strb sci2 strobe output port 3 p37 to p30 i/o ports (built-in mos pull-up transistors) p30/ cs sci2 chip select input pmr3 p47 none ? p46/ftob timer x output compare b output p45/ftoa timer x output compare a output tocr p44/ftid timer x input capture d input p43/ftic timer x input capture c input p42/ftib timer x input capture b input p41/ftia timer x input capture a input ? port 4 p47 to p40 i/o ports p40/pwm14 14-bit pwm output pmr4 p53/trig realtime output port trigger input p52/tmbi timer b event input pmr5 p51 none ? port 5 p53 to p50 i/o ports p50/ adtrg a/d conversion start external trigger input adtsr port 6 p67 to p60 i/o ports p67/rp7 to p60/rp0 realtime output port pmr6 port 7 p77 to p70 i/o ports p77/ppg7 to p70/ppg0 ppg output pmr7 p87 to p84 none ? p83/sv2 p82/sv1 servo monitor output p81/excap capstan external synchronous signal input port 8 p87 to p80 i/o ports (high-current ports) p80/exttrg external trigger signal input pmr8 section 11 i/o port rev.3.00 jan. 10, 2007 page 237 of 1038 rej09b0328-0300 11.1.3 mos pull-up transistors the mos pull-up transistors in ports 1 to 3 can be switched on or off by the mos pull-up select registers 1 to 3 (pur1 to pur3) in units of bits. settings in pur1 to pur3 are valid when the pin function is set to an input by pcr1 to pcr3. if the pin function is set to an output, the mos pull- up transistor is turned off. figure 11.1 shows the circuit configuration of a pin with a mos pull-up transistor. when the pin whose peripheral function is used both as an alternative function is set to the alternative output function, the mos pull-up transistor is turned off. when the pin is set to the alternative input function, the mos pull-up transistor is contro lled according to the pur setting regardless of pcr. v cc pur lpwrm lpwrm pcr pdr pur pcr pdr : low power consumption mode si g nal (the mos pull-up transistor is turned off in reset, standby, and watch modes.) : mos pull-up select re g ister : port control re g ister : port data re g ister input data v cc v ss figure 11.1 circuit configuration of pin with mos pull-up transistor section 11 i/o port rev.3.00 jan. 10, 2007 page 238 of 1038 rej09b0328-0300 11.2 port 0 11.2.1 overview port 0 is an 8-bit input-only port. table 11.2 shows the port 0 configuration. port 0 consists of pins that are used both as standard input ports (p07 to p00) and analog input channels (an7 to an0). it is switched by port mode register 0 (pmr0). table 11.2 port 0 configuration port function alternative function port 0 p07 (standard input port) an7 (analog input channel) p06 (standard input port) an6 (analog input channel) p05 (standard input port) an5 (analog input channel) p04 (standard input port) an4 (analog input channel) p03 (standard input port) an3 (analog input channel) p02 (standard input port) an2 (analog input channel) p01 (standard input port) an1 (analog input channel) p00 (standard input port) an0 (analog input channel) 11.2.2 register configuration table 11.3 shows the port 0 register configuration. table 11.3 port 0 register configuration name abbrev. r/w size initial value address * port mode register 0 pmr0 r/w byte h'00 h'ffcd port data register 0 pdr0 r byte ? h'ffc0 note: * lower 16 bits of the address. section 11 i/o port rev.3.00 jan. 10, 2007 page 239 of 1038 rej09b0328-0300 (1) port mode register 0 (pmr0) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 0 7 0 r/w r/w r/w r/w 6 pmr04 pmr03 pmr02 pmr01 pmr00 pmr07 pmr06 pmr05 bit : initial value : r/w : port mode register 0 (pmr0) controls switching of each pin function of port 0. the switching is specified in a unit of bit. pmr0 is an 8-bit read/write enable register. when reset, pmr0 is initialized to h'00. bits 7 to 0 ? p07/an7 to p00/an0 pin switching (pmr07 to pmr00): pmr07 to pmr00 sets whether the p0n/ann pin is used as a p0n input pin or an ann pin for the analog input channel of an a/d converter. bit n pmr0n description 0 the p0n/ann pin functions as a p0n input pin (initial value) 1 the p0n/ann pin functions as an ann input pin note: n = 7 to 0 (2) port data register 0 (pdr0) 0 1 r 2 r 3 4 r r 5 7 pdr04 pdr03 pdr02 pdr01 pdr00 r pdr07 r r r pdr06 pdr05 6 ? ? ? ? ? ? ?? initial value : r/w : bit : port data register 0 (pdr0) reads the port states. when the corresponding bit of pmr0 is 0 (general input port), the pin state is read if pdr0 is read. when the corresponding bit of pmr0 is 1 (analog input channel), 1 is read if pdr0 is read. pdr0 is an 8-bit read-only register. when pdr0 is reset, its values become undefined. section 11 i/o port rev.3.00 jan. 10, 2007 page 240 of 1038 rej09b0328-0300 11.2.3 pin functions this section describes the pin functions of port 0 and their selection methods. (1) p07/an7 to p00/an0 p07/an7 to p00/an0 are switche d according to the pmr0n bit of pmr0 as shown below. pmr0n pin function 0 p0n input pin 1 ann input pin note: n = 7 to 0 11.2.4 pin states table 11.4 shows the pin 0 st ates in each operation mode. table 11.4 port 0 pin states pins reset active sleep standby watch subactive subsleep p07/an7 to p00/an0 high- impedance high- impedance high- impedance high- impedance high- impedance high- impedance high- impedance section 11 i/o port rev.3.00 jan. 10, 2007 page 241 of 1038 rej09b0328-0300 11.3 port 1 11.3.1 overview port 1 is an 8-bit i/o port. table 11.5 shows the port 1 configuration. port 1 consists of pins that are used both as standard i/o ports (p17 to p10) and frequency division clock output (tmow), input capture input ( ic ), or external interrupt request inputs ( irq5 to irq0 ). it is switched by port mode register 1 (pmr1) and port control register 1 (pcr1). port 1 can select the functions of mos pull-up transistors. table 11.5 port 1 configuration port function alternative function port 1 p17 (standard i/o port) tmow (frequency division clock output) p16 (standard i/o port) ic (input capture input) p15 (standard i/o port) irq5 (external interrupt request input) p14 (standard i/o port) irq4 (external interrupt request input) p13 (standard i/o port) irq3 (external interrupt request input) p12 (standard i/o port) irq2 (external interrupt request input) p11 (standard i/o port) irq1 (external interrupt request input) p10 (standard i/o port) irq0 (external interrupt request input) 11.3.2 register configuration table 11.6 shows the port 1 register configuration. table 11.6 port 1 register configuration name abbrev. r/w size initial value address * port mode register 1 pmr1 r/w byte h'00 h'ffce port control register 1 pcr1 w byte h'00 h'ffd1 port data register 1 pdr1 r/w byte h'00 h'ffc1 mos pull-up select register 1 pur1 r/w byte h'00 h'ffe1 note: * lower 16 bits of the address. section 11 i/o port rev.3.00 jan. 10, 2007 page 242 of 1038 rej09b0328-0300 (1) port mode register 1 (pmr1) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 0 7 0 r/w r/w r/w r/w 6 pmr14 pmr13 pmr12 pmr11 pmr10 pmr17 pmr16 pmr15 bit : initial value : r/w : port mode register 1 (pmr1) controls switching of each pin function of port 1. the switching is specified in a unit of bit. pmr1 is an 8-bit read/write enable register. when reset, pmr1 is initialized to h'00. note the following items when the pin functions are switched by pmr1. (1) if port 1 is set to an ic input pin and irq5 to irq0 by pmr1, the pin level needs be set to the high or low level regardless of the active mode and low power consumption mode. the pin level must not be set to an intermediate level. (2) when the pin functions of p16/ ic and p15/ irq5 to p10/ irq0 are switched by pmr1, they are incorrectly recognized as edge detection accordi ng to the state of a pin signal and a detection signal may be generated. to prevent this, perform the operation in the following procedure. (a) before switching the pin functions, inhibit an interrupt enable flag from being interrupted. (b) after having switched the pin functions, clear the relevant interrupt request flag to 0 by a single instruction. (program example) : mov.b rol,@ienr ?????? interrupt disabled mov.b r1l,@pmr1 ?????? pin function change nop ?????? optional instruction bclr m @irqr ?????? applicable interrupt clear mov.b r1l,@ienr ?????? interrupt enabled : bit 7 ? p17/tmow pin switching (pmr17): pmr17 sets whether the p17/tmow pin is used as a p17 i/o pin or a tmow pin for the frequency division clock output. bit 7 pmr17 description 0 the p17/tmow pin functions as a p17 i/o pin (initial value) 1 the p17/tmow pin functions as a tmow output pin section 11 i/o port rev.3.00 jan. 10, 2007 page 243 of 1038 rej09b0328-0300 bit 6 ? p16/ ic pin switching (pmr16): pmr16 sets whether the p16/ ic pin as a p16 i/o pin or an ic pin for the input capture input of the prescalar unit. the ic pin has a built-in noise cancel circuit. see section 22, prescalar unit. bit 6 pmr16 description 0 the p16/ ic pin functions as a p16 i/o pin (initial value) 1 the p16/ ic pin functions as an ic input pin bits 5 to 0 ? p15/ irq5 to p10/ irq0 pin switching (pmr15 to pmr10): pmr15 to pmr10 set whether the p1n/ irqn pin is used as a p1n i/o pin or an irqn pin for the external interrupt request input. bit n pmr1n description 0 the p1n/ irqn pin functions as a p1n i/o pin (initial value) 1 the p1n/ irqn pin functions as an irqn input pin note: n = 5 to 0 (2) port control register 1 (pcr1) 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 0 7 0 w w w w 6 pcr14 pcr13 pcr12 pcr11 pcr10 pcr17 pcr16 pcr15 bit : initial value : r/w : port control register 1 (pcr1) controls the i/os of pins p17 to p10 of port 1 in a unit of bit. when pcr1 is set to 1, the corresponding p17 to p10 pins become output pins, and when it is set to 0, they become input pins. when the relevant pin is set to a general i/o by pmr1, settings of pcr1 and pdr1 become valid. pcr1 is an 8-bit write-only register. when pcr1 is read, 1 is read. when reset, pcr1 is initialized to h'00. bit n pcr1n description 0 the p1n pin functions as an input pin (initial value) 1 the p1n pin functions as an output pin note: n = 7 to 0 section 11 i/o port rev.3.00 jan. 10, 2007 page 244 of 1038 rej09b0328-0300 (3) port data register 1 (pdr1) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 0 7 0 r/w r/w r/w r/w 6 pdr14 pdr13 pdr12 pdr11 pdr10 pdr17 pdr16 pdr15 bit : initial value : r/w : port data register 1 (pdr1) stores the data for the pins p17 to p10 of port 1. when pcr1 is 1 (output), the pdr1 values are directly read if por t 1 is read. accordingly, the pin states are not affected. when pcr1 is 0 (input), the pi n states are read if port 1 is read. pdr1 is an 8-bit read/ write enable register. when reset, pdr1 is initialized to h'00. (4) mos pull-up select register 1 (pur1) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 0 7 0 r/w r/w r/w r/w 6 pur14 pur13 pur12 pur11 pur10 pur17 pur16 pur15 bit : initial value : r/w : mos pull-up selector register 1 (pur1) controls the on and off of the mos pull-up transistor of port 1. only the pin whose corresponding bit of pcr1 was set to 0 (input) becomes valid. when the corresponding bit of pcr1 is set to 1 (output), the corresponding bit of pur1 becomes invalid and the mos pull-up transistor is turned off. pur1 is an 8-bit read/ write enable register. when reset, pur1 is initialized to h'00. bit n pur1n description 0 the p1n pin has no mos pull-up transistor (initial value) 1 the p1n pin has a mos pull-up pin note: n = 7 to 0 section 11 i/o port rev.3.00 jan. 10, 2007 page 245 of 1038 rej09b0328-0300 11.3.3 pin functions this section describes the port 1 pin functions and their selection methods. (1) p17/tmow p17/tmow is switched as shown below accordin g to the pmr17 bit in pmr1 and the pcr17 bit in pcr1. pmr17 pcr17 pin function 0 p17 input pin 0 1 p17 output pin 1 * tmow output pin (2) p16/ ic p16/ ic is switched as shown below according to th e pmr16 bit in pmr1, the nc on/off bit in prescalar unit control/status register (pcsr), and the pcr16 bit in pcr1. pmr16 pcr16 nc on/off pin function 0 p16 input pin 0 1 * p16 output pin 0 noise cancel invalid 1 * 1 ic input pin noise cancel valid (3) p15/ irq5 to p10/ irq0 p15/ irq15 to p10/ irq0 are switched as shown below according to the pmr1n bit in pmr1 and the pcr1n bit in pcr1. pmr1n pcr1n pin function 0 p1n input pin 0 1 p1n output pin 1 * irqn input pin legend: * don't care. notes: 1. n = 5 to 0 2. the irq5 to irq0 input pins can select the leading or falling edge as an edge sense (the irq0 pin can select both edges). see section 6.2.4, irq edge select register (iegr). 3. irq1 or irq2 can be used as a timer j event input and irq3 can be used as a timer r input capture input. for details, see section 14, timer j or section 16, timer r. section 11 i/o port rev.3.00 jan. 10, 2007 page 246 of 1038 rej09b0328-0300 11.3.4 pin states table 11.7 shows the port 1 pin states in each operation mode. table 11.7 port 1 pin states pins reset active sleep standby watch subactive subsleep p17/tmow p16/ ic p15/ irq5 to p10/ irq0 high- impedance operation holding high- impedance high- impedance operation holding note: if the ic input pin and irq5 to irq0 input pins are set, the pin level need be set to the high or low level regardless of the active mode and low power consumption mode. note that the pin level must not reach an intermediate level. section 11 i/o port rev.3.00 jan. 10, 2007 page 247 of 1038 rej09b0328-0300 11.4 port 2 11.4.1 overview port 2 is an 8-bit i/o port. table 11.8 shows the port 2 configuration. port 2 consists of pins that are used both as standard i/o ports (p27 to p20) and sci clock i/o (sck1, sck2), receive data input (si1 , si2), send data output (so1, so2), i 2 c bus interface clock i/o (scl), or data i/o (scl). it is switched by port mode register 2 (prm2), serial mode register (smr), serial control register 2 (scr), i 2 c bus control register (iccr), and port control register (pcr2). port 2 can select the mos pull-up function. table 11.8 port 2 configuration port function alternative function port 2 p27 (standard i/o port) sck2 (sci2 clock i/o) p26 (standard i/o port) so2 (sci2 transmit data output) p25 (standard i/o port) si2 (sci2 receive data input) p24 (standard i/o port) scl (i 2 c bus interface clock i/o) p23 (standard i/o port) sda (i 2 c bus interface data i/o) p22 (standard i/o port) sck1 (sci1 clock i/o) p21 (standard i/o port) so1 (sci1 transmit data output) p20 (standard i/o port) si1 (sci1 receive data input) 11.4.2 register configuration table 11.9 shows the port 2 register configuration. table 11.9 port 2 register configuration name abbrev. r/w size initial value address * port mode register 2 pmr2 r/w byte h'1e h'ffcf port control register 2 pcr2 w byte h'00 h'ffd2 port data register 2 pdr2 r/w byte h'00 h'ffc2 mos pull-up select register 2 pur2 r/w byte h'00 h'ffe2 note: * lower 16 bits of the address. section 11 i/o port rev.3.00 jan. 10, 2007 page 248 of 1038 rej09b0328-0300 (1) port mode register 2 (pmr2) 0 0 1 1 2 1 3 1 4 ? ? ? ? ? ? ? ? 1 0 r/w 5 0 7 0 r/w r/w r/w 6 pmr20 pmr27 pmr26 pmr25 bit : initial value : r/w : port mode register 2 (pmr2) controls switching of each pin function of port 2. the switching is specified in a unit of bit. the switching of the p22/sck1, p21/so1, and p20/si1 pin functions is controlled by smr and scr. see section 23, serial communication interface 1 (sci1). pmr2 is an 8-bit read/write enable register. when reset, pmr2 is initialized to h'1e. if the sck1, sck2, si1, and si2 input pins are set, the pin level need be set to the high or low level regardless of the active mode and low power consumption mode. note that the pin level must not reach an intermediate level bit 7 ? p27/sck2 pin switching (pmr27): pmr27 sets whether the p27/sck2 pin is used as a p27 i/o pin or an skc2 pin for the sci2 clock i/o. bit 7 pmr27 description 0 the p27/sck2 pin functions as a p27 i/o pin (initial value) 1 the p27/sck2 pin functions as an sck2 i/o pin bit 6 ? p26/so2 pin switching (pmr26): pmr26 sets whether the p26/so2 pin as a p26 i/o pin or an so2 pin for the sci2 send data output. bit 6 pmr26 description 0 the p26/so2 pin functions as a p26 i/o pin (initial value) 1 the p26/so2 pin functions as an so2 output pin section 11 i/o port rev.3.00 jan. 10, 2007 page 249 of 1038 rej09b0328-0300 bit 5 ? p25/si2 pin switching (pmr25): pmr26 sets whether the p25/si2 pin as a p25 i/o pin or an si2 pin for the sci2 receive data input. bit 5 pmr25 description 0 the p25/si2 pin functions as a p25 i/o pin (initial value) 1 the p25/si2 pin functions as an si2 input pin bits 4 to 1 ? reserved: when the bits are read, 1 is always read. the write operation is invalid. bit 0 ? p26/so2 pin pmos control (pmr20): pmr20 controls the pmos on and off of the p26/so2 pin output buffer. bit 0 pmr20 description 0 the p26/so2 pin functions as cmos output (initial value) 1 the p26/so2 pin functions as nmos open drain output (2) port control register 2 (pcr2) 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 0 7 0 w w w w 6 pcr24 pcr23 pcr22 pcr21 pcr20 pcr27 pcr26 pcr25 bit : initial value : r/w : port control register 2 (pcr2) controls the i/os of pins p27 to p20 of port 2 in a unit of bit. when pcr2 is set to 1, the corresponding p27 to p20 pins become output pins, and when it is set to 0, they become input pins. when the relevant pin is set to a general i/o by pmr1, settings of pcr2 and pdr2 are valid. pcr2 is an 8-bit write-only register. when pcr2 is read, 1 is read. when reset, pcr2 is initialized to h'00. bit n pcr2n description 0 the p2n pin functions as an input pin (initial value) 1 the p2n pin functions as an output pin note: n = 7 to 0 section 11 i/o port rev.3.00 jan. 10, 2007 page 250 of 1038 rej09b0328-0300 (3) port data register 2 (pdr2) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 0 7 0 r/w r/w r/w r/w 6 pdr24 pdr23 pdr22 pdr21 pdr20 pdr27 pdr26 pdr25 bit : initial value : r/w : port data register 2 (pdr2) stores the data for the pins p27 to p20 of port 2. when pcr2 is 1 (output), the pdr2 values are directly read if por t 2 is read. accordingly, the pin states are not affected. when pcr2 is 0 (input), the pi n states are read if port 2 is read. pdr2 is an 8-bit read/write enable register. when reset, pdr2 is initialized to h'00. (4) mos pull-up select register 2 (pur2) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 0 7 0 r/w r/w r/w r/w 6 pur24 pur23 pur22 pur21 pur20 pur27 pur26 pur25 bit : initial value : r/w : mos pull-up selector register 2 (pur2) controls the on and off of the mos pull-up transistor of port 2. only the pin whose corresponding bit of pcr1 was set to 0 (input) becomes valid. if the corresponding bit of pcr2 is set to 1 (output), the corresponding bit of pur2 becomes invalid and the mos pull-up transistor is turned off. pur2 is an 8-bit read/write enable register. when reset, pur2 is initialized to h'00. bit n pmr2n description 0 the p2n pin has no mos pull-up transistor (initial value) 1 the p2n pin has a mos pull-up transistor note: n = 7 to 0 section 11 i/o port rev.3.00 jan. 10, 2007 page 251 of 1038 rej09b0328-0300 11.4.3 pin functions this section describes the port 2 pin functions and their selection methods. (1) p27/sck2 p27/sck2 is switched as shown below according to the pmr27 bit in pm r2, the pcr27 bit in pcr2, and the sck2 to sck0 bits in serial control register 2 (scr2). pmr27 pcr27 cks2 to cks0 pin function 0 p27 input pin 0 1 * p27 output pin other than 111 sck2 output pin 1 * 111 sck2 input pin legend: * don't care. (2) p26/so2 p26/so2 is switched as shown below according to the pmr26 bit in pmr2 and the pcr26 bit in pcr2. pmr26 pcr26 pin function 0 p26 input pin 0 1 p26 output pin 1 * so2 output pin legend: * don't care. (3) p25/si2 p25/si2 is switched as shown below according to the pmr25 bit in pmr2 and the pcr25 bit in pcr2. pmr25 pcr25 pin function 0 p25 input pin 0 1 p25 output pin 1 * si2 input pin legend: * don't care. section 11 i/o port rev.3.00 jan. 10, 2007 page 252 of 1038 rej09b0328-0300 (4) p24/scl p24/scl2 is switched as shown belo w according to the ice bit in the i 2 c bus control register and the pcr24 bit in pcr2. ice pcr24 pin function 0 p24 input pin 0 1 p24 output pin 1 * scl i/o pin legend: * don't care. (5) p23/sda p23/sda is switched as shown below according to the ic e bit in the i 2 c bus control register and the pcr23 bit in pcr2. ice pcr23 pin function 0 p23 input pin 0 1 p23 output pin 1 * sda i/o pin legend: * don't care. (6) p22/sck1 p22/sck1 is switched as shown below acco rding to the pcr22 bit in pcr2, the c/ a bit in smr, and the cke1 and cke0 bits in scr. cke1 c/ a cke0 pcr22 pin function 0 p22 input pin 0 1 p22 output pin 0 1 0 1 sck1 output pin 1 * * * sck1 input pin legend: * don't care. section 11 i/o port rev.3.00 jan. 10, 2007 page 253 of 1038 rej09b0328-0300 (7) p21/so1 p21/so1 is switched as shown below according to the pcr21 bit in p cr2 and the te bit in scr. te pcr21 pin function 0 p21 input pin 0 1 p21 output pin 1 * so1 output pin legend: * don't care. (8) p20/si1 p20/si1 is switched as shown below according to the pcr20 bit in pcr2 and the re bit in scr. re pcr20 pin function 0 p20 input pin 0 1 p20 output pin 1 * si1 input pin legend: * don't care. 11.4.4 pin states table 11.10 shows the port 2 pin states in each operation mode. table 11.10 port 2 pin states pins reset active sleep standby watch subactive subsleep p27/sck2 p26/so2 p25/si2 p24/scl p23/sda p22/sck1 p21/so1 p20/si1 high- impedance operation holding high- impedance high- impedance operation holding note: if the sck1, sck2, si1, and si2 input pins are set, the pin level needs be set to the high or low level regardless of the active mode and low power consumption mode. note that the pin level must not reach an intermediate level. section 11 i/o port rev.3.00 jan. 10, 2007 page 254 of 1038 rej09b0328-0300 11.5 port 3 11.5.1 overview port 3 is an 8-bit i/o port. table 11.11 shows the port 3 configuration. port 3 consists of pins that are used both as standard i/o ports (p37 to p30) and timer j timer output (tmo), buzzer output (buzz), 8-bit pwn outputs (pwn3 to pwn0), sci2 strobe output (strb), or chip select input ( cs ). it is switched by port mode register 3 (pmr3) and port control register 3 (pcr3). port 3 can select the mos pull-up function. table 11.11 port 3 configuration port function alternative function port 3 p37 (standard i/o port) tmo (timer j timer output) p36 (standard i/o port) buzz (timer j buzzer output) p35 (standard i/o port) pwm3 (8-bit pwm output) p34 (standard i/o port) pwm2 (8-bit pwm output) p33 (standard i/o port) pwm1 (8-bit pwm output) p32 (standard i/o port) pwm0 (8-bit pwm output) p31 (standard i/o port) strb (sci2 strobe output) p30 (standard i/o port) cs (sci2 chip select input) 11.5.2 register configuration table 11.12 shows the port 3 register configuration. table 11.12 port 3 register configuration name abbrev. r/w size initial value address * port mode register 3 pmr3 r/w byte h'00 h'ffd0 port control register 3 pcr3 w byte h'00 h'ffd3 port data register 3 pdr3 r/w byte h'00 h'ffc3 mos pull-up select register 3 pur3 r/w byte h'00 h'ffe3 note: * lower 16 bits of the address. section 11 i/o port rev.3.00 jan. 10, 2007 page 255 of 1038 rej09b0328-0300 (1) port mode register 3 (pmr3) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 0 7 0 r/w r/w r/w r/w 6 pmr34 pmr33 pmr32 pmr31 pmr30 pmr37 pmr36 pmr35 bit : initial value : r/w : port mode register 3 (pmr3) controls switching of each pin function of port 3. the switching is specified in a unit of bit. pmr3 is an 8-bit read/write enable register. when reset, pmr3 is initialized to h'00. if the cs input pin is set, the pin level need be set to the high or low level regardless of the active mode and low power consumption mode. note that the pin level must not reach an intermediate level. bit 7 ? p37/tmo pin switching (pmr37): pmr37 sets whether the p37/tmo pin is used as a p37 i/o pin or a tmo pin for the timer j output timer. bit 7 pmr37 description 0 the p37/tmo pin functions as a p37 i/o pin (initial value) 1 the p37/tmo pin functions as a tmo output pin note: if the tmo pin is used for remote control sending, a careless timer output pulse may be output when the remote control mode is set after the output has been switched to the tmo output. perform the switching and setting in the following order. [1] set the remote control mode. [2] set the tmj-1 and 2 counter data of the timer j. [3] switch the p37/tmo pin to the tmo output pin. [4] set the st bit to 1. bit 6 ? p36/buzz pin switching (pmr36): pmr36 sets whether the p36/buzz pin as a p36 i/o pin or an buzz pin for the timer j buzzer out put. for the selection of the buzz output, see section14.2.2, timer j control register (tmjc). bit 6 pmr36 description 0 the p36/buzz pin functions as a p36 i/o pin (initial value) 1 the p36/buzz pin functions as a buzz output pin section 11 i/o port rev.3.00 jan. 10, 2007 page 256 of 1038 rej09b0328-0300 bits 5 to 2 ? p35/pwm3 to p32/pwm0 pin switching (pmr35 to pmr32): pmr35 to pmr32 set whether the p3n/pwmm pin is used as a p3n i/o pin or a pwmm pin for the 8-bit pwm output. bit n pmr3n description 0 the p3n/pwmm pin functions as a p3n i/o pin (initial value) 1 the p3n/pwmm pin functions as a pwmm output pin note: n = 5 to 2, m = 3 to 0 bit 1 ? p31/strb pin switching (pmr31): pmr31 sets whether the p31/strb pin is used as a p31 i/o pin or an strb pin for the sci2 strobe output. bit 1 pmr31 description 0 the p31/strb pin functions as a p31 i/o pin (initial value) 1 the p31/strb pin functions as an strb output pin bit 0 ? p30/ cs pin switching (pmr30): pmr30 sets whether the p30/ cs pin is used as a p30 i/o pin or a cs pin for the sci2 chip select input. bit 0 pmr30 description 0 the p30/ cs pin functions as a p30 i/o pin (initial value) 1 the p30/ cs pin functions as a cs input pin section 11 i/o port rev.3.00 jan. 10, 2007 page 257 of 1038 rej09b0328-0300 (2) port control register 3 (pcr3) 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 0 7 0 w w w w 6 pcr34 pcr33 pcr32 pcr31 pcr30 pcr37 pcr36 pcr35 bit : initial value : r/w : port control register 3 (pcr3) controls the i/os of pins p37 to p30 of port 3 in a unit of bit. when pcr3 is set to 1, the corresponding p37 to p30 pins become output pins, and when it is set to 0, they become input pins. when the relevant pin is set to a general i/o by pmr3, settings of pcr3 and pdr3 become valid. pcr3 is an 8-bit write-only register. when pcr3 is read, 1 is read. when reset, pcr3 is initialized to h'00. bit n pcr3n description 0 the p3n pin functions as an input pin (initial value) 1 the p3n pin functions as an output pin note: n = 7 to 0 (3) port data register 3 (pdr3) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 0 7 0 r/w r/w r/w r/w 6 pdr34 pdr33 pdr32 pdr31 pdr30 pdr37 pdr36 pdr35 bit : initial value : r/w : port data register 3 (pdr3) stores the data for the pins p37 to p30 of port 3. when pcr3 is 1 (output), the pdr3 values are directly read if por t 3 is read. accordingly, the pin states are not affected. when pcr3 is 0 (input), the pi n states are read if port 3 is read. pdr3 is an 8-bit read/write enable register. when reset, pdr3 is initialized to h'00. section 11 i/o port rev.3.00 jan. 10, 2007 page 258 of 1038 rej09b0328-0300 (4) mos pull-up select register 3 (pur3) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 0 7 0 r/w r/w r/w r/w 6 pur34 pur33 pur32 pur31 pur30 pur37 pur36 pur35 bit : initial value : r/w : mos pull-up selector register 3 (pur3) controls the on and off of the mos pull-up transistor of port 3. only the pin whose corresponding bit of pcr3 was set to 0 (input) becomes valid. if the corresponding bit of pcr3 is set to 1 (output), the corresponding bit of pur3 becomes invalid and the mos pull-up transistor is turned off. pur3 is an 8-bit read/write enable register. when reset, pur3 is initialized to h'00. bit n pcr3n description 0 the p3n pin has no mos pull-up transistor (initial value) 1 the p3n pin has a mos pull-up transistor note: n = 7 to 0 11.5.3 pin functions this section describes the port 3 pin functions and their selection methods. (1) p37/tmo p37/tmo is switched as shown below according to the pmr37 bit in pmr3 and the pcr37 bit in pcr3. pmr37 pcr37 pin function 0 p37 input pin 0 1 p37 output pin 1 * tmo output pin legend: * don't care. section 11 i/o port rev.3.00 jan. 10, 2007 page 259 of 1038 rej09b0328-0300 (2) p36/buzz p36/buzz is switched as shown below accordi ng to the pmr36 bit in pmr3 and the pcr36 bit in pcr3. pmr36 pcr36 pin function 0 p36 input pin 0 1 p36 output pin 1 * buzz output pin legend: * don't care. (3) p35/pwm3 to p32/pwm0 p35/pwm3 to p32/pwm0 are switched as shown below according to the pmr3n bit in pmr3 and the pcr3n bit in pcr3. pmr3n pcr3n pin function 0 p3n input pin 0 1 p3n output pin 1 * pwmm output pin legend: * don't care. note: n = 5 to 2, m = 3 to 0 (4) p31/strb p31/strb is switched as shown below according to the pmr31 bit in pmr3 and the pcr31 bit in pcr3. pmr31 pcr31 pin function 0 p31 input pin 0 1 p31 output pin 1 * strb output pin legend: * don't care. section 11 i/o port rev.3.00 jan. 10, 2007 page 260 of 1038 rej09b0328-0300 (5) p30/ cs p30/ cs is switched as shown below according to the pmr30 bit in pmr3 and the pcr30 bit in pcr3. pmr30 pcr30 pin function 0 p30 input pin 0 1 p30 output pin 1 * cs input pin legend: * don't care. 11.5.4 pin states table 11.13 shows the port 3 pin states in each operation mode. table 11.13 port 3 pin states pins reset active sleep standby watch subactive subsleep p37/tmo p36/buzz p35/pwm3 to p32/pwm0 p31/strb p30/ cs high- impedance operation holding high- impedance high- impedance operation holding note: if the cs input pin is set, the pin level need be set to the high or low level regardless of the active mode and low power consumption mode. note that the pin level must not reach an intermediate level. section 11 i/o port rev.3.00 jan. 10, 2007 page 261 of 1038 rej09b0328-0300 11.6 port 4 11.6.1 overview port 4 is an 8-bit i/o port. table 11.14 shows the port 4 configuration. port 4 consists of pins that are used both as standard i/o ports (p47 to p40) and output compare output (ftoa, ftob), input capture input (ftia, ftib, ftic, ftid) or 14-bit pwm output (pwm14). it is switched by port mode register 4 (prm4), timer output compare control register (tocr), and port control register 4 (pcr4). table 11.14 port 4 configuration port function alternative function port 4 p47 (standard i/o port) none p46 (standard i/o port) ftob (timer x1 output compare output) p45 (standard i/o port) ftoa (timer x1 output compare output) p44 (standard i/o port) ftid (timer x1 input capture input) p43 (standard i/o port) ftic (timer x1 input capture input) p42 (standard i/o port) ftib (timer x1 input capture input) p41 (standard i/o port) ftia (timer x1 input capture input) p40 (standard i/o port) pwm14 (14-bit pwm output) 11.6.2 register configuration table 11.15 shows the port 4 register configuration. table 11.15 port 4 register configuration name abbrev. r/w size initial value address * port mode register 4 pmr4 r/w byte h'fe h'ffdb port control register 4 pcr4 w byte h'00 h'ffd4 port data register 4 pdr4 r/w byte h'00 h'ffc4 note: * lower 16 bits of the address. section 11 i/o port rev.3.00 jan. 10, 2007 page 262 of 1038 rej09b0328-0300 (1) port mode register 4 (pmr4) 0 0 1 1 2 1 3 1 4 1 1 5 1 7 1 r/w 6 ? ? ? ? ? ?? ? ? ? ? ? ?? pmr40 bit : initial value : r/w : port mode register 4 (pmr4) controls switching of the p40/pwm14 pin function. the switchings of the p46/ftob and p45/ftoa functions are controlled by tocr. see section 17, timer x1. the ftia, ftib, ftic, and ftid inputs always function. pmr4 is an 8-bit read/write enable register. when reset, pmr4 is initialized to h'fe. because the ftia, ftib, ftic, and ftid inputs alwa ys function, the alternative pin need always be set to the high or low level regardless of the active mode and low power consumption mode. note that the pin level must not reach an intermediate level (excluding reset, standby, and watch modes). because the ftia, ftib, ftic, and ftid inputs al ways function, each input uses the input edge to the alternative general i/o pins p44, p43, p42, and p41 as input signals. bits 7 to 1 ? reserved: when the bits are read, 1 is always read. the write operation is invalid. bit 0 ? p40/pwm14 pin switching (pmr40): pmr40 sets whether the p40/pwm pin is used as a p40 i/o pin or a pwm14 pin for the 14-bit pwm square wave output. bit 0 pmr40 description 0 the p40/pwm14 pin functions as a p40 i/o pin (initial value) 1 the p40/pwm14 pin functions as a pwm14 output pin section 11 i/o port rev.3.00 jan. 10, 2007 page 263 of 1038 rej09b0328-0300 (2) port control register 4 (pcr4) 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 0 7 0 w w w w 6 pcr44 pcr43 pcr42 pcr41 pcr40 pcr47 pcr46 pcr45 bit : initial value : r/w : port control register 4 (pcr4) controls the i/os of pins p47 to p40 of port 4 in a unit of bit. when pcr4 is set to 1, the corresponding p47 to p40 pins become output pins, and when it is set to 0, they become input pins. when the relevant pin is set to a general i/o by pmr4, settings of pcr4 and pdr4 become valid. pcr4 is an 8-bit write-only register. when pcr4 is read, 1 is read. when reset, pcr4 is initialized to h'00. bit n pcr4n description 0 the p4n pin functions as an input pin (initial value) 1 the p4n pin functions as an output pin note: n = 7 to 0 (3) port data register 4 (pdr4) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 0 7 0 r/w r/w r/w r/w 6 pdr44 pdr43 pdr42 pdr41 pdr40 pdr47 pdr46 pdr45 bit : initial value : r/w : port data register 4 (pdr4) stores the data for the pins p47 to p40 of port 4. when pcr4 is 1 (output), the pdr4 values are directly read if por t 3 is read. accordingly, the pin states are not affected. when pcr4 is 0 (input), the pi n states are read if port 4 is read. pdr4 is an 8-bit read/write enable register. when reset, pdr4 is initialized to h'00. 11.6.3 pin functions this section describes the port 4 pin functions and their selection methods. (1) p47/ftci p47/ftci is switched as shown belo w according to the p cr47 bit in pcr4. pcr47 pin function 0 p47 input pin 1 p47 output pin section 11 i/o port rev.3.00 jan. 10, 2007 page 264 of 1038 rej09b0328-0300 (2) p46/ftob p46/ftob is switched as shown below according to the pcr46 bit in pcr4 and the oeb bit in tocr. oeb pcr46 pin function 0 p46 input pin 0 1 p46 output pin 1 * ftob output pin legend: * don't care. (3) p45/ftoa p45/ftoa is switched as shown below according to the pcr45 bit in pcr4 and the oea bit in tocr. oea pcr45 pin function 0 p45 input pin 0 1 p45 output pin 1 * ftoa output pin legend: * don't care. (4) p44/ftid p44/ftid is switched as shown below according to the pc r44 bit in pcr4. pcr44 pin function 0 p44 input pin ftid input pin 1 p44 output pin (5) p43/ftic p43/ftic is switched as shown belo w according to the pc r43 bit in pcr4. pcr43 pin function 0 p43 input pin ftic input pin 1 p43 output pin section 11 i/o port rev.3.00 jan. 10, 2007 page 265 of 1038 rej09b0328-0300 (6) p42/ftib p42/ftib is switched as shown belo w according to the p cr42 bit in pcr4. pcr42 pin function 0 p42 input pin ftib input pin 1 p42 output pin (7) p41/ftia p41/ftia is switched as shown below according to the p cr41 bit in pcr4. pcr41 pin function 0 p41 input pin ftia input pin 1 p41 output pin (8) p40/pwm14 p40/pwm14 is switched as shown below accordin g to the pmr40 bit in pmr4 and the pcr40 bit in pcr4. pmr40 pcr40 pin function 0 p40 input pin 0 1 p40 output pin 1 * pwm14 input pin legend: * don't care. section 11 i/o port rev.3.00 jan. 10, 2007 page 266 of 1038 rej09b0328-0300 11.6.4 pin states table 11.16 shows the port 4 pin states in each operation mode. table 11.16 port 4 pin states pins reset active sleep standby watch subactive subsleep p47 p46/ftob p45/ftoa p44/ftid p43/ftic p42/ftib p41/ftia p40/pwm14 high- impedance operation holding high- impedance high- impedance operation holding note: because the ftia, ftib, ftic, and ftid inputs always function, the alternative pin need be set to the high or low level regardless of the active mode and low power consumption mode. note that the pin level must not reach an intermediate level (excluding reset, standby, and watch modes). section 11 i/o port rev.3.00 jan. 10, 2007 page 267 of 1038 rej09b0328-0300 11.7 port 5 11.7.1 overview port 5 is a 4-bit i/o port. table 11.17 shows the port 5 configuration. port 5 consists of pins that are used both as standard i/o ports (p53 to p50) and realtime output port trigger input (trig), timer b event input (tmbi), or a/d conversion start external trigger input ( adtrg ). it is switched by port mode register 5 (pmr5), a/d trigger select register (adtsr), and port control register 5 (pcr5). table 11.17 port 5 configuration port function alternative function port 5 p53 (standard i/o port) trig (realtime output port trigger input) p52 (standard i/o port) tmbi (timer b event input) p51 (standard i/o port) none p50 (standard i/o port) adtrg (a/d conversion start external trigger input) 11.7.2 register configuration table 11.18 shows the port 5 register configuration. table 11.18 port 5 register configuration name abbrev. r/w size initial value address * port mode register 5 pmr5 r/w byte h'f1 h'ffdc port control register 5 pcr5 w byte h'f0 h'ffd5 port data register 5 pdr5 r/w byte h'f0 h'ffc5 note: * lower 16 bits of the address. section 11 i/o port rev.3.00 jan. 10, 2007 page 268 of 1038 rej09b0328-0300 (1) port mode register 5 (pmr5) 0 1 1 0 2 3 4 1 1 5 1 7 1 6 ? ? ? ?? ? ? ? ?? r/w pmr51 0 r/w pmr52 0 r/w pmr53 bit : initial value : r/w : port mode register 5 (pmr5) controls switching of each pin function of port 5 and specifies the edge sense of the timer b event input (tmbi). the switching of the p50/ adtrg pin function is controlled by adtsr. see section 26, a/d converter. pmr5 is an 8-bit read/write enable register. when reset, pmr5 is initialized to h'f1. if the trig, tmbi, and adtrg pin pins are set, the alternative pin need always be set to the high or low level regardless of the active mode and low power consumption mode. note that the pin level must not reach an intermediate level. bits 7 to 4 ? reserved: when the bits are read, 1 is always read. the write operation is invalid. bit 3 ? p53/trig pin switching (pmr53): pmr53 sets whether the p53/trig pin is used as a p53 i/o pin or a trig pin for th e realtime output port trigger input. bit 3 pmr53 description 0 the p53/trig pin functions as a p53 i/o pin (initial value) 1 the p53/trig pin functions as a trig input pin bit 2 ? p52/tmbi pin switching (pmr52): pmr52 sets whether the p52/tmbi pin is used as a p52 i/o pin or a tmbi pin for the timer b event input. bit 2 pmr52 description 0 the p52/tmbi pin functions as a p52 i/o pin (initial value) 1 the p52/tmbi pin functions as a tmbi input pin section 11 i/o port rev.3.00 jan. 10, 2007 page 269 of 1038 rej09b0328-0300 bit 1 ? timer b event input edge select (pmr51): pmr51 selects the input edge sense of the tmbi pin. bit 1 pmr51 description 0 the timer b event input detects the falling edge (initial value) 1 the timer b event input detects the rising edge bit 0 ? reserved when the bit is read, 1 is always read. the write operation is invalid. (2) port control register 5 (pcr5) 0 0 1 0 2 3 4 1 1 5 1 7 1 6 ? ? ?? ? ? ?? w pcr51 w pcr50 0 w pcr52 0 w pcr53 bit : initial value : r/w : port control register 5 (pcr5) controls the i/os of pins p53 to p50 of port 5 in a unit of bit. when pcr5 is set to 1, the corresponding p53 to p50 pins become output pins, and when it is set to 0, they become input pins. wh en the relevant pin is set to a general i/o, settings of pcr5 and pdr5 are valid. pcr5 is an 8-bit write-only register. when pcr5 is read, 1 is read. when reset, pcr5 is initialized to h'f0. bits 7 to 4 are reserved bits. bit n pcr5n description 0 the p5n pin functions as an input pin (initial value) 1 the p5n pin functions as an output pin note: n = 3 to 0 section 11 i/o port rev.3.00 jan. 10, 2007 page 270 of 1038 rej09b0328-0300 (3) port data register 5 (pdr5) 0 0 1 0 2 3 4 1 1 5 1 7 1 6 ? ? ?? ? ? ?? r/w pdr51 r/w pdr50 0 r/w pdr52 0 r/w pdr53 bit : initial value : r/w : port data register 5 (pdr5) stores the data for the pins p53 to p50 of port 5. when pcr5 is 1 (output), the pdr5 values are directly read if por t 5 is read. accordingly, the pin states are not affected. when pcr5 is 0 (input), the pi n states are read if port 5 is read. pdr5 is an 8-bit read/write enable register. when reset, pdr5 is initialized to h'f0. bits 7 to 4 are reserved bits. 11.7.3 pin functions this section describes the port 5 pin functions and their selection methods. (1) p53/trig p53/trig is switched as shown below according to the pmr53 bit in pmr5 and the pcr53 bit in pcr5. pmr53 pcr53 pin function 0 p53 input pin 0 1 p53 output pin 1 * trig input pin legend: * don't care. (2) p52/tmbi p52/tmbi is switched as shown below according to the pmr52 bit in pmr5 and the pcr52 bit in pcr5. pmr52 pcr52 pin function 0 p52 input pin 0 1 p52 output pin 1 * tmbi input pin legend: * don't care. section 11 i/o port rev.3.00 jan. 10, 2007 page 271 of 1038 rej09b0328-0300 (3) p51 p51 is switched as shown below acco rding to the pcr 51 bit in pcr5. pcr51 pin function 0 p51 input pin 1 p51 output pin (4) p50/ adtrg p50/ adtrg is switched as shown below according to the pcr50 bit in pcr5 and the trgs1 and trg0 bits in adtsr. trgs1, trgs0 pcr31 pin function 0 p50 input pin other than 11 1 p50 output pin 11 * adtrg input pin legend: * don't care. 11.7.4 pin states table 11.19 shows the port 5 pin states in each operation mode. table 11.19 port 3 pin states pins reset active sleep standby watch subactive subsleep p53/trig p52/tmbi p51 p50/ adrtg high- impedance operation holding high- impedance high- impedance operation holding note: if the trig, tmbi, and adtrg input pins are set, the alternative pin need always be set to the high or low level regardless of the active mode and low power consumption mode. note that the pin level must not reach an intermediate level. section 11 i/o port rev.3.00 jan. 10, 2007 page 272 of 1038 rej09b0328-0300 11.8 port 6 11.8.1 overview port 6 is an 8-bit i/o port. table 11.20 shows the port 6 configuration. port 6 consists of pins that are used both as standard i/o ports (p67 to p60) and realtime output ports (rp7 to rp0). it is switched by port mode register 6 (pmr6) and port control register 6 (pcr6). the realtime output function can instantaneously switch the output data by an external or internal trigger input. table 11.20 port 6 configuration port function alternative function port 6 p67 (standard i/o port) rp7 (realtime output port pin) p66 (standard i/o port) rp6 (realtime output port pin) p65 (standard i/o port) rp5 (realtime output port pin) p64 (standard i/o port) rp4 (realtime output port pin) p63 (standard i/o port) rp3 (realtime output port pin) p62 (standard i/o port) rp2 (realtime output port pin) p61 (standard i/o port) rp1 (realtime output port pin) p60 (standard i/o port) rp0 (realtime output port pin) section 11 i/o port rev.3.00 jan. 10, 2007 page 273 of 1038 rej09b0328-0300 11.8.2 register configuration table 11.21 shows the port 6 register configuration. table 11.21 port 6 register configuration name abbrev. r/w size initial value address * port mode register 6 pmr6 r/w byte h'00 h'ffdd port control register 6 pcr6 w byte h'00 h'ffd6 port data register 6 pdr6 r/w byte h'00 h'ffc6 realtime output trigger select register rtpsr r/w byte h'00 h'ffe5 realtime output trigger edge select register rtpegr r/w byte h'fc h'ffe4 port control register slave 6 pcrs6 ? byte h'00 ? port data register slave 6 pdrs6 ? byte h'00 ? note: * lower 16 bits of the address. (1) port mode register 6 (pmr6) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 6 0 7 pmr64 pmr63 pmr62 pmr61 pmr60 0 r/w pmr67 r/w r/w r/w pmr66 pmr65 bit : initial value : r/w : port mode register 6 (pmr6) controls switching of each pin function of port 6. the switching is specified in units of bits. pmr6 is an 8-bit read/write enable register. when reset, pmr6 is initialized to h'00. bits 7 to 0 ? p67/rp7 to p60/rp0 pin switching (pmr67 to pmr60): pmr67 to pmr60 set whether the p6n/rpn pin is used as a p6n i/o pin or an rpn pin for the realtime output port. bit n pmr6n description 0 the p6n/rpn pin functions as a p6n i/o pin (initial value) 1 the p6n/rpn pin functions as an rpn output pin note: n = 7 to 0 section 11 i/o port rev.3.00 jan. 10, 2007 page 274 of 1038 rej09b0328-0300 (2) port control register 6 (pcr6) 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 6 0 7 pcr64 pcr63 pcr62 pcr61 pcr60 0 w pcr67 w w w pcr66 pcr65 bit : initial value : r/w : port control register 6 (pcr6) selects the general i/o of port 6 and controls the realtime output in a unit of bit together with pmr6. when pmr6 = 0, the corresponding p67 to p60 pins become general output pins if pcr6 is set to 1, and they become general input pins if it is set to 0. when pmr6 = 1, pcr6 controls the corresponding rp7 to rp0 realtime output pins. for details, see section 11.8.4, operation. pcr6 is an 8-bit write-only register. when pcr6 is read, 1 is read. when reset, pcr6 is initialized to h'00. pmr6 pcr6 bit n bit n pmr6n pcr6n description 0 the p6n/rpn pin functions as a p6n general i/o input pin (initial value) 0 1 the p6n/rpn pin functions as a p6n general output pin 1 * the p6n/rpn pin functions as an rpn realtime output pin legend: * don't care. note: n = 7 to 0 (3) port data register 6 (pdr6) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 6 0 7 pdr64 pdr63 pdr62 pdr61 pdr60 0 r/w pdr67 r/w r/w r/w pdr66 pdr65 bit : initial value : r/w : port data register 6 (pdr6) stores the data for the pins p67 to p60 of port 6. for pmr6 = 0, when pcr6 is 1 (output), the pdr6 values are directly read if port 6 is read. accordingly, the pin states are not affected. when pcr6 is 0 (input), the pin states are read if port 6 is read. for pmr6 = 1, port 6 becomes a realtime output pin. for details, see section 11.8.4, operation. pdr6 is an 8-bit read/write enable register. when reset, pdr6 is initialized to h'00. section 11 i/o port rev.3.00 jan. 10, 2007 page 275 of 1038 rej09b0328-0300 (4) realtime output trigger select register (rtpsr) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 6 0 7 rtpsr4 rtpsr3 rtpsr2 rtpsr1 rtpsr0 0 r/w rtpsr7 r/w r/w r/w rtpsr6 rtpsr5 bit : initial value : r/w : the realtime output trigger select register (rtpsr) sets whether the external trigger (trig pin input) or the internal trigger (hsw) is used as an trigger input for the r ealtime output in a unit of bit. for the internal trigger hsw, see section 28.4, hsw (head-switch) timing generator. rtpsr is an 8-bit read/write enable register. when reset, rtpsr is initialized to h'00. bit n rtpsrn description 0 selects the external trigger (trig pin input) as a trigger input (initial value) 1 selects the internal trigger (hsw) a trigger input note: n = 7 to 0 (5) real time output trigger edge select register (rtpegr) 0 0 1 0 r/w 2 1 3 1 4 1 1 5 6 1 7 ? ? ? ? ? ? ? ? ? ? ? ? rtpegr1 rtpegr0 1 r/w bit : initial value : r/w : the realtime output trigger edge select register (rtpegr) specifies the edge sense of the external or internal trigger input for the realtime output. rtpegr is an 8-bit read/write enable register. when reset, rtpegr is initialized to h'fc. bits 7 to 2 ? reserved: when the bits are read, 1 is always read. the write operation is invalid. bits 1 and 0 ? realtime output trigger edge select (rtpegr1, rtpegr0): rtpegr1 and rtpegr0 select the edge sense of the external or internal trigger input for the realtime output. bit 1 bit 0 rtpegr1 rtpegr0 description 0 inhibits a trigger input (initial value) 0 1 selects the rising edge of a trigger input 1 0 selects the falling edge of a trigger input 1 selects both the leading and falling edges of a trigger input section 11 i/o port rev.3.00 jan. 10, 2007 page 276 of 1038 rej09b0328-0300 11.8.3 pin functions this section describes the port 6 pin functions and their selection methods. (1) p67/rp7 to p60/rp0 p67/rp7 to p60/rp0 are switche d as shown below according to the pmr6n bit in pmr6 and the pcr6n bit in pcr6. pmr6n pcr6n pin function output value value when pdr6n was read 0 p6n input pin ? p6n pin 0 1 p6n output pin pdr6n 0 high-impedance * 1 1 rpn output pin pdrs6n * pdr6n notes: n = 7 to 0 * when pmr6n = 1 (realtime output pin), indicates the state after the pcr6n setup value has been transferred to pcrs6n by a trigger input. section 11 i/o port rev.3.00 jan. 10, 2007 page 277 of 1038 rej09b0328-0300 11.8.4 operation port 6 can be used as a realtime output port or general i/o output port by pmr6. port 6 functions as a realtime output port when pmr6 = 1 and as a general i/o port when pmr6 = 0. the operation per port 6 function is shown below. (see figure 11.2.) p6/rp rtpegr write legend: pmr6 pcr6 pdr6 pcrs6 pdrs6 rtpsr rtpegr hsw trig : port mode register 6 : port control register 6 : port data register 6 : port control register slave 6 : port data register slave 6 : realtime output trigger select register : realtime output trigger edge select register : internal trigger signal : external trigger pin rtpsr write rmr6 write rdr6 write rcr6 write rdr6 read rtpegr selection circuit selection circuit internal data bus external trigger trig internal trigger hsw ck rtpsr ck rmr6 ck rdr6 ck rcr6 ck rdrs6 ck rcrs6 ck figure 11.2 port 6 function block diagram section 11 i/o port rev.3.00 jan. 10, 2007 page 278 of 1038 rej09b0328-0300 (1) operation of the realtime output port (pmr6 = 1) when pmr6 is 1, it operates as a realtime output port. when a trigger is input, pmr6 transfers the pdr6 data to pdrs6 and the pcr6 data to pcrs6, respectively. in this case, when pcrs6 is 1, the pdrs6 data of the corresponding bit is output to the rp pin. when pcrs6 is 0, the rp pin of the corresponding bit is output to the high-impedance state. in other words, the pin output state (high or low) or high-impedance state can instantaneously be switched by a trigger input. adversely, when pdr6 is read, the pdr6 values are read regardless of the pcr6 and pcrs6 values. (2) operation of the general i/o port (pmr6 = 0) when pmr6 is 0, it operates as a general i/o port. when data is written to pdr6, the same data is also written to pdrs6. accordingly, because both pdr6 and pdrs6 and both pcr6 and pcrs6 can be handled as one register, respectively, they can be used in the same way as a normal general i/o port. in other words, if pcr6 is 1, the pdr6 data of the corresponding bit is output to the p6 pin. if pcr6 is 0, the p6 pin of the corresponding bit becomes an input. adversely, assuming that pdr6 is read, the pdr6 values are read when pcr6 is 1 and the pin values are read when pcr6 is 0. 11.8.5 pin states table 11.22 shows the port 6 pin states in each operation mode. table 11.22 port 6 pin states pins reset active sleep standby watch subactive subsleep p67/rp7 to p60/rp0 high- impedance operation holding high- impedance high- impedance operation holding section 11 i/o port rev.3.00 jan. 10, 2007 page 279 of 1038 rej09b0328-0300 11.9 port 7 11.9.1 overview port 7 is an 8-bit i/o port. table 11.23 shows the port 7 configuration. port 7 consists of pins that are used both as standard i/o ports (p77 to p70) and hsw timing generation circuit (programmable pattern generator: ppg) outputs (ppg7 to ppg0). it is switched by port mode register 7 (pmr7) and port control register 7 (pcr7). for the programmable generator (ppg), see section 28.4, hsw (head-switch) timing generator. table 11.23 port 7 configuration port function alternative function port 7 p77 (standard i/o port) ppg7 (hsw timing output) p76 (standard i/o port) ppg6 (hsw timing output) p75 (standard i/o port) ppg5 (hsw timing output) p74 (standard i/o port) ppg4 (hsw timing output) p73 (standard i/o port) ppg3 (hsw timing output) p72 (standard i/o port) ppg2 (hsw timing output) p71 (standard i/o port) ppg1 (hsw timing output) p70 (standard i/o port) ppg0 (hsw timing output) 11.9.2 register configuration table 11.24 shows the port 7 register configuration. table 11.24 port 7 register configuration name abbrev. r/w size initial value address * port mode register 7 pmr7 r/w byte h'00 h'ffde port control register 7 pcr7 w byte h'00 h'ffd7 port control register 7 pdr7 r/w byte h'00 h'ffc7 note: * lower 16 bits of the address. section 11 i/o port rev.3.00 jan. 10, 2007 page 280 of 1038 rej09b0328-0300 (1) port mode register 7 (pmr7) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 6 0 7 pmr74 pmr73 pmr72 pmr71 pmr70 0 r/w pmr77 r/w r/w r/w pmr76 pmr75 bit : initial value : r/w : port mode register 7 (pmr7) controls switching of each pin function of port 7. the switching is specified in a unit of bit. pmr7 is an 8-bit read/write enable register. when reset, pmr7 is initialized to h'00. bits 7 to 0: p77/ppg7 to p70/ppg0 pin switching (pmr77 to pmr70) pmr77 to pmr70 set whether the p7n/ppgn pin is used as a p7n i/o pin or a ppgn pin for the hsw timing generation circuit output. bit n pmr7n description 0 the p7n/ppgn pin functions as a p7n i/o pin (initial value) 1 the p7n/ppgn pin functions as a ppgn output pin note: n = 7 to 0 (2) port control register 7 (pcr7) 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 6 0 7 pcr74 pcr73 pcr72 pcr71 pcr70 0 w pcr77 w w w pcr76 pcr75 bit : initial value : r/w : port control register 7 (pcr7) controls the i/os of pins p77 to p70 of port 7 in a unit of bit. when pcr7 is set to 1, the corresponding p77 to p70 pins become output pins, and when it is set to 0, they become input pins. when the corresponding pin is set to the general i/o by pmr7, settings of pcr7 and pdr7 become valid. pcr7 is an 8-bit write-only register. when pcr7 is read, 1 is read. when reset, pcr7 is initialized to h'00. bit n pcr7n description 0 the p7n pin functions as an input pin (initial value) 1 the p7n pin functions as an output pin note: n = 7 to 0 section 11 i/o port rev.3.00 jan. 10, 2007 page 281 of 1038 rej09b0328-0300 (3) port data register 7 (pdr7) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 6 0 7 pdr74 pdr73 pdr72 pdr71 pdr70 0 r/w pdr77 r/w r/w r/w pdr76 pdr75 bit : initial value : r/w : port data register 7 (pdr7) stores the data for the pins p77 to p70 of port 7. when pcr7 is 1 (output), the pdr7 values are directly read if port 7 is read. accordingly, the pin states are not affected. when pcr7 is 0 (input), the pin states are read if port 7 is read. pdr7 is an 8-bit read/write enable register. when reset, pdr7 is initialized to h'00. 11.9.3 pin functions this section describes the port 7 pin functions and their selection methods. (1) p77/ppg7 to p70/ppg0 p77/ppg7 to p70/ppg0 are switc hed as shown below according to the pmr7n bit in pmr7 and the pcr7n bit in pcr7. pmr7n pcr7n pin function 0 p7n input pin 0 1 p7n output pin 1 * ppgn input pin legend: * don't care. note: n = 7 to 0 11.9.4 pin states table 11.25 shows the port 7 pin states in each operation mode. table 11.25 port 7 pin states pins reset active sleep standby watch subactive subsleep p77/ppg7 to p70/ppg0 high- impedance operation holding high- impedance high- impedance operation holding section 11 i/o port rev.3.00 jan. 10, 2007 page 282 of 1038 rej09b0328-0300 11.10 port 8 11.10.1 overview port 8 is an 8-bit i/o port. table 11.26 shows the port 8 configuration. port 8 is a cmos high-current i/o port. the sink current is 20 ma max. (v ol = 1.5 v) and up to four pins can simultaneously be set on. port 8 consists of pins that are used both as high-current i/o ports (p87 to p80) and servo monitor output (sv1, sv2), capstan external synchronous signal input (excap), or external trigger signal input (exttrg). it is switched by port mode register 8 (pmr8) and port control register 8 (pcr8). table 11.26 port 8 configuration port function alternative function port 8 p87 (high-current i/o port) none p86 (high-current i/o port) none p85 (high-current i/o port) none p84 (high-current i/o port) none p83 (high-current i/o port) sv2 (servo monitor output) p82 (high-current i/o port) sv1 (servo monitor output) p81 (high-current i/o port) excap (capstan external synchronous signal input) p80 (high-current i/o port) exttrg (external trigger signal input) 11.10.2 register configuration table 11.27 shows the port 8 register configuration. table 11.27 port 8 register configuration name abbrev. r/w size initial value address * port mode register 8 pmr8 r/w byte h'f0 h'ffdf port control register 8 pcr8 w byte h'00 h'ffd8 port data register 8 pdr8 r/w byte h'00 h'ffc8 note: * the address indicates the low-order 16 bits. section 11 i/o port rev.3.00 jan. 10, 2007 page 283 of 1038 rej09b0328-0300 (1) port mode register 8 (pmr8) 0 0 1 0 r/w 2 0 r/w 3 0 4 1 1 5 6 1 7 ? ? ? ? ? ? ? ? pmr83 pmr82 pmr81 pmr80 1 r/w r/w bit : initial value : r/w : port mode register 8 (pmr8) controls switching of each pin function of port 8. the switching is specified in a unit of bit. pmr8 is an 8-bit read/write enable register. when reset, pmr8 is initialized to h'f0. if the excap and exttrg input pins are set, the pin level need always be set to the high or low level regardless of the active mode and low power consumption mode. note that the pin level must not reach an intermediate level. bits 7 to 4 ? reserved: when the bits are read, 1 is always read. the write operation is valid. bit 3 ? p83/sv2 pin switching (pmr83): pmr83 sets whether the p83/sv2 pin is used as a p83 i/o pin or an sv2 pin for the servo monitor output. for the selection of the sv2 output, see section 28, servo circuits. bit 3 pmr83 description 0 the p83/sv2 pin functions as a p83 i/o pin (initial value) 1 the p83/sv2 pin functions as an sv2 output pin bit 2 ? p82/sv1 pin switching (pmr82): pmr82 sets whether the p82/sv1 pin is used as a p82 i/o pin or an sv1 pin for the servo monitor output. for the selection of the sv1 output, see section 28, servo circuits. bit 2 pmr82 description 0 the p82/sv1 pin functions as a p82 i/o pin (initial value) 1 the p82/sv1 pin functions as an sv1 output pin section 11 i/o port rev.3.00 jan. 10, 2007 page 284 of 1038 rej09b0328-0300 bit 1 ? p81/excap pin switching (pmr81): pmr81 sets whether the p81/excap pin is used as a p81 i/o pin or an excap pin for the capstan external synchronous signal input. bit 1 pmr81 description 0 the p81/excap pin functions as a p81 i/o pin (initial value) 1 the p81/excap pin functions as an excap input pin bit 0 ? p80/exttrg pin switching (pmr80): pmr80 sets whether the p80/exttrg pin is used as a p80 i/o pin or an exttrg pin for the external trigger signal input. bit 0 pmr80 description 0 the p80/exttrg pin functions as a p80 i/o pin (initial value) 1 the p80/exttrg pin functions as an exttrg input pin (2) port control register 8 (pcr8) 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 6 0 7 pcr84 pcr83 pcr82 pcr81 pcr80 0 w pcr87 w w w pcr86 pcr85 bit : initial value : r/w : port control register 8 (pcr8) controls the i/os of pins p87 to p80 of port 8 in a unit of bit. when pcr8 is set to 1, the corresponding p87 to p80 pins become output pins, and when it is set to 0, they become input pins. when the correspondi ng pin is set to a general i/o, settings of pcr8 and pdr8 become valid. pcr8 is an 8-bit write-only register. when pcr8 is read, 1 is read. when reset, pcr8 is initialized to h'00. bit n pcr8n description 0 the p8n pin functions as an input pin (initial value) 1 the p8n pin functions as an output pin note: n = 7 to 0 section 11 i/o port rev.3.00 jan. 10, 2007 page 285 of 1038 rej09b0328-0300 (3) port data register 8 (pdr8) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 6 0 7 pdr84 pdr83 pdr82 pdr81 pdr80 0 r/w pdr87 r/w r/w r/w pdr86 pdr85 bit : initial value : r/w : port data register 8 (pdr8) stores the data for the pins p87 to p80 of port 8. when pcr8 is 1 (output), the pdr8 values are directly read if port 8 is read. accordingly, the pin states are not affected. when pcr8 is 0 (input), the pin states are read if port 8 is read. pdr8 is an 8-bit read/write enable register. when reset, pdr8 is initialized to h'00. 11.10.3 pin functions this section describes the port 8 pin functions and their selection methods. (1) p87 to p84 p87 to p84 are switched as shown belo w according to the pcr8n bit in pcr8. pcr8n pin function 0 p8n input pin 1 p8n output pin legend: * don't care. note: n = 7 to 4 (2) p83/sv2 p83/sv2 is switched as shown below according to the pmr83 bit in pmr8 and the pcr83 bit in pcr8. pmr83 pcr83 pin function 0 p83 input pin 0 1 p83n output pin 1 * sv2 output pin legend: * don't care. section 11 i/o port rev.3.00 jan. 10, 2007 page 286 of 1038 rej09b0328-0300 (3) p82/sv1 p82/sv1 is switched as shown below according to the pmr82 bit in pr m8 and the pcr82 bit in pcr8. pmr82 pcr82 pin function 0 p82 input pin 0 1 p82 output pin 1 * sv1 output pin legend: * don't care. (4) p81/excap p81/excap is switched as shown below accordin g to the pmr81 bit in prm8 and the pcr81 bit in pcr8. pmr81 pcr81 pin function 0 p81 input pin 0 1 p81 output pin 1 * excap input pin legend: * don't care. (5) p80/exttrg p80/exttrg is switched as shown below according to the pmr80 bit in prm8 and the pcr80 bit in pcr8. pmr80 pcr80 pin function 0 p80 input pin 0 1 p80 output pin 1 * exttrg input pin legend: * don't care. section 11 i/o port rev.3.00 jan. 10, 2007 page 287 of 1038 rej09b0328-0300 11.10.4 pin states table 11.28 shows the port 8 pin states in each operation mode. table 11.28 port 8 pin states pins reset active sleep standby watch subactive subsleep p87 to p84 p83/sv2 p83/sv1 p81/excap p80/exttrg high- impedance operation holding high- impedance high- impedance operation holding note: if the excap and exttrg input pins are set, the pin level need always be set to the high or low level regardless of the active mode and low power consumption mode. note that the pin level must not reach an intermediate level. section 11 i/o port rev.3.00 jan. 10, 2007 page 288 of 1038 rej09b0328-0300 section 12 timer a rev.3.00 jan. 10, 2007 page 289 of 1038 rej09b0328-0300 section 12 timer a 12.1 overview the timer a is an 8-bit interval timer. it can be used as a clock timer when connected to a 32.768-khz crystal oscillator. 12.1.1 features features of the timer a are as follows: ? choices of eight different types of internal clocks ( /16384, /8192, /4096, /1024, /512, /256, /64, and /16) are available for your selection. ? four different overflowing cycles (1 s, 0.5 s, 0.25 s, and 0.03125 s) are selectable as a clock timer. (when using a 32.768-khz crystal oscillator.) ? requests for interrupt will be output when the counter overflows. section 12 timer a rev.3.00 jan. 10, 2007 page 290 of 1038 rej09b0328-0300 12.1.2 block diagram figure 12.1 shows a block diagram of the timer a. le g end: tma 32-khz crystal oscillator overflowin g of the interval timer system clock w w/128 /16384, /8192, /4096, /1024, /512, /256, /64, /16 tca : timer mode re g ister a : timer counter a note: * selectable only when the prescaler w output ( w/128) is workin g as the input clock to the tca. prescaler s (pss) interruptin g circuit prescaler unit prescaler w (psw) tca 1/4 tma interrupt requests internal data bus 8 * 64 * 128 * 256 * figure 12.1 block diagram of the timer a 12.1.3 register configuration table 12.1 shows the register configuration of the timer a. table 12.1 register configuration name abbrev. r/w size initial value address * timer mode register a tma r/w byte h'30 h'ffba timer counter a tca r byte h'00 h'ffbb note: * lower 16 bits of the address. section 12 timer a rev.3.00 jan. 10, 2007 page 291 of 1038 rej09b0328-0300 12.2 descriptions of re spective registers 12.2.1 timer mode register a (tma) 0 0 1 0 r/w 2 0 r/w 3 0 4 1 5 ? ? ? ? 1 6 0 7 r/w r/w r/w tmaie 0 r/(w) * tmaov tma3 tma2 tma1 tma0 note: * only 0 can be written to clear the flag. bit : initial value : r/w : the timer mode register a (tma) works to control the interrupts of the timer a and to select the input clock. tma is an 8-bit read/write register. when reset, the tma will be initialized to h'30. bit 7 ? timer a overflow flag (tmaov): this is a status flag indi cating the fact that the tca is overflowing (h'ff h'00). bit 7 tmaov description 0 [clearing condition] (initial value) when 0 is written to the tmaov flag after reading the tmaov flag under the status where tmaov = 1 1 [setting condition] when the tca overflows bit 6 ? enabling interrupt of the timer a (tmaie): this bit works to permit/prohibit occurrence of interrupt of the timer a (tmai) when the tca overflows and when the tmaov of the tma is set to 1. bit 6 tmaie description 0 prohibits occurrence of interrupt of the timer a (tmai) (initial value) 1 permits occurrence of interrupt of the timer a (tmai) bits 5 and 4 ? reserved: when they are read, 1 will always be readout. writes are disabled. section 12 timer a rev.3.00 jan. 10, 2007 page 292 of 1038 rej09b0328-0300 bit 3 ? selection of the clock so urce and prescaler (tma3): this bit works to select the pss or psw as the clock source for the timer a. bit 3 tma3 description 0 selects the pss as the clock source for the timer a (initial value) 1 selects the psw as the clock source for the timer a bits 2 to 0 ? clock selection (tma2 to tma0): these bits work to select the clock to input to the tca. in combination with the tma3 bit, the choices are as follows: bit 3 bit 2 bit 1 bit 0 tma3 tma2 tma1 tma0 prescaler division ratio (interval timer) or overflow cycle (time base) operation mode 0 pss, /16384 (initial value) 0 1 pss, /8192 0 pss, /4096 0 1 1 pss, /1024 0 pss, /512 0 1 pss, /256 0 pss, /64 0 1 1 1 pss, /16 interval timer mode 0 1 s 0 1 0.5 s 0 0.25 s 0 1 1 0.03125 s 0 0 1 0 1 1 1 1 works to clear the psw and tca to h'00 clock time base mode note: = f osc section 12 timer a rev.3.00 jan. 10, 2007 page 293 of 1038 rej09b0328-0300 12.2.2 timer counter a (tca) 0 0 1 0 r 2 0 r 3 0 4 5 6 7 r r tca3 0 r tca4 0 r tca5 0 r tca6 0 r tca7 tca2 tca1 tca0 bit : initial value : r/w : the timer counter a (tca) is an 8-bit up-counter which counts up on inputs from the internal clock. the inputting clock can be selected by tma3 to tma0 bits of the tma when the tca overflows, the tmaov bit of the tma is set to 1. the tca can be cleared by setting the tma3 and tma2 bits of the tma to 11. the tca is always readable. when reset, the tca will be initialized into h'00. 12.2.3 module stop control register (mstpcr) 7 1 mstp15 r/w mstpcrh 6 1 mstp14 r/w 5 1 mstp13 r/w 4 1 mstp12 r/w 3 1 mstp11 r/w 2 1 mstp10 r/w 1 1 mstp9 r/w 0 1 mstp8 r/w 7 1 mstp7 r/w 6 1 mstp6 r/w 5 1 mstp5 r/w 4 1 mstp4 r/w 3 1 mstp3 r/w 2 1 mstp2 r/w 1 1 mstp1 r/w 0 1 mstp0 r/w mstpcrl initial value : r/w : bit : the mstpcr are 8-bit read/write twin registers which work to control the module stop mode. when the mstp15 bit is set to 1, the timer a stops its operation at the ending point of the bus cycle to shift to the module stop mode. for more information, see section 4.5, module stop mode. when reset, the mstpcr will be initialized into h'ffff. bit 7 ? module stop (mstp15): this bit works to designate the module stop mode for the timer a. mstpcrh bit 7 mstp15 description 0 cancels the module stop mode of the timer a 1 sets the module stop mode of the timer a (initial value) section 12 timer a rev.3.00 jan. 10, 2007 page 294 of 1038 rej09b0328-0300 12.3 operation the timer a is an 8-bit timer for use as an interval timer and as a clock time base connecting to a 32.768 khz crystal oscillator. 12.3.1 operation as the interval timer when the tma3 bit of the tma is cleared to 0, the timer a works as an 8-bit interval timer. when resetince the tca is cleared to h'00 and as the tma3 bit is cleared to 0, the timer a continues counting up as the interval counte r without interrupts right after resetting. as the operation clock for the timer a, selection can be made from eight different types of internal clocks being output from the pss by the tma2 to tma0 bits of the tma. when the clock signal is input after the reading of the tca reaches h'ff, the timer a overflows and the tmaov bit of the tma will be set to 1. at this time, when the tmaie bit of the tma is 1, interrupt occurs. when overflowing occurs, the reading of the tca returns to h'00 before resuming counting up. consequently, it works as the interval timer to produce overflow outputs periodically at every 256 input clocks. 12.3.2 operation of the timer for clocks when the tma3 bit of the tma is set to 1, the timer a works as a time base for the clock. as the overflow cycles for the timer a, selection can be made from four different types by counting the clock being output from the psw by the tma1 bit and tma0 bit of the tma. 12.3.3 initializing the counts when the tma3 and tma2 bits are set to 11, the psw and tca will be cleared to h'00 to come to a stop. at this state, writing 10 to the tma3 bit and tma2 bit makes the timer a to start counting from h'00 under the time base mode for clocks. after clearing the psw and tca using the tma3 and tma2 bits, writing 00 or 01 to the tma3 bit and tma2 bit work to make the timer a to start counting from h'00 under the interval timer mode. however, since the pss is not cleared, the period to the first count is not constant. section 13 timer b rev.3.00 jan. 10, 2007 page 295 of 1038 rej09b0328-0300 section 13 timer b 13.1 overview the timer b is an 8-bit up-counter. the timer b is equipped with two different types of functions namely, the interval function and the auto reloading function. 13.1.1 features ? selection from choices of seven different types of internal clocks ( /16384, /4096, /1024, /512, /128, /32, and /8) or selection of external clock are possible. ? when the counter overflows, an in terrupt request will be issued. 13.1.2 block diagram figure 13.1 shows a block diagram of the timer b. legend: tmb /16384 /4096 /1024 /512 /128 /32 /8 tmbi tcb : timer mode register b : timer counter b tlb tmbi : timer re-loading register b : event input terminal of the timer b re-loading clock sources overflowing timer b interrupt requests internal data bus tcb tmb tlb interrupting circuit figure 13.1 block diagram of the timer b section 13 timer b rev.3.00 jan. 10, 2007 page 296 of 1038 rej09b0328-0300 13.1.3 pin configuration table 13.1 shows the pin configuration of the timer b. table 13.1 pin configuration name abbrev. i/o function event inputs to the timer b tmbi input event input pin for inputs to the tcb 13.1.4 register configuration table 13.2 shows the register configuration of the timer b. the tcb and tlb are being allocated to the same address. reading or writing determines the accessing register. table 13.2 register configuration name abbrev. r/w size initial value address * timer mode register b tmb r/w byte h'18 h'd110 timer counter b tcb r byte h'00 h'd111 timer load register b tlb w byte h'00 h'd111 port mode register 5 pmr5 r/w byte h'f1 h'ffdc note: * lower 16 bits of the address. section 13 timer b rev.3.00 jan. 10, 2007 page 297 of 1038 rej09b0328-0300 13.2 descriptions of re spective registers 13.2.1 timer mode register b (tmb) 0 0 1 0 r/w 2 0 r/w 3 1 4 ? ? ? ? 1 5 0 6 0 7 r/w r/w tmbie r/(w) * tmbif 0 r/w tmb17 tmb12 tmb11 tmb10 note: * only 0 can be written to clear the flag. bit : initial value : r/w : the tmb is an 8-bit read/write register which works to control the interrupts, to select the auto reloading function and to select the input clock. when reset, the tmb is initialized to h'18. bit 7 ? selecting the auto reloading function (tmb17): this bit works to select the auto reloading function of the timer b. bit 7 tmb17 description 0 selects the interval function (initial value) 1 selects the auto reloading function bit 6 ? interrupt requesting flag for the timer b (tmbif): this is an interrupt requesting flag for the timer b. it indicates th e fact that the tcb is overflowing. bit 6 tmbif description 0 [clearing condition] (initial value) when 0 is written after reading 1 1 [setting condition] when the tcb overflows section 13 timer b rev.3.00 jan. 10, 2007 page 298 of 1038 rej09b0328-0300 bit 5 ? enabling interrupt of the timer b (tmbie): this bit works to permit/prohibit occurrence of interrupt of the timer b when the tcb overflows and when the tmbif is set to 1. bit 5 tmbie description 0 prohibits occurrence of interrupt of the timer b (initial value) 1 permits occurrence of interrupt of the timer b bits 4 and 3 ? reserved: when they are read, 1 will always be readout. writes are disabled. bits 2 to 0 ? clock selection (tmb12 to tmb10): these bits work to select the clock to input to the tcb. selection of the rising edge or the falling edge is workable with the external event inputs. bit 2 bit 1 bit 0 tmb12 tmb11 tmb10 descriptions 0 0 0 internal clock: counts at /16384 (initial value) 0 0 1 internal clock: counts at /4096 0 1 0 internal clock: counts at /1024 0 1 1 internal clock: counts at /512 1 0 0 internal clock: counts at /128 1 0 1 internal clock: counts at /32 1 1 0 internal clock: counts at /8 1 1 1 counts at the rising edge and the falling edge of external event inputs (tmbi) * note: * the edge selection for the external event inputs is made by setting the pmr51 of the port mode register 5 (pmr5). see section 13.2.4, port mode register 5 (pmr5). section 13 timer b rev.3.00 jan. 10, 2007 page 299 of 1038 rej09b0328-0300 13.2.2 timer counter b (tcb) 0 0 1 0 r 2 0 r 3 4 5 0 6 0 7 r r tcb15 0 r tcb14 0 r tcb13 r tcb16 0 r tcb17 tcb12 tcb11 tcb10 bit : initial value : r/w : the tcb is an 8-bit readable register which works to count up by the internal clock inputs and external event inputs. the input clock can be selected by the tmb12 to tmb10 of the tmb. when the tcb overflows (h'ff h'00 or h'ff tlb setting), a interrupt request of the timer b will be issued. when reset, the tcb is initialized to h'00. 13.2.3 timer load register b (tlb) 0 0 1 0 w 2 0 w 3 4 5 0 6 0 7 w w tlb15 0 w tlb14 0 w tlb13 w tlb16 0 w tlb17 tlb12 tlb11 tlb10 bit : initial value : r/w : the tlb is an 8-bit write only register which works to set the reloading value of the tcb. when the reloading value is set to the tlb, the value will be simultaneously loaded to the tcb and the tcb starts counting up from the set value. also, during an auto reloading operation, when the tcb overflows, the value of the tlb will be loaded to the tcb. consequently, the overflowing cycle can be set within the range of 1 to 256 input clocks. when reset, the tlb is initialized to h'00. 13.2.4 port mode register 5 (pmr5) 0 1 0 r/w 2 0 r/w 3 4 1 5 6 7 ? ? ? ? ? ? ? ? ? ? pmr52 0 r/w pmr53 pmr51 1 1 1 1 bit : initial value : r/w : the port mode register 5 (pmr5) works to changeover the pin functions of the port 5 and to designate the edge sense of the event inputs of the timer b (tmbi). the pmr5 is an 8-bit read/write register. when reset, the pmr5 will be initialized to h'f1. see section 11.7, port 5 for other information than bit 1. section 13 timer b rev.3.00 jan. 10, 2007 page 300 of 1038 rej09b0328-0300 bit 1 ? selecting the edges of the event inputs to the timer b (pmr51): this bit works to select the input edge sense of the tmbi pins. bit 1 pmr51 description 0 detects the falling edge of the event inputs to the timer b (initial value) 1 detects the rising edge of the event inputs to the timer b 13.2.5 module stop control register (mstpcr) 7 1 mstp15 r/w mstpcrh 6 1 mstp14 r/w 5 1 mstp13 r/w 4 1 mstp12 r/w 3 1 mstp11 r/w 2 1 mstp10 r/w 1 1 mstp9 r/w 0 1 mstp8 r/w 7 1 mstp7 r/w 6 1 mstp6 r/w 5 1 mstp5 r/w 4 1 mstp4 r/w 3 1 mstp3 r/w 2 1 mstp2 r/w 1 1 mstp1 r/w 0 1 mstp0 r/w mstpcrl initial value : r/w : bit : the mstpcr are 8-bit read/write twin registers which work to control the module stop mode. when the mstp14 bit is set to 1, the timer b stops its operation at the ending point of the bus cycle to shift to the module stop mode. for more information, see section 4.5, module stop mode. when reset, the mstpcr is initialized to h'ffff. bit 6 ? module stop (mstp14): this bit works to designate the module stop mode for the timer b. mstpcrh bit 6 mstp14 description 0 cancels the module stop mode of the timer b 1 sets the module stop mode of the timer b (initial value) section 13 timer b rev.3.00 jan. 10, 2007 page 301 of 1038 rej09b0328-0300 13.3 operation 13.3.1 operation as the interval timer when the tmb17 bit of the tmb is set to 0, the timer b works as an 8-bit interval timer. when reset, since the tcb is cleared to h'00 a nd as the tmb17 bit is cleared to 0, the timer b continues counting up as the interval timer without interrupts right after resetting. as the clock source for the timer b, selection can be made from seven different types of internal clocks being output from the prescaler unit by the tmb12 to tmb10 bits of the tmb or an external clock through the tmbi input pin can be chosen instead. when the clock signal is input after the readi ng of the tcb reaches h'ff, the timer b overflows and the tmbif bit of the tmb will be set to 1. at this time, when the tmbie bit of the tmb is 1, interrupt occurs. when overflowing occurs, the reading of the tcb returns to h'00 before resuming counting up. when a value is set to the tlb while the interval timer is in operation, the value which has been set to the tlb will be loaded to the tcb simultaneously. 13.3.2 operation as the auto reload timer when the tmb17 of the tmb is set to 1, the timer b works as an 8-bit auto reload timer. when a reload value is set in the tlb, the value is loaded onto the tcb at the same time, and the tcb starts counting up from the value. when the clock signal is input after the readi ng of the tcb reaches h'ff, the timer b overflows and the tlb value is loaded onto the tcb, then the tcb continues counting up from the loaded value. accordingly, overflow interval can be set within the range of 1 to 256 clocks depending on the tlb value. clock source and interrupts in the auto reload operation are the sa me as those in the interval operation. when the tlb value is re-set while the auto reload timer is in operation, the value which has been set to the tlb will be loaded onto the tcb simultaneously. 13.3.3 event counter the timer b works as an event counter using the tmbi pin as the event input pin. when the tmb12 to tmb10 are set to 111, the external even t will be selected as the clock source and the tcb counts up at the leading edge or the trailing edge of the tmbi pin inputs. section 13 timer b rev.3.00 jan. 10, 2007 page 302 of 1038 rej09b0328-0300 section 14 timer j rev.3.00 jan. 10, 2007 page 303 of 1038 rej09b0328-0300 section 14 timer j 14.1 overview the timer j consists of twin 8-bit counters. it carries seven different operation modes such as reloading and event counting. 14.1.1 features the timer j consists of twin 8-bit reloading timers and it is usable under the various functions as follows: ? twin 8-bit reloading timers (among the two, one is capable to make timer outputs) ? twin 8-bit event counters (capable to make reloading) ? 8-bit event counter (capable to make reloading) + 8-bit reload timer ? 16-bit event counter (capable to make 16-bit reloading) ? 16-bit reload timer (capable to make 16-bit reloading) ? remote controlled transmissions ? "take up/supply reel pulse" dividing (8 bit 2 units) 14.1.2 block diagram figure 14.1 is a block diagram of the timer j. the timer j consists of two reload timers namely, tmj-1 and tmj-2. section 14 timer j rev.3.00 jan. 10, 2007 page 304 of 1038 rej09b0328-0300 le g end: tcj note: * at the low level under the timer mode. tlj : timer counter j : timer load re g ister j tck tlk : timer counter k : timer load re g ister k tmo remoout : tmj-1 timer output : tmj-2 to gg le output (remote controller transmission data) buzz reloadin g re g ister (burst/space width re g ister ps21, 20 : buzzer output tgl : tmj-2 to gg le plu g ps21,20 st : tmj-2 input clock selection : startin g the remote controlled operation ps11,10 : tmj-1 input clock selection 8/16 t/r : 8-bit/16-bit operation chan g eover : timer output/remote controller output chan g eover internal data bus ed g e detection to gg le t/r down-counter (8 bit) buss output control monitor output control to gg le reloadin g re g ister 8/16 st ps11,10 down- counter (8 bit) under- flow under- flow tcj tmj-1 tmj-2 tck pb/rec-ctl dvctl tca7 /4096 /8192 tgl remoout tmo tmo buzz clock sources irq2 /1024 (only for the h8s/2194c group) /2048 /16384 clock sources irq1 /4 /256 /512 * synchronization tlj reloadin g reloadin g tlk tmj-1 interruptin g circuit interrupt request by the tmj1 interrupt request by the tmj2 tmj-2 interruptin g circuit figure 14.1 block diagram of the timer j section 14 timer j rev.3.00 jan. 10, 2007 page 305 of 1038 rej09b0328-0300 14.1.3 pin configuration table 14.1 shows the pin configuration of the timer j. table 14.1 pin configuration name abbrev. i/o function event input pin irq1 input event inputs to the tmj-1 event input pin irq2 input event inputs to the tmj-2 14.1.4 register configuration table 14.2 shows the register configuration of the timer j. the tcj and tlj or the tck and tlk are being allocated to the same address respectively. reading or writing determines the accessing register. table 14.2 register configuration name abbrev. r/w size initial value address * 2 timer mode register j tmj r/w byte h'00 h'd13a timer j control register tmjc r/w byte h'09 h'd13b timer j status register tmjs r/(w) * 1 byte h'3f h'd13c timer counter j tcj r byte h'ff h'd139 timer counter k tck r byte h'ff h'd138 timer load register j tlj w byte h'ff h'd139 timer load register k tlk w byte h'ff h'd138 notes: 1. only 0 can be written to clear the flag. 2. lower 16 bits of the address. section 14 timer j rev.3.00 jan. 10, 2007 page 306 of 1038 rej09b0328-0300 14.2 descriptions of re spective registers 14.2.1 timer mode register j (tmj) 0 0 1 0 r 2 0 r/w 3 0 4 0 r/w 5 0 6 0 7 r/w r/w r/w st r/w ps10 0 r/w ps11 8/16 ps21 ps20 tgl t/r bit : initial value : r/w : the timer mode register j (tmj) works to select the inputting clock for the tmj-1 and tmj-2 and to set the operation mode. the tmj is an 8-bit register and bit-1 is for read only and all the remaining bits are applicable to read/write. when reset, the tmj is initialized to h'00. under all other modes than the remote controlling mode, writing into the tmj works to initialize the counters (tcj and tck) to h'ff. bits 7 and 6 ? selecting the inputting clock to the tmj-1 (ps11 and ps10): these bits work to select the clock to input to the tmj-1. selection of the rising edge or the falling edge is workable for counting by use of an external clock. bit 7 bit 6 ps11 ps10 description 0 counting by the pss, /512 (initial value) 0 1 counting by the pss, /256 0 counting by the pss, /4 1 1 counting at the rising edge or the falling edge of the external clock inputs ( irq1 ) * note: * the edge selection for the external clock inputs is made by setting the edge select register (iegr). see section 6.2.4, irq edge select registers (iegr) for more information. when using an external clock under the remote controlling mode, set the opposite edge with the irq1 and the irq2 when using an external clock under the remote controlling mode. (when irq1 falling, select irq2 rising and when irq1 rising, select irq2 falling.) section 14 timer j rev.3.00 jan. 10, 2007 page 307 of 1038 rej09b0328-0300 bit 5 ? starting the remote controlled operation (st): this bit works to start the remote controlled operations. when this bit is set to 1, clock signal is supplied to the tmj-1 to start signal transmissions. when this bit is cleared to 0, clock supply stops to discontinue the operation. the st bit will be valid under the remote controlling mode, namely, when the bit 0 (t/r bit) is 1 and the bit 4 (8- /16-bit) is 0. under other modes than the remote controlling mode, it will be fixed to 0. when a shift to the low power consumption mode is made during remote controlled operation, the st bit will be cleared to 0. when resuming operation after returning to the active mode, write 1. bit 5 st description 0 works to stop clock signal supply to the tmj-1 under the remote controlling mode (initial value) 1 works to supply clock signal to the tmj-1 under the remote controlling mode bit 4 ? switching over between 8-bit/16-bit operations (8/16): this bit works to choose if using the timer j as two units of 8-bit timer/counter or if using it as a single unit of 16-bit timer/counter. even under 16-bit operations, tmj1i interrupt requests from the tmj-1 will be valid. bit 4 8/16 description 0 makes the tmj-1 and tmj-2 operate separately (initial value) 1 makes the tmj-1 and tmj-2 operate altogether as 16-bit timer/counter section 14 timer j rev.3.00 jan. 10, 2007 page 308 of 1038 rej09b0328-0300 bits 3 and 2 ? selecting the inputting clock to the tmj-2 (ps21 and ps20): this bit works to select the clock to input to the tmj-2. selection of the leading edge or the trailing edge is workable for counting by use of an external clock. tmjc: bit 0 bit 3 bit 2 ps22 * 3 ps21 ps20 description 0 counting by the pss, /16384 (initial value) 0 1 counting by the pss, /2048 0 counting at underflowing of the tmj-1 1 1 1 counting at the leading edge or the trailing edge of the external clock inputs ( irq2 ) * 1 0 * 2 * 2 counting by the pss, /1024 (available only the h8s/2194c group) notes: 1. the edge selection for the external clock inputs is made by setting the edge select register (iegr). see section 6.2.4, irq edge select registers (iegr) for more information. 2. don't care. 3. available only in the h8s/2194c group. bit 1 ? tmj-2 toggle flag (tgl): this flag indicates the toggled status of the underflowing with the tmj-2. reading only is workable. it will be cleared to 0 under the low power consumption mode. bit 1 tgl description 0 the toggle output of the tmj-2 is 0 (initial value) 1 the toggle output of the tmj-2 is 0 bit 0 ? switching over between timer output/remote controlling output (t/r): this bit works to select if using the timer outputs from the tmj-1 as the output signal through the tmo pin or if using the toggle outputs (remote controlled transmission data) from the tmj-2 as the output signal through the tmo pin. bit 0 t/r description 0 timer outputs from the tmj-1 (initial value) 1 toggle outputs from the tmj-2 (remote controlled transmission data) section 14 timer j rev.3.00 jan. 10, 2007 page 309 of 1038 rej09b0328-0300 selecting the op eration mode: the operation mode of the timer j is determined by the bit 4 (8/16) and bit 0 (t/r) of the tmj. tmj bit 4 bit 0 8/16 t/r description 0 8-bit timer 2 (initial value) 0 1 remote controlling mode 1 * 16-bit timer legend: * don't care. when writing is made into the tmj under the timer mode, the counters (tcj and tck) will be initialized (h'ff). consequently, writing into the reloading registers (tlj an tlk) should be conducted after finishing settings with the tmj. under the remote controlling mode, although the tlj and the tlk will not be initialized even when writing is made into the tmj, follow the sequence listed below when starting a remote controlling operation. (1) make setting to the remote controlling mode with the tmj. (2) write the data into the tlj and tlk. (3) start the remote controlled operation by use of the tmj. (st bit = 1) even under 16-bit operations, tmj1i interrupt requests from the tmj-1 will be valid. 14.2.2 timer j control register (tmjc) 0 1 0 2 0 r/w 3 (ps22) * ? (r/w) * ? 4 0 r/w 5 0 6 0 7 r/w r/w mon1 r/w buzz0 0 r/w buzz1 mon0 tmj2ie tmj1ie 11 bit : initial value : r/w : note: * bit 0 is readable/writable only in the h8s/2194c group. the timer j control register works to select the buzzer output frequency and to control permission/prohibition of interrupts. the tmjc is an 8-bit read/write register. when reset, the tmjc is initialized to h'09. bits 7 and 6 ? selecting the buzzer output (buzz1 or buzz0): this bit works to select if using the buzzer outputs as the out put signal through the buzz pin or if using the monitor signals as the output signal through the buzz pin. section 14 timer j rev.3.00 jan. 10, 2007 page 310 of 1038 rej09b0328-0300 when setting is made to the monitor signals, choose the monitor signal using the mon1 bit and mon0 bit. bit 7 bit 6 buzz1 buzz0 description frequency when = 10 mhz 0 /4096 (initial value) 2.44 khz 0 1 /8192 1.22 khz 1 0 works to output monitor signals 1 works to output buzz signals from the timer j bits 5 and 4 ? selecting the monitor signals (mon1 or mon0): these bits work to select the type of signals being output through the buzz pin for monitoring purpose. these settings are valid only when the buzz1 and buzz0 bits are being set to 1 and 0. when pb-ctl or rec-ctl is chosen, signal duties will be output as they are. in case of dvctl signals, signals from the ctl dividing circuit will be toggled before being output. signal waveforms divided by the ctl dividing circuit into "n-divisions" will further be divided into halves. (namely, "2n" divisions, 50% duty waveform). in case of tca7, bit 7 of the counter of the timer a will be output. (50% duty) when the prescaler is being used with th e timer a, 1 hz outputs are available. bit 5 bit 4 mon1 mon0 description 0 pb or rec-ctl (initial value) 0 1 dvctl 1 * outputs tca7 legend: * don't care. bit 3 ? reserved: when this is read, 1 will always be readout. writes are disabled. bit 2 ? enabling interrupt of the tmj2i (tmj2ie): this bit works to permit/prohibit occurrence of tmj2i interrupt of the tmjs in 1-set of the tmj2i. bit 2 tmj2ie description 0 prohibits occurrence of tmj2i interrupt (initial value) 1 permits occurrence of tmj2i interrupt section 14 timer j rev.3.00 jan. 10, 2007 page 311 of 1038 rej09b0328-0300 bit 1 ? enabling interrupt of the tmj1i (tmj1ie): this bit works to permit/prohibit occurrence of tmj1i interrupt of the tmjs in 1-set of the tmj1i. bit 1 tmj1ie description 0 prohibits occurrence of tmj1i interrupt (initial value) 1 permits occurrence of tmj1i interrupt bit 0 ? reserved (for h8s/2194 group): when this is read, 1 will always be readout. writes are disabled. bit 0 ? selecting the input clock for tmj-2 (ps22) (for h8s/2194c group): this bit, together with bits 3 and 2 (ps21, ps20) in tmj, selects the input clock for tmj-2. for details, see section 14.2.1, timer mode register j (tmj). 14.2.3 timer j status register (tmjs) 0 1 2 3 4 5 ? ? ? ? ? ? ? ? ? ? ? ? 6 0 7 r/(w) * tmj1i 0 r/(w) * tmj2i 11 1 1 11 note: * only 0 can be written to clear the flag. bit : initial value : r/w : the timer j status register (tmjs) works to indi cate issuance of the interrupt request of the timer j. the tmjs is an 8-bit read/write register. when reset, the tmjs is initialized to h'3f. bit 7 ? tmj2i interrupt requesting flag (tmj2i): this is the tmj2i interrupt requesting flag. this flag is set when the tmj-2 underflows. bit 7 tmj2i description 0 [clearing condition] (initial value) when 0 is written after reading 1 1 [setting condition] when the tmj-2 underflows section 14 timer j rev.3.00 jan. 10, 2007 page 312 of 1038 rej09b0328-0300 bit 6 ? tmj1i interrupt requesting flag (tmj1i): this is the tmj1i interrupt requesting flag. this flag is set out when the tmj-1 underflows. tmj1i interrupt requests will also be made under a 16-bit operation. bit 6 tmj1i description 0 [clearing condition] (initial value) when 0 is written after reading 1 1 [setting condition] when the tmj-1 underflows bits 5 to 0 ? reserved: when they are read, 1 will always be readout. writes are disabled. 14.2.4 timer counter j (tcj) 0 1 1 1 r 2 1 r 3 1 4 1 r 5 1 6 1 7 r r r tdr15 r tdr16 1 r tdr17 tdr14 tdr13 tdr12 tdr11 tdr10 bit : initial value : r/w : the time counter j (tcj) is an 8-bit readable down-counter which works to count down by the internal clock inputs or external clock inputs. the in putting clock can be se lected by the ps11 and ps10 bits of the tmj. tcj values can be readout always. nonetheless, when the 8-/16-bit of the tmj is being set to 1 (means when setting is made to 16-bit operation), reading is possible under the word command only. at this time, the tck of the tmj-2 can be read by the upper 8 bits and the tcj can be read by the lower 8 bits. when the tcj underflows (h'00 reloading value), regardless of the operation mode setting of the 8-/16-bit, the tmj1i bit of the tmjs will be set to 1. the tcj and tlj are being allocated to the same address. when reset, the tcj is initialized to h'ff. section 14 timer j rev.3.00 jan. 10, 2007 page 313 of 1038 rej09b0328-0300 14.2.5 timer counter k (tck) 0 1 1 1 r 2 1 r 3 1 4 1 r 5 1 6 1 7 r r r tdr25 r tdr26 1 r tdr27 tdr24 tdr23 tdr22 tdr21 tdr20 bit : initial value : r/w : the time counter k (tck) is an 8-bit readable down-counter which works to count down by the internal clock inputs or external clock inputs. the in putting clock can be se lected by the ps21 and ps20 bits of the tmj. tck values can be readout always. nonetheless, when the 8-/16-bit of the tmj is being set to 1 (means when setting is made to 16-bit operation), reading is possible under the word command only. at this time, the tck can be read by the upper 8 bits and the tcj of the tmj-1 can be read by the lower 8 bits. when the tck underflows (h'00 reloading value), the tmj2i bit of the tmjs will be set to 1. the tck and tlk are being allocated to the same address. when reset, the tck is initialized to h'ff. 14.2.6 timer load register j (tlj) 0 1 1 1 w 2 1 w 3 1 4 1 w 5 1 6 1 7 w w w tlr15 w tlr16 1 w tlr17 tlr14 tlr13 tlr12 tlr11 tlr10 bit : initial value : r/w : the timer load register j (tlj) is an 8-bit write only register which works to set the reloading value of the tcj. when the reloading value is set to the tlj, the value will be simultaneously loaded to the tcj and the tcj starts counting down from the set value. also, during an auto reloading operation, when the tcj underflows, the value of the tlj will be loaded to the tcj. consequently, the underflowing cycle can be set within the range of 1 to 256 input clocks. nonetheless, when the 8-/16-bit of the tmj is being set to 1 (means when setting is made to 16-bit operation), writing is possible under the word command only. at this time, the upper 8 bits can be written into the tlk of the tmj-2 and the lower 8 bits can be written into the tlj. the tlj and tcj are being allocated to the same address. when reset, the tlj is initialized to h'ff. section 14 timer j rev.3.00 jan. 10, 2007 page 314 of 1038 rej09b0328-0300 14.2.7 timer load register k (tlk) 0 1 1 1 w 2 1 w 3 1 4 1 w 5 1 6 1 7 w w w tlr25 w tlr26 1 w tlr27 tlr24 tlr23 tlr22 tlr21 tlr20 bit : initial value : r/w : the timer load register k (tlk) is an 8-bit write only register which works to set the reloading value of the tck. when the reloading value is set to the tlk, the value will be simultaneously loaded to the tck and the tck starts counting down from the set value. also, during an auto reloading operation, when the tck underflows, the value of the tlk w ill be loaded to the tc k. consequently, the underflowing cycle can be set within the range of 1 to 256 input clocks. nonetheless, when the 8-/16-bit of the tmj is being set to 1 (means when setting is made to 16-bit operation), writing is possible under the word command only. at this time, the upper 8 bits can be written into the tlk and the lower 8 bits can be written into the tlj of the tmj-1. the tlk and tck are being allocated to the same address. when reset, the tlk is initialized to h'ff. 14.2.8 module stop control register (mstpcr) 7 1 mstp15 r/w mstpcrh 6 1 mstp14 r/w 5 1 mstp13 r/w 4 1 mstp12 r/w 3 1 mstp11 r/w 2 1 mstp10 r/w 1 1 mstp9 r/w 0 1 mstp8 r/w 7 1 mstp7 r/w 6 1 mstp6 r/w 5 1 mstp5 r/w 4 1 mstp4 r/w 3 1 mstp3 r/w 2 1 mstp2 r/w 1 1 mstp1 r/w 0 1 mstp0 r/w mstpcrl initial value : r/w : bit : the mstpcr are 8-bit read/write twin registers which work to control the module stop mode. when the mstp13 bit is set to 1, the timer j stops its operation at the ending point of the bus cycle to shift to the module stop mode. for more information, see section 4.5, module stop mode. when reset, the mstpcr is initialized to h'ffff. bit 5 ? module stop (mstp13): this bit works to designate the module stop mode for the timer j. mstpcrh bit 5 mstp13 description 0 cancels the module stop mode of the timer j 1 sets the module stop mode of the timer j (initial value) section 14 timer j rev.3.00 jan. 10, 2007 page 315 of 1038 rej09b0328-0300 14.3 operation 14.3.1 8-bit reload timer (tmj-1) the tmj-1 is an 8-bit reload timer. as the clock source, dividing clock or edge signals through the irq1 pin are being used. by selecting the edge signals through the irq1 pin, it can also be used as an event counter. while it is working as an event counter, its reloading function is workable simultaneously. when data are written into the reloading register tlj, these data will be written into the counter tcj simultaneously. also, when the counter tcj underflows, the data of the reloading register tlj will be reloaded to the counter tcj. when the counter underflows, tmj1i interrupt requests will be issued. the underflow will be toggled and, by a appropriate selection of the dividing clock, buzzer outputs will be issued or carrier frequencies for remote controlling transmissions can be acquired. the tmj-1 and tmj-2, in combination, can be us ed as a 16-bit reload tim er. nonetheless, when they are being used, in combination, as a 16-bit timer, word command only is valid and the tck works as the down counter for the upper 8 bits and the tcj works as the down counter for the lower 8 bits, means a reloading register of total 16 bits. when data are written into a 16-bit reloading register, the same data will be written into the 16-bit counter. also, when the 16-bit counter underflows, the data of the 16-bit reloading regi ster will be reloaded into the counter. even when they are making a 16-bit operation, the tmj1i interrupt requests of the tmj-1 and buzz outputs are effective. in case these functi ons are not necessary, make them invalid by programming. the tmj-1 and tmj-2, in combination, can be used for remote controlled data transmission. regarding the remote controlled data transmission, see section 14.3.3, remote controlled data transmission. 14.3.2 8-bit reload timer (tmj-2) the tmj-2 is an 8-bit down-counting reload timer. as the clock source, dividing clock, edge signals through the irq2 pin or the underflow signals from the tmj-1 are being used. by selecting the edge signals through the irq2 pin, it can also be used as an event counter. while it is working as an event counter, its reloading function is workable simultaneously. when data are written into the reloading register tlk, these data will be written into the counter tck simultaneously. also, when the counter tck underflows, the data of the reloading register tlk will be made to the data counter tck. when the counter underflows, tmj2i interrupt requests will be issued. the tmj-2 and tmj-1, in combination, can be used as a 16-bit reload timer. for more information section 14 timer j rev.3.00 jan. 10, 2007 page 316 of 1038 rej09b0328-0300 on the 16-bit reload timer, see section 14.3.1, 8-bit reload timer (tmj-1). the tmj-2 and tmj-1, in combination, can be ope rated by remote controlled data transmission. regarding the remote controlled data transmission, see section 14.3.3, remote controlled data transmission. 14.3.3 remote controlled data transmission the timer j is capable of making remote controlled data transmission. the carrier frequencies for the remote controlled data transmission can be generated by the tmj-1 and the burst width duration and the space width durati on can be setup by the tmj-2. the data having been written into the reloading register tmj-1 and into the burst/space duration register (tlk) of the tmj-2 will be loaded to the counter at the same time as the remote controlled data transmission starts. (remote controlled data transmission starting bit (st) 1) while remote controlled data transmission is bei ng made, the contents of the burst/space duration register will be loaded to the counter only while reloading is being made by unde rflow signals. even when a writing is made to the burst/space duration register while remote controlled data transmission is being made, reloading operatio n will not be made until an underflow signal is issued. the tmj-2 issues tmj2i interrupt requests by the underflow signals. the tmj-1 performs normal reloading operation (including the tmj1i interrupt requests). figure 14.2 shows the output waveform for the remote controlled data transmission function. when a shift to the low power consumption mode is effected while remote controlled data transmission is being made, the st bit will be cleared to 0. when resuming the remote controlled data transmission after returning to the active mode, write 1. section 14 timer j rev.3.00 jan. 10, 2007 page 317 of 1038 rej09b0328-0300 burst width space width burst width tmj-2 toggle output = 1 tmj-2 toggle output = 0 tmj-2 toggle output = 1 setting the space width setting the burst width setting the space width st bit 1 underflow underflow underflow tmj-1 can generate the carrier frequencies remote controlled data transmission outputs setting the remote controlled mode setting the burst width figure 14.2 remote controlled data transmission output waveform section 14 timer j rev.3.00 jan. 10, 2007 page 318 of 1038 rej09b0328-0300 tmj-1 udf tmo (buzz) tmj-2 udf remoout tmo remote controlled data transmission output figure 14.3 timer output timing section 14 timer j rev.3.00 jan. 10, 2007 page 319 of 1038 rej09b0328-0300 when the timer j is set to the remote controlled operation mode, since the start bit (st) is being set or cleared in synchronization with the inputting clock to the tmj-2, a delay upto a cycle of the inputting clock at the maximum occurs, namely, after the st bit has been set to 1 until the remote controlled data transmission starts. consequently, when the tlk is updated during the period after setting the st bit to 1 until the next cycle of the inputting clock comes, the initial burst width will be changed like shown in figure 14.4. therefore, when making remote controlled data transmission, determine i/o of the tgl bit at the time of the first burst width control operation w ithout fail. (or, set the space width to the tlk after waiting for a cycle of the inputting clock.) after that, operations can be continued by interrupts. similarly, pay attention to the control works when ending remote controlled data transmission. exemple) 1) set the burst width with the tlk. 2) st bit 1 3) execute the procedure 4) if the tgl flag = 1. 4) set the space width with the tlk under the status where the tgl flag = 1. 5) make tmj-2 interrupt. 6) set the burst width with the tlk. : n) after making tmj-2 interrupt, make setting of the st 0 under the status where the tgl flag = 0. the period during which the space width settig can be made. (s) delay interrupt interrupt tlk setting (burst width) (b) burst width according to (b) space width according to (s) stopping the remote controlled data transmission tgl flag inputting clock to the tmj-2 st 0 delay st 1 remote controlled data transmission starts here. if an updating is made with the tlk during this period, the burst width will be changed. figure 14.4 controls of the remote controlled data transmission section 14 timer j rev.3.00 jan. 10, 2007 page 320 of 1038 rej09b0328-0300 section 15 timer l rev.3.00 jan. 10, 2007 page 321 of 1038 rej09b0328-0300 section 15 timer l 15.1 overview the timer l is an 8-bit up/down counter using the control pulses or the cfg division signals as the clock source. 15.1.1 features features of the timer l are as follows: ? choices of two different types of internal clocks ( /128 and /64), dvcfg2 (cfg division signal 2), pb and rec-ctl (control pulses) are available for your selection. ? in case the pb-ctl is not available, such as when reproducing un-recorded tapes, tape count can be made by the dvcfg2. ? selection of the leading edge or the trailing edge is workable with the ctl pulse counting. ? interrupts occur when the counter overflows or underflows and at occurrences of compare match clear. ? it is possible to switch over between the up-counting and down-counting functions with the counter. section 15 timer l rev.3.00 jan. 10, 2007 page 322 of 1038 rej09b0328-0300 15.1.2 block diagram figure 15.1 shows a block diagram of the timer l. legend: internal data bus dvcfg2 : division signal 2 of the cfg pb and rec-ctl : control pluses necessary when making reproduction and storage lmr : timer l mode register ltc : linear time counter rcr : reload/compare match register ovf : overflow udf : underflow lmr ltc rcr comparator write ovf/udf reloading match clear interrupt request interrupting circuit dvcfg2 pb and rec-ctl internal clock /128 /64 read figure 15.1 block diagram of the timer l section 15 timer l rev.3.00 jan. 10, 2007 page 323 of 1038 rej09b0328-0300 15.1.3 register configuration table 15.1 shows the register configuration of the timer l. the linear time counter (ltc) and the reload compare patch register (rcr) are being allocated to the same address. reading or writing determines the accessing register. table 15.1 register configuration name abbrev. r/w size initial value address * timer l mode register lmr r/w byte h'30 h'd112 linear time counter ltc r byte h'00 h'd113 reload/compare match register rcr w byte h'00 h'd113 note: * lower 16 bits of the address. section 15 timer l rev.3.00 jan. 10, 2007 page 324 of 1038 rej09b0328-0300 15.2 descriptions of re spective registers 15.2.1 timer l mode register (lmr) 0 0 1 0 r/w 2 0 r/w 3 0 4 1 5 ? ? ? ? 1 6 0 7 r/w r/w r/w lmie 0 r /(w) * lmif lmr3 lmr2 lmr1 lmr0 note: * only 0 can be written to clear the flag. bit : initial value : r/w : the timer l mode register (lmr) is an 8-bit read/write register which works to control the interrupts, to select between up-counting and down-counting and to select the clock source. when reset, the lmr is initialized to h'30. bit 7 ? timer l interrupt requesting flag (lmif): this is the timer l interrupt requesting flag. it indicates occurrence of overflow or underflow of the ltc or occurrence of compare match clear. bit 7 lmif description 0 [clearing condition] (initial value) when 0 is written after reading 1 1 [setting condition] when the ltc overflows, underflows or when compare match clear has occurred bit 6 ? enabling interrupt of the timer l (lmie): this bit works to permit/prohibit occurrence of interrupt of the timer l when the ltc overflows, underflows or when compare match clear has occurred. bit 6 lmie description 0 prohibits occurrence of interrupt of the timer l (initial value) 1 permits occurrence of interrupt of the timer l bits 5 and 4 ? reserved: when they are read, 1 will always be readout. writes are disabled. bit 3 ? up-count/down-count control (lmr3): this bit is for selection if the timer l is to be controlled to the up-counting function or down-counting function. section 15 timer l rev.3.00 jan. 10, 2007 page 325 of 1038 rej09b0328-0300 (1) when controlled to the up-counting function ? when any other values than h'00 are input to the rcr, the ltc will be cleared to h'00 before starting counting up. when the ltc value and the rcr value match, the ltc will be cleared to h'00. also, interrupt requests will be issued by the match signal. (compare patch clear function) ? when h'00 is set to the rcr, the counter makes 8-bit interval timer operation to issue a interrupt request when overflowing occurs. (interval timer function) (2) when controlled to the down-counting function ? when a value is set to the rcr, the set value is reloaded to the ltc and counting down starts from that value. when the ltc underflows, the value of the rcr will be reloaded to the ltc. also, when the ltc underflows, a inte rrupt request will be issued. (auto reload timer function) bit 3 lmr3 description 0 controlling to the up-counting function (initial value) 1 controlling to the up-counting function bits 2 to 0 ? clock selection (lmr2 to lmr0): the bits lmr2 to lmr0 work to select the clock to input to the timer l. selection of the leading edge or the trailing edge is workable for counting by the pb and the rec-ctl. bit 2 bit 1 bit 0 lmr2 lmr1 lmr0 description 0 counts at the rising edge of the pb and rec-ctl (initial value) 0 1 counts at the falling edge of the pb and rec-ctl 0 1 * counts the dvcfg2 1 0 * counts at /128 of the internal clock 1 * counts at /64 of the internal clock legend: * don't care. section 15 timer l rev.3.00 jan. 10, 2007 page 326 of 1038 rej09b0328-0300 15.2.2 linear time counter (ltc) 0 0 1 0 r 2 0 3 0 4 5 6 0 7 r rr r ltc6 0 r ltc5 0 r ltc4 0 r ltc7 ltc3 ltc2 ltc1 ltc0 bit : initial value : r/w : the linear time counter (ltc) is a readable 8-bit up/down-counter. the inputting clock can be selected by the lmr2 to lmr0 bits of the lmr. when reset, the ltc is initialized to h'00. 15.2.3 reload/compare match register (rcr) 0 0 1 0 w 2 0 3 0 4 5 6 0 7 w ww w rcr6 0 w rcr5 0 w rcr4 0 w rcr7 rcr3 rcr2 rcr1 rcr0 bit : initial value : r/w : the reload/compare match register (rcr) is an 8-bit write only register. when the timer l is being controlled to the up-counting function, when a compare match value is set to the rcr, the ltc will be cleared at the same time and the ltc will then start counting up from the initial value (h'00). while, when the timer l is being controlled to the down-counting function, when a reloading value is set to the rcr, the same value will be loaded to the ltc at the same time and the ltc will then start counting up from said value. al so, when the ltc underflows, the value of the rcr will be reloaded to the ltc. when reset, the rcr is initialized to h'00. 15.2.4 module stop control register (mstpcr) 7 1 mstp15 r/w mstpcrh 6 1 mstp14 r/w 5 1 mstp13 r/w 4 1 mstp12 r/w 3 1 mstp11 r/w 2 1 mstp10 r/w 1 1 mstp9 r/w 0 1 mstp8 r/w 7 1 mstp7 r/w 6 1 mstp6 r/w 5 1 mstp5 r/w 4 1 mstp4 r/w 3 1 mstp3 r/w 2 1 mstp2 r/w 1 1 mstp1 r/w 0 1 mstp0 r/w mstpcrl bit : initial value : r/w : the mstpcr are 8-bit read/write twin registers which work to control the module stop mode. when the mstp12 bit is set to 1, the timer l stops its operation at the ending point of the bus cycle to shift to the module stop mode. for more information, see section 4.5, module stop mode. when reset, the mstpcr is initialized to h'ffff. section 15 timer l rev.3.00 jan. 10, 2007 page 327 of 1038 rej09b0328-0300 bit 4 ? module stop (mstp12): this bit works to designate the module stop mode for the timer l. mstpcrh bit 4 mstp12 description 0 cancels the module stop mode of the timer l 1 sets the module stop mode of the timer l (initial value) 15.3 operation the timer l is an 8-bit up/down counter. the inputting clock for the timer l can be selected by the lmr2 to lmr0 bits of the lmr from the choices of the internal clock ( /128 and /64), dvcdg2, pb and rec-ctl. the timer l is provided with three different types of operation modes, namely, the compare match clear mode when controlled to the up-counting function, the auto reloading mode when controlled to the down-counting function and the interval timer mode. respective operation modes and operation methods will be explained below. 15.3.1 compare match clear operation when the lmr3 bit of the lmr is cleared to 0, the timer l will be controlled to the up-counting function. when any other values than h'00 are written into the rcr, the ltc will be cleared to h'00 simultaneously before starting counting up. figure 15.2 shows the clear timing of the ltc. when the ltc value and the rcr value match (compare match), the ltc readings will be cleared to h'00 to resume counting from h'00. figure 15.3 indicated on the next page shows the compare match clear timing. section 15 timer l rev.3.00 jan. 10, 2007 page 328 of 1038 rej09b0328-0300 rcr ltc write signal 1 state n h'00 figure 15.2 rcr writing and ltc clearing timing chart ltc rcr n h'00 n ? 1 n interrupt request count-up signal compare match clear signal pb-ctl figure 15.3 compare matc h clearing timing chart (in case the rising edge of the pb-ctl is selected) section 16 timer r rev.3.00 jan. 10, 2007 page 329 of 1038 rej09b0328-0300 section 16 timer r 16.1 overview the timer r consists of triple 8-bit down-counters. it carries vcr mode identification function and slow tracking function in addition to the reloading function and event counter function. 16.1.1 features the timer r consists of triple 8-bit reloading timers. by combining the functions of three units of reloading timers/counters and by combining three units of timers, it can be used for the following applications: ? applications making use of the functions of three units of reloading timers. ? for identification of the vcr mode. ? for reel controls. ? for acceleration and braking of the capstan motor when being applied to intermittent movements. ? slow tracking mono-multi applications. 16.1.2 block diagram the timer r consists of three units of reload timer counters, namely, two units of reload timer counters equipped with capturing function (tmr u-1 and tmru-2) and a unit of reload timer counter (tmru-3). figure 16.1 is a block diagram of the timer r. section 16 timer r rev.3.00 jan. 10, 2007 page 330 of 1038 rej09b0328-0300 notes: internal bus internal bus clock sources dvctl cfg clock selection (2 bits) reloading register (8 bits) down-counter (8 bits) capture register (8 bits) tmri2 interrupt request tmri1 interrupt request tmri3 interrupt request tmru-1 tmrcp1 * 2 under- flow tmru-3 underflow * 1 tmrl3 ps31, 30 external signals irq3 /1024 /2048 /4096 clock source /64 /128 /256 clock sources /4 /256 /512 down-counter (8 bits) latch clock selection clock selection (2 bits) resetting available/ not available cp/ slm slw capf capture register (8 bits) down-counter (8 bits) reloading register (8 bits) acceleration/ braking reloading available/ not available reloading clock selection reloading register (8 bits) rld/ cap clock selection (2 bits) cps lat ps21,20 clr2 res res tmrcp2 under- flow tmru-2 cfg mask f/f r s q r s q acceleration braking ac/br tmrl2 rld rlck tmrl1 ps11, 10 interrupting circuit 1. when the dvctl is being used as the clock source, reloading will be made when the counter underflows and when the dividing clock is being used as the clock source, reloading will be made by the dvctl. 2. when the lat bit = 0, the capture signal against the tmru-1 will not be output. figure 16.1 block diagram of the timer r section 16 timer r rev.3.00 jan. 10, 2007 page 331 of 1038 rej09b0328-0300 16.1.3 pin configuration table 16.1 shows the pin configuration of the timer r. table 16.1 pin configuration name abbrev. i/o function input capture inputting pin irq3 input input capture inputting for the timer r 16.1.4 register configuration table 16.2 shows the register configuration of the timer r. table 16.2 register configuration name abbrev. r/w size initial value address timer r mode register 1 tmrm1 r/w byte h'00 h'd118 timer r mode register 2 tmrm2 r/w byte h'00 h'd119 timer r control/status register tmrcs r/w byte h'03 h'd11f timer r capture register 1 tmrcp1 r byte h'ff h'd11a timer r capture register 2 tmrcp2 r byte h'ff h'd11b timer r load register 1 tmrl1 w byte h'ff h'd11c timer r load register 2 tmrl2 w byte h'ff h'd11d timer r load register 3 tmrl3 w byte h'ff h'd11e note: memories of respective registers will be preserved even under the low power consumption mode. nonetheless, the capf flag and slw flag of the tmrm2 will be cleared to 0. section 16 timer r rev.3.00 jan. 10, 2007 page 332 of 1038 rej09b0328-0300 16.2 descriptions of re spective registers 16.2.1 timer r mode register 1 (tmrm1) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 0 6 0 7 r/w r/w r/w rld r/w ac/br 0 r/w clr2 rlck ps21 ps20 rld/cap cps bit : initial value : r/w : the timer r mode register 1 (tmrm1) works to control the acceleration and braking processes and to select the inputting clock for the tmru-2. this is an 8-bit read/write register. when reset, the tmrm1 is initialized to h'00. bit 7 ? selecting clearing/not cl earing of tmru-2 (clr2): this bit is used for selecting if the tmru-2 counter reading is to be cleared or not as it is captured. bit 7 clr2 description 0 tmru-2 counter reading is not to be cleared as soon as it is captured. (initial value) 1 tmru-2 counter reading is to be cleared as soon as it is captured bit 6 ? selecting the acceleration/bra king processing (ac/br): this bit works to control occurrences of interrupt requests to detect comple tion of acceleration or braking while the capstan motor is making intermittent revolutions. for more information, see section 16.3.6, accel eration and braking processes of the capstan motor. bit 6 ac/br description 0 acceleration (initial value) 1 braking section 16 timer r rev.3.00 jan. 10, 2007 page 333 of 1038 rej09b0328-0300 bit 5 ? selection if using the tmru-2 for reloading or not doing so (rld): this bit is used for selecting if the tmru-2 reload function is to be turned on or not. bit 5 rld description 0 not using the tmru-2 as the reload timer (initial value) 1 using the tmru-2 as the reload timer bit 4 ? selection of the reloading ti ming for the tmru-2 (rlck): this bit works to select if the tmru-2 is reloading by the cfg or by underflowing of the tmru-2 counter. this choice is valid only when the bit 5 (rld) is being set to 1. bit 4 rlck description 0 reloading at the rising edge of the cfg (initial value) 1 reloading by underflowing of the tmru-2 bits 3 and 2: selecting the clock source for the tmru-2 (ps21 and ps20): these bits work to select the inputting clock to the tmru-2. bit 3 bit 2 ps21 ps20 description 0 counting by underflowing of the tmru-1 (initial value) 0 1 counting by the pss, /256 1 0 counting by the pss, /128 1 counting by the pss, /64 bit 1 ? selection of the operation mo de of the tmru-1 (rld/cap): this bit works to select if the operation mode of the tmru-1 is reload timer mode or capture timer mode. under the capture timer mode, reloading operatio n will not be made. also, the counter reading will be cleared as soon as capture has been made. bit 1 rld/cap description 0 the tmru-1 works as the reloading timer (initial value) 1 the tmru-1 works as the capture timer section 16 timer r rev.3.00 jan. 10, 2007 page 334 of 1038 rej09b0328-0300 bit 0 ? selection of the capture si gnals of the tmru-1 (cps): in combination with the lat bit (bit 7) of the tmr2, this bit works to select the capture signals of the tmru-1. this bit becomes valid when the lat bit is being set to 1. it will also become valid when the rld/cap bit (bit 1) is being set to 1. nonetheless, it will be invalid when the rld/cap bit (bit 1) is being set to 0. bit 0 cps description 0 capture signals at the rising edge of the cfg (initial value) 1 capture signals at the edge of the irq3 16.2.2 timer r mode register 2 (tmrm2) 0 0 1 0 r/(w) * 2 0 r/w 3 0 4 0 r/w 5 0 6 0 7 r/(w) * r/w r/w ps10 r/w ps11 0 r/w lat ps31 ps30 cp/slm capf slw bit : initial value : r/w : note: * the capf bit and the slw bit, respectively, works to latch the interrupt causes and writing 0 only is valid. consequently, when these bits are being set to 1, respective interrupt requests will not be issued. therefore, it is necessary to check these bits during the course of the interrupt processing routine to have them cleared. also, priority is given to the set and, when an interrupt cause occur while the a clearing command (bclr, mov, etc.) is being executed, the capf bit and the slw bit will not be cleared respectively and it thus becomes necessary to pay attention to the clearing timing. the timer r mode register 2 (tmrm2) is an 8-bit read/write register which works to identify the operation mode and to control the slow tracking processing. when reset, the tmrm2 is initialized to h'00. section 16 timer r rev.3.00 jan. 10, 2007 page 335 of 1038 rej09b0328-0300 bit 7 ? selection of the capture sign als of the tmru-2 (lat): in combination with the cps bit (bit 0) of the tmrm1, this bit works to select the capture signals of the tmru-2. tmrm2 tmrm1 bit 7 bit 0 lat cps description 0 * captures when the tmru-3 underflows (initial value) 1 0 captures at the rising edge of the cfg 1 captures at the edge of the irq3 legend: * don't care. bits 6 and 5 ? selecting the clock source for the tmru-1 (ps11 and ps10): these bits work to select the inputting clock to the tmru-1. bit 6 bit 5 ps11 ps10 description 0 counting at the rising edge of the cfg (initial value) 0 1 counting by the pss, /4 1 0 counting by the pss, /256 1 counting by the pss, /512 bits 4 and 3 ? selecting the clock source for the tmru-3 (ps31 and ps30): these bits work to select the inputting clock to the tmru-3. bit 4 bit 3 ps31 ps30 description 0 counting at the rising edge of the dvctl from the dividing circuit. (initial value) 0 1 counting by the pss, /4096 1 0 counting by the pss, /2048 1 counting by the pss, /1024 section 16 timer r rev.3.00 jan. 10, 2007 page 336 of 1038 rej09b0328-0300 bit 2 ? selection of interrupt causes (cp/slm): this bit works to select the interrupt causes for the tmri3. bit 2 cp/slm description 0 makes interrupt requests upon the capture signals of the tmru-2 valid (initial value) 1 makes interrupt requests upon ending of the slow tracking mono-multi valid bit 1 ? capture signal flag (capf): this is a flag being set out by the capture signal of the tmru-2. although both reading/ writing are possible, 0 only is valid for writing. also, priority is being given to the set and, when the "capture signal" and "writing 0" occur simultaneously, this flag bit remains being set to 1 and the interrupt request will not be issued and it is necessary to be attentive about this fact. when the cp/slm bit (bit 2) is being set to 1, this capf bit should always be set to 0. the capf flag is cleared to 0 under the low power consumption mode. bit 1 capf description 0 [clearing condition] (initial value) when 0 is written after reading 1 1 [setting condition] at occurrences of the tmru-2 capture signals while the cp/slm bit is being set to 0 bit 0 ? slow tracking mono-multi flag (slw): this is a flag being set out when the slow tracking mono-multi processing ends. although both reading/writing are possible, 0 only is valid for writing. also, priority is being given to the set and, when "ending of the slow tracking mono-multi processing" and "writing 0" occur simultaneously, this flag bit remains being set to 1 and the interrupt request will not be issued and it is necessary to be atten tive about this fact. when the cp/slm bit (bit 2) is being set to 0, this slw bit should always be set to 0. the slw flag is cleared to 0 under the low power consumption mode. bit 0 slw description 0 [clearing condition] (initial value) when 0 is written after reading 1 1 [setting condition] when the slow tracking mono-multi processing ends while the cp/slm bit is being set to 1 section 16 timer r rev.3.00 jan. 10, 2007 page 337 of 1038 rej09b0328-0300 16.2.3 timer r control/status register (tmrcs) 0 1 1 ? ? ? ? 1 2 0 r/(w) * 3 0 4 0 r/(w) * 5 0 6 0 7 r/(w) * r/w tmri1e r/w tmri2e 0 r/w tmri3e tmri3 tmri2 tmri1 note: * only 0 can be written to clear the flag. bit : initial value : r/w : the timer r control/status register (tmrcs) works to control the interrupts of the timer r. the tmrcs is an 8-bit read/write register. when reset, the tmrcs is initialized to h'03. bit 7 ? enabling the tmri3 interrupt (tmri3e): this bit works to permit/prohibit occurrence of the tmri3 interrupt when an interrupt cause being selected by the cp/slm bit of the tmrm2 has occurred, such as occurrences of the tmru -2 capture signals or when the slow tracking mono-multi processing ends, and the tmri3 has been set to 1. bit 7 tmri3e description 0 prohibits occurrences of tmri3 interrupts (initial value) 1 permits occurrences of tmri3 interrupts bit 6 ? enabling the tmri2 interrupt (tmri2e): this bit works to permit/prohibit occurrence of the tmri2 interrupt when the tmri2 has been set to 1 by issuance of the underflow signal of the tmru-2 or by ending of the slow tracking mono-multi processing. bit 6 tmri2e description 0 prohibits occurrences of tmri2 interrupts (initial value) 1 permits occurrences of tmri2 interrupts section 16 timer r rev.3.00 jan. 10, 2007 page 338 of 1038 rej09b0328-0300 bit 5 ? enabling the tmri1 interrupt (tmri1e): this bit works to permit/prohibit occurrence of the tmri1 interrupt when the tmri1 has been set to 1 by issuance of the underflow signal of the tmru-1. bit 5 tmri1e description 0 prohibits occurrences of tmri1 interrupts (initial value) 1 permits occurrences of tmri1 interrupts bit 4 ? tmri3 interrupt requesting flag (tmri3): this is the tmri3 interrupt requesting flag. it indicates occurrence of an in terrupt cause being selected by the cp/slm bit of the tmrm2, such as occurrences of the tmru-2 capture signals or ending of the slow tracking mono-multi processing. bit 4 tmri3 description 0 [clearing condition] (initial value) when 0 is written after reading 1 1 [setting condition] at occurrence of the interrupt cause being selected by the cp/slm bit of the tmrm2 bit 3 ? tmri2 interrupt requesting flag (tmri2): this is the tmri2 interrupt requesting flag. it indicates occurrences of the tmru-2 underflow signals or ending of the acceleration/braking processing of the capstan motor. bit 3 tmri2 description 0 [clearing condition] (initial value) when 0 is written after reading 1 1 [setting condition] at occurrences of the tmru-2 underflow signals or ending of the acceleration/ braking processing of the capstan motor section 16 timer r rev.3.00 jan. 10, 2007 page 339 of 1038 rej09b0328-0300 bit 2 ? tmri1 interrupt requesting flag (tmri1): this is the tmri1 interrupt requesting flag. it indicates occurrences of the tmru-1 underflow signals. bit 2 tmri1 description 0 [clearing condition] (initial value) when 0 is written after reading 1. 1 [setting condition] when the tmru-1 underflows. bits 1 and 0 ? reserved: when they are read, 1 will always be readout. writes are disabled. 16.2.4 timer r capture register 1 (tmrcp1) 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 r tmrc17 r tmrc16 r tmrc15 r tmrc14 r tmrc13 r tmrc12 r tmrc11 r tmrc10 bit : initial value : r/w : the timer r capture register 1 (t mrcp1) works to store the capture data of the tmru-1. during the course of the capturing operation, the tmru-1 counter readings are captured by the tmrcp1 at the cfg edge or the irq3 edge. the capturing operation of the tmru-1 is being performed using 16 bits, in combination with the capturing operation of the tmru-2. the tmrcp1 is an 8-bit read only register. when reset, the tmrcs is initialized to h'ff. notes: 1. when the tmrcp1 is readout while th e capture signal is being received, the reading data become unstable. pay attention to the timing for reading out. 2. when a shift to the low power consumption mode is made while the capturing operating is in progress, the counter reading becomes unstable. after returning to the active mode, always write "h'ff" into the tmrl1 to initialize the counter. section 16 timer r rev.3.00 jan. 10, 2007 page 340 of 1038 rej09b0328-0300 16.2.5 timer r capture register 2 (tmrcp2) 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 r tmrc27 r tmrc26 r tmrc25 r tmrc24 r tmrc23 r tmrc22 r tmrc21 r tmrc20 bit : initial value : r/w : the timer r capture register 2 (t mrcp2) works to store the capture data of the tmru-2. at each cfg edge, irq3 edge, or at occurrence of underflow of the tmru-3, the tmru-2 counter readings are captured by the tmrcp2. the tmrcp2 is an 8-bit read only register. when reset, the tmrcs will be initialized into h'ff. notes: 1. when the tmrcp2 is readout while th e capture signal is being received, the reading data become unstable. pay attention to the timing for reading out. 2. when a shift to the low power consumption mode is made, the counter reading becomes unstable. after returning to the active mode, always write "h'ff" into the tmrl2 to initialize the counter. 16.2.6 timer r load register 1 (tmrl1) 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 w tmr17 w tmr16 w tmr15 w tmr14 w tmr13 w tmr12 w tmr11 w tmr10 bit : initial value : r/w : the timer r load register 1 (tmrl1) is an 8-bit write only register which works to set the load value of the tmru-1. when a load value is set to the tmrl1, the same value will be set to the tmru-1 counter simultaneously and the counter starts counting down from the set value. also, when the counter underflows during the course of the reload timer operation, the tmrl1 value will be set to the counter. when reset, the tmrl1 is initialized to h'ff. section 16 timer r rev.3.00 jan. 10, 2007 page 341 of 1038 rej09b0328-0300 16.2.7 timer r load register 2 (tmrl2) 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 w tmr27 w tmr26 w tmr25 w tmr24 w tmr23 w tmr22 w tmr21 w tmr20 bit : initial value : r/w : the timer r load register 2 (tmrl2) is an 8-bit write only register which works to set the load value of the tmru-2. when a load value is set to the tmrl2, the same value will be set to the tmru-2 counter simultaneously and the counter starts counting down from the set value. also, when the counter underflows or a cfg edge is detected during the course of the reload timer operation, the tmrl2 value will be set to the counter. when reset, the tmrl2 is initialized to h'ff. 16.2.8 timer r load register 3 (tmrl3) 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 w tmr37 w tmr36 w tmr35 w tmr34 w tmr33 w tmr32 w tmr31 w tmr30 bit : initial value : r/w : the timer r load register 3 (tmrl3) is an 8-bit write only register which works to set the load value of the tmru-3. when a load value is set to the tmrl3, the same value will be set to the tmru-3 counter simultaneously and the counter starts counting down from the set value. also, when the counter underflows or a dvctl edge is detected, the tmrl 2 value will be set to the counter. (reloading will be made by the underflowing signals when th e dvctl signal is selected as the clock source, and reloading will be made by the dvctl signals when the dividing clock is selected as the clock source.) when reset, the tmrl3 is initialized to h'ff. section 16 timer r rev.3.00 jan. 10, 2007 page 342 of 1038 rej09b0328-0300 16.2.9 module stop control register (mstpcr) 7 1 mstp15 r/w mstpcrh 6 1 mstp14 r/w 5 1 mstp13 r/w 4 1 mstp12 r/w 3 1 mstp11 r/w 2 1 mstp10 r/w 1 1 mstp9 r/w 0 1 mstp8 r/w 7 1 mstp7 r/w 6 1 mstp6 r/w 5 1 mstp5 r/w 4 1 mstp4 r/w 3 1 mstp3 r/w 2 1 mstp2 r/w 1 1 mstp1 r/w 0 1 mstp0 r/w mstpcrl bit : initial value : r/w : the mstpcr are 8-bit read/write twin registers which work to control the module stop mode. when the mstp11 bit is set to 1, the timer r stops its operation at the ending point of the bus cycle to shift to the module stop mode. for more information, see section 4.5, module stop mode. when reset, the mstpcr is initialized to h'ffff. bit 3 ? module stop (mstp11): this bit works to designate the module stop mode for the timer r. mstpcrh bit 3 mstp11 description 0 cancels the module stop mode of the timer r 1 sets the module stop mode of the timer r (initial value) section 16 timer r rev.3.00 jan. 10, 2007 page 343 of 1038 rej09b0328-0300 16.3 operation 16.3.1 reload timer counter equipped with capturing function tmru-1 the reload timer counter equipped with capturing function, tmru-1, consists of an 8-bit down- counter, a reloading register and a capture register. the clock source can be selected from among the l eading edge of the cfg signals and three types of dividing clocks. it is also selectable whether using it as a reload counter or as a capture counter. even when the capturing function is selected, the counter readings can be updated by writing the values into the reloading register. when the counter underflows, the tmri 1 interrupt request will be issued. the initial values of the tmru-1 counter, reloading register and capturing register are all h'ff. (1) operation of the reload timer when a value is written into to the reloading register, the same value will be written into the counter simultaneously. also, when the counter underflows, the reloading register value will be reloaded to the counter. the tmru-1 is a dividing circuit for the cfg. in combination with the tmru-2 and tmru-3, it can also be used for the mode identification purpose. (2) capturing operation capturing operation is carried out in combination with the tmru-2 using the combined 16 bits. it can be so programmed that the counter may be cleared by the capture signal. the cfg edges or irq3 edges are used as the capture signa ls. it is possible to issue the tmri3 interrupt request by the capture signal. in addition to the capturing function being worked out in combination with the tmru-2, the tmru-1 can be used as a 16-bit cfg counter. selecting the irq3 as the capture signal, the cfg within the duration of the reel pulse being input into the irq3 pin can be counted by the tmru-1. section 16 timer r rev.3.00 jan. 10, 2007 page 344 of 1038 rej09b0328-0300 16.3.2 reload timer counter equipped with capturing function tmru-2 the reload timer counter equipped with capturing function, tmru-2, consists of an 8-bit down- counter, a reloading register and a capture register. the clock source can be selected from among the undedrflowing signal of the tmru-1 and three types of dividing clocks. also, although the reloading function is workable during its capturing operation, equipping or not of the reloading function is selectable. even when without-reloading- function is chosen, the counter reading can be updated by writing the values to the reloading register. when the counter underflows, the tmri 2 interrupt request will be issued. the initial values of the tmru-2 counter, reloading register and capturing register are all h'ff. (1) operation of the reload timer when a value is written into to the reloading register, the same value will be written into the counter, simultaneously. also, when the counter underflows, the reloading register value will be reloaded to the counter. the tmru-2 can make acceleration and braking wo rk for the capstan motor using the reload timer operation. (2) capturing operation using the capture signals, the counter reading can be latched into the capturing register. as the capture signal, you can choose from among edges of the cfg, edges of the irq3 or the underflow signals of the tmru-3. it is possible to issue the tmri3 interrupt request by the capture signal. the capturing function (stopping the reloading function) of the tmru-2, in combination with the tmru-1 and tmru-3, can also be used for the mode identification purpose. 16.3.3 reload counter timer tmru-3 the reload counter timer tmru-3 consists of an 8-bit down-counter and a reloading register. its clock source can be selected from between the undedrflowing signal of the counter and the edges of the dvctl signals. (when the dvctl signal is sel ected as the clock source, reloading will be effected by the underflowing signals and when the dividing clock is selected as the clock source, reloading will be effected by the dvctl signals.) the reloading signal works to reload the reloading register value into the counter. also, when a value is written into to th e reloading register, the same value will be written into the counter, simultaneously. the initial values of the counter and the reloading register are h'ff. the underflowing signals can be used as the capturing signal for the tmru-2. the tmru-3 can also be used as a dividing circuit for the dvctl. also, in combination with the tmru-1 and tmru-2 (capturing function), the tmru-3 can be used for the mode identification section 16 timer r rev.3.00 jan. 10, 2007 page 345 of 1038 rej09b0328-0300 purpose. since the divided signals of the dvctl are being used as the clock source, ctl signals (dvctl) conforming to the double speed can be input when making searches. these dvctl signals can also be used for phase controls of the capstan motor. also, by selecting the dividing clock as the clock source, it is possible to make a delay with the edges of the dvctl to provide the slow tracking mono-multi function. 16.3.4 mode identification when making mode identification (2/4/6 identification) of the sp/lp/ep modes of reproducing tapes, the tmru-1 (cfg dividing circuit), tmru-2 (capturing function/without reloading function) and tmru-3 (dvctl dividing circuit) of the timer r should be used. the timer r will become to the aforementioned status after a reset. under the aforementioned status, the divided cfg s hould be written into the reloading register of the tmru-1 and divided dvctl should be written into the reloading register of the tmru-3. when the tmru-3 underflows, the counter value of the tmru-2 is captured. such capturing register value represents the number of the cfg within the dvctl cycle. as aforementioned, the timer r can work to count the number of the cfg corresponding to "n" times of dvctl's or to identify the mode being searched. for exemplary settings for the register, see section 16.5.1, mode identification. 16.3.5 reeling controls cfg counts can be captured by making 16-bit capturing operation combining the tmru-1 and tmru-2. by choosing the irq3 as the capture signal, and by counting the cfg within the duration of the reel pulse being input through the irq3 pin, reeling controls, etc. can be effected. for exemplary settings for the register, see section 16.5.2, reeling controls. 16.3.6 acceleration and braking processes of the capstan motor when making intermittent movements such as those for slow reproductions or for still reproductions, it is necessary to conduct quick accelerations and abrupt stoppings of the capstan motor. the acceleration and braking processes will function to check if the revolution of a capstan motor has reached the prescribed rate when accelerated or braked . for this purpose, the tmru-2 (reloading function) should be used. when making accelerations: (1) set the ac/br bit of the tmrm 1 to acceleration. (set to 1). al so, use the rising edge of the cfg as the reloading signal. section 16 timer r rev.3.00 jan. 10, 2007 page 346 of 1038 rej09b0328-0300 (2) set the prescribed tim e on the cfg frequency to deem as the acceleration has been finished, into the reloading register. (3) the tmru-2 will work to down-count the reloading data. (4) in case the acceleration has not been finished (in case the cfg signal is not input even when the prescribed time has elapsed = underflowing of down-counting has occurred), such underflowing works to set to cfg mask f/f (mas king movement) and the reload timer will be cleared by the cfg. (5) when the acceleration has been finished (when the cfg signal is input before the prescribed time has elapsed = reloading movement has been made before the down counter underflows), an interrupt request will be issued because of the cfg. when making breaking: (1) set the ac/br bit of the tmrm1 to braking. (clear to 0). also, use the rising edge of the cfg as the reloading signal. (2) set the prescribed time on th e cfg frequency to deem as the braking has been finished, into the reloading register. (3) the tmru-2 will work to down-count the reloading data. (4) in case the braking has not been finished (when the cfg signal is input before the prescribed time has elapsed = reloading movement has been made before the down counter underflows), the reload timer movement will continue. (5) when the acceleration has been finished (whe n the cfg signal is not input even when the prescribed time has elapsed = underflowing of down-counting has occurred), interrupt request will be issued because of the underflowing signal. the acceleration and braking processes should be employed when making special reproductions, in combination with the slow tracking mono-multi function being outlined below. for exemplary settings for the register, see secti on 16.5.4, acceleration and braking processes of the capstan motor. 16.3.7 slow tracking mono-multi function when performing slow reproductions or still reproductions, the braking timing for the capstan motor is determined by use of the edge of the dvctl signal. the slow tracking mono-multi function works to measure the time from the rising edge of the dvctl signal down to the desired point to issue the interrupt request. in actual programming, this interrupt should be used to activate the brake of the capstan motor. the tmru-3 should be used to perform time measurements for the slow tracking mono-multi function. also, the braking process can be made using the tmru-2. figure 16.2 below shows the exemplary time series movements when a slow reproduction is being section 16 timer r rev.3.00 jan. 10, 2007 page 347 of 1038 rej09b0328-0300 performed. for exemplary settings for the register, see section 16.5.3, slow tracking mono-multi function. hsw fg acceleration detection compensation for vertical vibrations (supplementary v-pulse) dvctl interrupt reloading reverse rotation frame feeds compensation for horizontal vibrations compensation for horizontal vibrations braking process acceleration process slow tracking delay c.rotary h.ampsw accelerating the capstan motor braking the drum motor slow tracking moto-multi braking the capstan motor servo hi-z legend: hi-z : high impedance state in case of 4-head sp mode. in case of 2-head application, h.ampsw and c.rotary should be "low". fg stopping detection forward rotation figure 16.2 exemplary time series movements when a slow reproduction is being performed section 16 timer r rev.3.00 jan. 10, 2007 page 348 of 1038 rej09b0328-0300 16.4 interrupt cause the interrupt causes for the timer r are 3-cause s of the tmri3 bit through tmri1 bit of the timer r control/status register (tmrcs). (a) interrupts being caused by the underflowing of the tmru-1 (tmri1) these interrupts will constitute the timing for reloading with the tmru-1. (b) interrupts being caused by the underflowing of the tmru-2 or by an end of the acceleration or braking process (tmri2) when interrupts occur at the reload timing of the tmru-2, clear the ac/br (acceleration/braking) bit of the timer r mode register 1 (tmrm1) to 0. (c) interrupts being caused by the capture signals of the tmru-3 and by ending the slow tracking mono-multi process (tmri3) since these two interrupt causes are constituting the or, it becomes necessary to determine which interrupt cause is occurring using the software. respective interrupt causes are being set to the capf flag or the slw flag of the timer r mode register 2 (tmrm2), have the software determine which. since the capf flag and the slw flag will not be cleared automatically, program the software to clear them. (writing 0 only is valid for these flags.) unless these flag s are cleared, detection of the next cause becomes unworkable. also, if the cp/slm bit is changed leaving these flags un-cleared as they are, these flags will get cleared. section 16 timer r rev.3.00 jan. 10, 2007 page 349 of 1038 rej09b0328-0300 16.5 exemplary settings fo r respective functions 16.5.1 mode identification when making mode identification (2/4/6 identification) of the sp/lp/ep modes of reproducing tapes, the tmru-1 (cfg dividing circuit), tmru-2 (capturing function/without reloading function) and tmru-3 (dvctl dividing circuit) of the timer r should be used. the timer r will become to the aforementioned status after a reset. under the aforementioned status, the divided cfg s hould be written into the reloading register of the tmru-1 and divided dvctl should be written into the reloading register of the tmru-3. when the tmru-3 underflows, the counter value of the tmru-2 is captured. such capturing register value represents the number of the cfg within the dvctl cycle. as aforementioned, the timer r can work to count the number of the cfg corresponding to "n" times of dvctl's or to identify the mode being searched. ? exemplary settings (1) setting the timer r mode register 1 (tmrm1) clr2 bit (bit 7) = 1: works to cl ear after making the tmru-2 capture. rld bit (bit 5) = 0: sets the tmru-3 without reloading function. ps21 and ps20 (bits 3 and 2) = (0 and 0): the underflowing signals of the tmru-1 are to be used as the clock source for the tmru-2. rld/cap bit (bit 1) = 0: the tmru-1 has been set to make the reload timer operation. (2) setting the timer r mode register 2 (tmrm2) lat bit (bit 7) = 0: the underflowing signals of the tmru-3 are to be used as the capture signal for the tmru-2. ps11 and ps10 (bits 6 and 5) = (0 and 0): the leading edge of the cfg signal is to be used as the clock source for the tmru-1. ps31 and ps30 (bits 4 and 3) = (0 and 0): the leading edge of the dvctl signal is to be used as the clock source for the tmru-3. cp/slm bit (bit 2) = 0: the capture signal is to work to issue the tmri3 interrupt request. (3) setting the timer r load register 1 (tmrl1) set the dividing value for the cfg. the set value should become (n - 1) when divided by "n". (4) setting the timer r load register 3 (tmrl3) set the dividing value for the dvctl. the set value should become (n - 1) when divided by "n". section 16 timer r rev.3.00 jan. 10, 2007 page 350 of 1038 rej09b0328-0300 16.5.2 reeling controls cfg counts can be captured by making 16-bit capturing operation combining the tmru-1 and tmru-2. by choosing the irq3 as the capture signal, and by counting the cfg within the duration of the reel pulse being input through the irq3 pin, reeling controls, etc. can be effected. ? exemplary settings (1) setting p13/ irq3 pin as the irq3 pin set the pmr13 bit (bit 3) of the port mode register 1 (pmr1) to 1. see section 22.2.3, port mode register 1 (pmr1). (2) setting the timer r mode register 1 (tmrm1) clr2 bit (bit 7) = 1: works to cl ear after making the tmru-2 capture. ps21 and ps20 (bits 3 and 2) = (0 and 0): the underflowing signals of the tmru-1 are to be used as the clock source for the tmru-2. rld/cap bit (bit 1) = 1: the tmru-1 has been set to make the capturing operation. cps bit (bit 0) = 1: the edge of the irq3 signal is to be used as the capture signal for the tmru-1 and tmru-2. (3) setting the timer r mode register 2 (tmrm2) lat bit (bit 7) = 1: the edge of the irq3 signal is to be used as the capture signal for the tmru-1 and tmru-2. ps11 and ps10 (bits 6 and 5) = (0 and 0): the rising edge of the cfg signal is to be used as the clock source for the tmru-1. cp/slm bit (bit 2) = 0: the capture signal is to work to issue the tmri3 interrupt request. 16.5.3 slow tracking mono-multi function when performing slow reproductions or still reproductions, the braking timing for the capstan motor is determined by use of the edge of the dvctl signal. the slow tracking mono-multi function works to measure the time from the leading edge of the dvctl signal down to the desired point to issue the interrupt request. in actual programming, this interrupt should be used to activate the brake of the caps tan motor. the tmru-3 should be used to perform time measurements for the slow tracking mono-multi function. also, the braking process can be made using the tmru-2. ? exemplary settings (1) setting the timer r mode register 2 (tmrm2) ps31 and ps30 (bits 4 and 3) = other than (0, 0): the dividing clock is to be used as the clock source for the tmru-3. section 16 timer r rev.3.00 jan. 10, 2007 page 351 of 1038 rej09b0328-0300 cp/slm bit (bit 2) = 1: the slow tracking delay signal is to work to issue the tmri3 interrupt request. (2) setting the timer r load register 3 (tmrl3) set the slow tracking delay value. when the delay count is "n", the set value should be (n - 1). regarding the delaying duration, see figure 16.2 exemplary time series movements when a slow reproduction is being performed. 16.5.4 acceleration and braking processes of the capstan motor when making intermittent movements such as those for slow reproductions or for still reproductions, it is necessary to conduct quick accelerations and abrupt stoppings of the capstan motor. the acceleration and braking processes will function to check if the revolution of a capstan motor has reached the prescribed rate when accelerated or braked . for this purpose, the tmru-2 (reloading function) should be used. the acceleration and braking processes should be employed when making special reproductions, in combination with the slow tracking mono-multi function. ? exemplary settings for the acceleration process (1) setting the timer r mode register 1 (tmrm1) ac/br bit (bit 6) = 1: acceleration process rld bit (bit 5) = 1: the tmru-2 is to be used as the reload timer. rlck bit (bit 4) = 0: the tmru-2 is to reload at the rising edge of the cfg. ps21 and ps20 (bits 3 and 2) = other than (0, 0): the dividing clock is to be used as the clock source for the tmru-2. (2) setting the timer r load register 2 (tmrl2) set the count reading for the duration until the acceleration process finishes. when the count is "n", the set value should be (n - 1). regarding the duration until the acceleration process finishes, see figure 16.2 exemplary time series movements when a slow reproduction is being performed. ? exemplary settings for the braking process (1) setting the timer r mode register 1 (tmrm1) ac/br bit (bit 6) = 0: braking process rld bit (bit 5) = 1: the tmru-2 is to be used as the reload timer. rlck bit (bit 4) = 0: the tmru-2 is to reload at the rising edge of the cfg. ps21 and ps20 (bits 3 and 2) = other than (0, 0): the dividing clock is to be used as the clock source for the tmru-2. section 16 timer r rev.3.00 jan. 10, 2007 page 352 of 1038 rej09b0328-0300 (2) setting the timer r load register 2 (tmrl2) set the count reading for the duration until the braking process finishes. when the count is "n", the set value should be (n - 1). regarding the duration until the braking process finishes, see figure 16.2 exemplary time series movements when a slow reproduction is being performed. section 17 timer x1 rev.3.00 jan. 10, 2007 page 353 of 1038 rej09b0328-0300 section 17 timer x1 17.1 overview the timer x1 is capable of outputting two different types of independent waveforms using the free running counter (frc) as the basic means and it is also applicable to measurements of the durations of input pulses and the cycles external clocks. 17.1.1 features listed below are the feat ures of the timer x1. ? choices of 4 different types of counter inpu tting clocks are available for your selection. you can select from among three diff erent types of internal clocks ( /4, /16, and /64) and the dvcfg. ? two independent output comparing functions capable of outputting two different types of independent waveforms. ? four independent input capturing functions the rising edge or falling edge can be selected for use. the buffer operation can also be designated. ? counter clearing designation is workable. the counter readings can be cleared by compare match a. ? seven types of interrupt causes comparing match 2 causes, input capture 4 causes, and overflow 1 cause are available for use and they can make respective interrupt requests independently. 17.1.2 block diagram figure 17.1 shows a block diagram of the timer x1. section 17 timer x1 rev.3.00 jan. 10, 2007 page 354 of 1038 rej09b0328-0300 internal data bus legend: tier icra icrb icrc icrd tcrx ocrb comparison circuit frc comparison circuit ocra tocr tcsrx tier input capture control output comparing output interrupt request 7 ftoa ftob ftia * (hsw) ftib * (vd) ftic * (dvctl) ftid * (nhsw) (dvcfg) /4 /16 /64 tcsrx frc ocra ocrb tcrx tocr icra icrb icrc icrd : timer interrupt enabling register : timer control/status register x : free running counter : output comparing register a : output comparing register b : timer control register x : output comparing control register : input capture register a : input capture register b : input capture register c : input capture register d note: * stands for the external terminal. ( ) stands for the internal signal. figure 17.1 block diagram of the timer x1 section 17 timer x1 rev.3.00 jan. 10, 2007 page 355 of 1038 rej09b0328-0300 17.1.3 pin configuration table 17.1 shows the pin configuration of the timer x1. table 17.1 pin configuration name abbrev. i/o function output comparing a output-pin ftoa output output pin for the output comparing a output comparing b output-pin ftob output output pin for the output comparing b input capture a input-pin ftia input input-pin for the input capture a input capture b input-pin ftib input input-pin for the input capture b input capture c input-pin ftic input input-pin for the input capture c input capture d input-pin ftid input input-pin for the input capture d section 17 timer x1 rev.3.00 jan. 10, 2007 page 356 of 1038 rej09b0328-0300 17.1.4 register configuration table 17.2 shows the register configuration of the timer x1. table 17.2 register configuration name abbrev. r/w initial value address * 3 timer interrupt enabling register tier r/w h'00 h'd100 timer control/status register x tcsrx r/ (w) * 1 h'00 h'd101 free running counter h frch r/w h'00 h'd102 free running counter l frcl r/w h'00 h'd103 output comparing register ah ocrah r/w h'ff h'd104 * 2 output comparing register al ocral r/w h'ff h'd105 * 2 output comparing register bh ocrbh r/w h'ff h'd104 * 2 output comparing register bl ocrbl r/w h'ff h'd105 * 2 timer control register x tcrx r/w h'00 h'd106 timer output comparing control register tocr r/w h'00 h'd107 input capture register ah icrah r h'00 h'd108 input capture register al icral r h'00 h'd109 input capture register bh icrbh r h'00 h'd10a input capture register bl icrbl r h'00 h'd10b input capture register ch icrch r h'00 h'd10c input capture register cl icrcl r h'00 h'd10d input capture register dh icrdh r h'00 h'd10e input capture register dl icrdl r h'00 h'd10f notes: 1. only 0 can be written to clear the flag for bits 7 to 1. bit 0 is readable/writable. 2. the addresses of the ocra and ocrb are the same. changeover between them are to be made by use of the tocr bit and ocrs bit. 3. lower 16 bits of the address. section 17 timer x1 rev.3.00 jan. 10, 2007 page 357 of 1038 rej09b0328-0300 17.2 descriptions of re spective registers 17.2.1 free running counter (frc) free running counter h (frch) free running counter l (frcl) 0 3 0 r/w 5 0 r/w 7 0 9 0 r/w 11 0 13 0 15 r/w r/w r/w 0 r/w r/w 1 0 2 0 r/w 4 0 r/w 6 0 8 0 r/w 10 0 12 0 14 frc frch frcl r/w r/w r/w r/w 0 r/w 0 bit : initial value : r/w : the frc is a 16-bit read/write up-counter which counts up by the inputting internal clock/external clock. the inputting clock is to be selected from the cks1 and cks0 of the tcrx. by the setting of the cclra bit of the tcsrx, the frc can be cleared by comparing match a. when the frc overflows (h'ffff h'0000), the ovf of the tcsrx will be set to 1. at this time, when the ovie of the tier is being set to 1, an interrupt request will be issued to the cpu. reading/writing can be made from and to the frc through the cpu at 8-bit or 16-bit. the frc is initialized to h'0000 when reset or under the standby mode, watch mode, subsleep mode, module stop mode or subactive mode. 17.2.2 output comparing register a and b (ocra and ocrb) output comparing register ah and bh (ocrah and ocrbh) output comparing register al and bl (ocral and ocrbl) 1 3 1 r/w 5 1 r/w 7 1 9 1 r/w 11 1 13 1 15 r/w r/w r/w 1 r/w r/w 1 1 2 1 r/w 4 1 r/w 6 1 8 1 r/w 10 1 12 1 14 ocra, ocrb ocrah, ocrbh ocral, ocrbl r/w r/w r/w r/w 1 r/w 0 bit : initial value : r/w : the ocr consists of twin 8-bit read/write registers (ocra and ocrb). the contents of the ocr are always being compared with the frc and, wh en the value of these two match, the ocfa and ocrb of the tcsrx will be set to 1. at this tim e, if the ociae and ocib of the tier are being set to 1, an interrupt request will be issued to the cpu. section 17 timer x1 rev.3.00 jan. 10, 2007 page 358 of 1038 rej09b0328-0300 when performing compare matching, if the oea and oeb of the tocr are being set to 1, the level value having been set to the olvla and olvlb of the tocr will be output through the ftoa and ftob pins. after resetting, 0 will be output through the ftoa and ftob pins until the first compare matching occurs. reading/writing can be made from and to the ocr through the cpu at 8-bit or 16-bit. the ocr is cleared to h'ffff when reset or under the standby mode, watch mode, subsleep mode, module stop mode or subactive mode. 17.2.3 input capture register a through d (icra through icrd) input capture register ah to dh (icrah to icrdh) input capture register al to dl (icral to icrdl) 0 3 0 r 5 0 r 7 0 9 0 r 11 0 13 0 15 r r r 0 rr 1 0 2 0 r 4 0 r 6 0 8 0 r 10 0 12 0 14 icra, icrb, icrc, icrd icrah, icrbh, icrch, icrdh icral, icrbl, icrcl, icrdl r r r r 0 r 0 bit : initial value : r/w : the icr consists of four 16-bit read only registers (icra through icrd). when the falling edge of the input capture input signal is detected, the value is transferred to the icra through icrd. at this time, the icfa through icfd of the tcsrx are set to 1 simultaneously. at this time, if the idiae through idide of the tcrx are all being set to 1, due interrupt request will be issued to the cpu. the ed ge of the input signal can be selected by setting the iedga through iedgd of the tcrx. also, the icrc and icrd can be used as the buffer register, respectively, of the icra and icrb by setting the bufea and bufeb of the tcrx to perform buffer operations. figure 17.2 shows the connections necessary when using the icrc as the buffer register of the icra. (bufea = 1) when the icrc is used as the buffer of the icra, by setting iedga iedgc, both of the rising and falling edges can be designated for use. in case of iedga = iedgc, either one of the rising edge or the falling edge only is usable. regarding selection of the input signal edge, see table 17.3. note: transference from the frc to the icr will be performed regardless of the value of the icf. section 17 timer x1 rev.3.00 jan. 10, 2007 page 359 of 1038 rej09b0328-0300 edge detection and capture signal generating circuit. bufea iedga ftia iedgc icrc icra frc figure 17.2 buffer operation (an example) table 17.3 input signal edge selection when making buffer operation iedga iedgc selection of the input signal edge 0 captures at the rising edge of the i nput capture input a (initial value) 0 1 1 0 captures at both rising and falling edges of the input capture input a 1 captures at the rising edge of the input capture input a reading can be made from the icr through the cpu at 8-bit or 16-bit. for stable input capturing operation, maintain the pulse duration of the input capture input signals at 1.5 system clock ( ) or more in case of single edge capturing and at 2.5 system clock ( ) or more in case of both edge capturing. the icr is initialized to h'0000 when reset or under the standby mode, watch mode, subsleep mode, module stop mode, or subactive mode. section 17 timer x1 rev.3.00 jan. 10, 2007 page 360 of 1038 rej09b0328-0300 17.2.4 timer interrupt enabling register (tier) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 0 6 0 7 r/w r/w r/w icice r/w icibe 0 r/w iciae icide ociae ocibe ovie icsa bit : initial value : r/w : the tier is an 8-bit read/write register which works to control permission/prohibition of respective interrupt requests. the tier is initialized to h'00 when reset or under the standby mode, watch mode, subsleep mode, module stop mode or subactive mode. bit 7 ? enabling the input capture interrupt a (iciae): this bit works to permit/prohibit interrupt requests (icia) by the icfa when the icfa of the tcsrx is being set to 1. bit 7 iciae description 0 prohibits interrupt requests (icia) by the icfa (initial value) 1 permits interrupt requests (icia) by the icfa bit 6 ? enabling the input capture interrupt b (icibe): this bit works to permit/prohibit interrupt requests (icib) by the icfb when the icfb of the tcsrx is being set to 1. bit 6 icibe description 0 prohibits interrupt requests (icib) by the icfb (initial value) 1 permits interrupt requests (icib) by the icfb bit 5 ? enabling the input capture interrupt c (icice): this bit works to permit/prohibit interrupt requests (icic) by the icfc when the icfc of the tcsrx is being set to 1. bit 5 icice description 0 prohibits interrupt requests (icic) by the icfc (initial value) 1 permits interrupt requests (icic) by the icfc section 17 timer x1 rev.3.00 jan. 10, 2007 page 361 of 1038 rej09b0328-0300 bit 4 ? enabling the input capture interrupt d (icide): this bit works to permit/prohibit interrupt requests (icid) by the icfd when the icfd of the tcsrx is being set to 1. bit 4 icide description 0 prohibits interrupt requests (icid) by the icfd (initial value) 1 permits interrupt requests (icid) by the icfd bit 3 ? enabling the output comparing interrupt a (ociae): this bit works to permit/prohibit interrupt requests (ocia) by the ocfa when the ocfa of the tcsrx is being set to 1. bit 3 ociae description 0 prohibits interrupt requests (ocia) by the ocfa (initial value) 1 permits interrupt requests (ocia) by the ocfa bit 2 ? enabling the output comparing interrupt b (ocibe): this bit works to permit/prohibit interrupt requests (ocib) by the ocfb when the ocfb of the tcsrx is being set to 1. bit 2 ocibe description 0 prohibits interrupt requests (ocib) by the ocfb (initial value) 1 permits interrupt requests (ocib) by the ocfb bit 1 ? enabling the timer overflow interrupt (ovie): this bit works to permit/prohibit interrupt requests (fovi) by the ovf when the ovf of the tcsrx is being set to 1. bit 1 ovie description 0 prohibits interrupt requests (fovi) by the ovf (initial value) 1 permits interrupt requests (fovi) by the ovf section 17 timer x1 rev.3.00 jan. 10, 2007 page 362 of 1038 rej09b0328-0300 bit 0 ? selecting the input capture a signals (icsa): this bit works to select the input capture a signals. bit 0 icsa description 0 selects the ftia pin for inputting of the input capture a signals (initial value) 1 selects the hsw for inputting of the input capture a signals 17.2.5 timer control/status register x (tcsrx) 0 0 1 0 2 0 3 0 4 0 5 0 6 0 7 r/w r/(w) * icfb 0 r/(w) * icfa r/(w) * icfd r/(w) * icfc r/(w) * ocfb r/(w) * ocfa cclra r/(w) * ovf note: * only 0 can be written to clear the flag for bits 7 to 1. bit : initial value : r/w : the tcsrx is an 8-bit register which works to select counter clearing timing and to control respective interrupt requesting signals. the tcsrx is initialized to h'00 when reset or under the standby mode, watch mode, subsleep mode, module stop mode or subactive mode. meanwhile, as for the timing, see section 17.3, operation. the ftia through ftid pins are for fixed inputs inside the lsi under the low power consumption mode excluding the sleep mode. consequen tly, when such shifts as "active mode low power consumption mode active mode" are made, wrong edges may be detected depending on the pin status or on the type of the detecting edge. to avoid such error, clear the interrupt requesti ng flag once immediately after shifting to the active mode from the low power consumption mode. section 17 timer x1 rev.3.00 jan. 10, 2007 page 363 of 1038 rej09b0328-0300 bit 7 ? input capture flag a (icfa): this is a status flag indicating the fact that the value of the frc has been transferred to th e icra by the input capture signals. when the bufea of the tcrx is being set to 1, the icfa indicates the status that the frc value has been transferred to the icra by the input capture signals and that the icra value before being updated has been transferred to the icrc. this flag should be cleared by use of of the so ftware. such setting should only be made by use of the hardware. it is not possible to make this setting using a software. bit 7 icfa description 0 [clearing condition] (initial value) when 0 is written into the icfa after reading the icfa under the setting of icfa = 1 1 [setting condition] when the value of the frc has been transferred to the icra by the input capture signals bit 6 ? input capture flag b (icfb): this is a status flag indicating the fact that the value of the frc has been transferred to the icrb by the i nput capture signals. when the bufeb of the tcrx is being set to 1, the icfb indicates the status that the frc value has been transferred to the icrb by the input capture signals and that the i crb value before being updated has been transferred to the i crc. this flag should be cleared by use of the softwa re. such setting should only be made by use of the hardware. it is not possible to make this setting using a software. bit 6 icfb description 0 [clearing condition] (initial value) when 0 is written into the icfb after reading the icfb under the setting of icfb = 1 1 [setting condition] when the value of the frc has been transferred to the icrb by the input capture signals section 17 timer x1 rev.3.00 jan. 10, 2007 page 364 of 1038 rej09b0328-0300 bit 5 ? input capture flag c (icfc): this is a status flag indicating the fact that the value of the frc has been transferred to the icrc by the input capture signals. when an input capture signal occurs while the bufea of the tcrx is being set to 1, although the icfc will be set out, data transference to the icrc will not be performed. therefore, in buffer operation, the icfc can be used as an external interrupt by setting the icice bit to 1. this flag should be cleared by use of the softwa re. such setting should only be made by use of the hardware. it is not possible to make this setting using a software. bit 5 icfc description 0 [clearing condition] (initial value) when 0 is written into the icfc after reading the icfc under the setting of icfc = 1 1 [setting condition] when the input capture signal has occurred bit 4 ? input capture flag d (icfd): this is a status flag indicating the fact that the value of the frc has been transferred to th e icrd by the input capture signals. when an input capture signal occurs while the bufeb of the tcrx is being set to 1, although the icfd will be set out, data transference to the icrd will not be performed. therefore, in buffer operation, the icfd can be used as an external interrupt by setting the icide bit to 1. this flag should be cleared by use of the softwa re. such setting should only be made by use of the hardware. it is not possible to make this setting using a software. bit 4 icfd description 0 [clearing condition] (initial value) when 0 is written into the icfd after reading the icfd under the setting of icfd = 1 1 [setting condition] when the input capture signal has occurred section 17 timer x1 rev.3.00 jan. 10, 2007 page 365 of 1038 rej09b0328-0300 bit 3 ? output comparing flag a (ocfa): this is a status flag indi cating the fact that the frc and the ocra have come to a comparing match. this flag should be cleared by use of the softwa re. such setting should only be made by use of the hardware. it is not possible to make this setting using a software. bit 3 ocfa description 0 [clearing condition] (initial value) when 0 is written into the ocfa after reading the ocfa under the setting of ocfa = 1 1 [setting condition] when the frc and the ocra have come to the comparing match bit 2 ? output comparing flag b (ocfb): this is a status flag indi cating the fact that the frc and the ocrb have come to a comparing match. this flag should be cleared by use of the softwa re. such setting should only be made by use of the hardware. it is not possible to make this setting using a software. bit 2 ocfb description 0 [clearing condition] (initial value) when 0 is written into the ocfb after reading the ocfb under the setting of ocfb = 1 1 [setting condition] when the frc and the ocrb have come to the comparing match bit 1 ? time over flow (ovf): this is a status flag indicating the fact that the frc overflowed. (h'ffff h'0000). this flag should be cleared by use of the softwa re. such setting should only be made by use of the hardware. it is not possible to make this setting using a software. bit 1 ovf description 0 [clearing condition] (initial value) when 0 is written into the ovf after reading the ovf under the setting of ovf = 1 1 [setting condition] when the frc value has become h'ffff h'0000 section 17 timer x1 rev.3.00 jan. 10, 2007 page 366 of 1038 rej09b0328-0300 bit 0 ? counter clearing (cclra): this bit works to select if or not to clear the frc by occurrence of comparing match a (matching signal of the frc and ocra). bit 0 cclra description 0 prohibits clearing of the frc by occurrence of comparing match a (initial value) 1 permits clearing of the frc by occurrence of comparing match a 17.2.6 timer control register x (tcrx) 0 0 1 0 2 0 3 0 4 0 5 0 6 0 7 r/w r/w iedgb 0 r/w iedga r/w iedgd r/w iedgc r/w bufeb r/w bufea cks0 r/w cks1 bit : initial value : r/w : the tcrx is an 8-bit read/write register which works to select the input capture signal edge, to designate the buffer operation and to select the inputting clock for the frc. the tcrx is initialized to h'00 when reset or under the standby mode, watch mode, subsleep mode, module stop mode or subactive mode. bit 7 ? input capture signal edge selection a (iedga): this bit works to select the rising edge or falling edge of the input capture signal a (ftia). bit 7 iedga description 0 captures the falling edge of the input capture signal a (initial value) 1 captures the rising edge of the input capture signal a bit 6 ? input capture signal edge selection b (iedgb): this bit works to select the rising edge or falling edge of the input capture signal b (ftib). bit 6 iedgb description 0 captures the falling edge of the input capture signal b (initial value) 1 captures the rising edge of the input capture signal b section 17 timer x1 rev.3.00 jan. 10, 2007 page 367 of 1038 rej09b0328-0300 bit 5 ? input capture signal edge selection c (iedgc): this bit works to select the rising edge or falling edge of the input capture signal c (ftic). however, when the dvctl has been selected as the signal for the input capture signal edge selection c, this bit will not influence the operation. bit 5 iedgc description 0 captures the falling edge of the input capture signal c (initial value) 1 captures the rising edge of the input capture signal c bit 4 ? input capture signal edge selection d (iedgd): this bit works to select the rising edge or falling edge of the input capture signal d (ftid). bit 4 iedgd description 0 captures the falling edge of the input capture signal d (initial value) 1 captures the rising edge of the input capture signal d bit 3 ? buffer enabling a (bufea): this bit works to select if or not to use the icrc as the buffer register for the icra. bit 3 bufea description 0 using the icrc as the buffer register for the icra (initial value) 1 not using the icrc as the buffer register for the icra bit 2 ? buffer enabling b (bufeb): this bit works to select if or not to use the icrd as the buffer register for the icrb. bit 2 bufeb description 0 using the icrd as the buffer register for the icrb (initial value) 1 not using the icrd as the buffer register for the icrb section 17 timer x1 rev.3.00 jan. 10, 2007 page 368 of 1038 rej09b0328-0300 bits 1 and 0 ? clock select (cks1, 0): these bits work to select the inputting clock to the frc from among three types of internal clocks and the dvcfg. the dvcfg is the edge detecting pulse selected by the cfg dividing timer. bit 1 bit 0 cks1 cks0 description 0 0 internal clock: counts at /4 (initial value) 0 1 internal clock: counts at /16 1 0 internal clock: counts at /64 1 1 dvcfg: the edge detecting pulse selected by the cfg dividing timer 17.2.7 timer output comparing control register (tocr) 0 0 1 0 2 0 3 0 4 0 5 0 6 0 7 r/w r/w icsc 0 r/w icsb r/w osrs r/w icsd r/w oeb r/w oea olvlb r/w olvla bit : initial value : r/w : the tocr is an 8-bit read/write register which works to select input capture signals and output comparing output level, to permit output comparing outputs and to control switching over of the access of the ocra and ocrb. see the section 17.2. 4, timer interrupt enabling register (tier) regarding the input capture inputs a. the tocr is initialized to h'00 when reset or under the standby mode, watch mode, subsleep mode, module stop mode or subactive mode. bit 7 ? selecting the input capture b signals (icsb): this bit works to select the input capture b signals. bit 7 icsb description 0 selects the ftib pin for inputting of the input capture b signals (initial value) 1 selects the vd as the input capture b signals section 17 timer x1 rev.3.00 jan. 10, 2007 page 369 of 1038 rej09b0328-0300 bit 6 ? selecting the input capture c signals (icsc): this bit works to select the input capture c signals. the dvctl is the edge detecting pulse selected by the ctl dividing timer. bit 6 icsc description 0 selects the ftic pin for inputting of the input capture c signals (initial value) 1 selects the dvctl as the input capture c signals bit 5 ? selecting the input capture d signals (icsd): this bit works to select the input capture d signals. bit 5 icsd description 0 selects the ftid pin for inputting of the input capture d signals (initial value) 1 selects the nhsw as the input capture d signals bit 4 ? selecting the output comparing register (ocrs): the addresses of the ocra and ocrb are the same. the ocrs wo rks to control which register to choose when reading/writing this address. the choice will not influence the operation of the ocra and ocrb. bit 4 ocrs description 0 selects the ocra register (initial value) 1 selects the ocrb register bit 3 ? enabling the output a (oea): this bit works to control the output comparing a signals. bit 3 oea description 0 prohibits the output comparing a signal outputs (initial value) 1 permits the output comparing a signal outputs section 17 timer x1 rev.3.00 jan. 10, 2007 page 370 of 1038 rej09b0328-0300 bit 2 ? enabling the output b (oeb): this bit works to control the output comparing b signals. bit 2 oeb description 0 prohibits the output comparing b signal outputs (initial value) 1 permits the output comparing b signal outputs bit 1 ? output level a (olvla): this bit works to select the output level to output through the ftoa pin by use of the comparing match a (matching signal between the frc and ocra). bit 1 olvla description 0 low level (initial value) 1 high level bit 0 ? output level b (olvlb): this bit works to select the output level to output through the ftob pin by use of the comparing match b (matching signal between the frc and ocrb). bit 0 olvlb description 0 low level (initial value) 1 high level section 17 timer x1 rev.3.00 jan. 10, 2007 page 371 of 1038 rej09b0328-0300 17.2.8 module stop control register (mstpcr) 7 0 mstp15 r/w mstpcrh 6 0 mstp14 r/w 5 1 mstp13 r/w 4 1 mstp12 r/w 3 1 mstp11 r/w 2 1 mstp10 r/w 1 1 mstp9 r/w 0 1 mstp8 r/w 7 1 mstp7 r/w 6 1 mstp6 r/w 5 1 mstp5 r/w 4 1 mstp4 r/w 3 1 mstp3 r/w 2 1 mstp2 r/w 1 1 mstp1 r/w 0 1 mstp0 r/w mstpcrl initial value : r/w : bit : the mstpcr consists of twin 8-bit read/write registers and it works to control the module stop mode. when the mstp10 bit is set to 1, the timer x1 stops its operation at the ending point of the bus cycle to shift to the module stop mode. for more information, see section 4.5, module stop mode. when reset, the mstpcr is initialized to h'ffff. bit 2 ? module stop (mstp10): this bit works to designate the module stop mode for the timer x1. mstpcrh bit 2 mstp10 description 0 cancels the module stop mode of the timer x1 1 sets the module stop mode of the timer x1 (initial value) section 17 timer x1 rev.3.00 jan. 10, 2007 page 372 of 1038 rej09b0328-0300 17.3 operation 17.3.1 operation of the timer x1 (1) output comparing operation right after resetting, the frc is initialized to h'0000 to start counting up. the inputting clock can be selected from among three different types of internal clocks or the external clock by setting the cks1 and cks0 of the tcrx. the contents of the frc are always being comp ared with the ocra and ocrb and, when the value of these two match, the level set by the the olvla and olvlb of the tocr is output through the ftoa pin and ftob pin. after resetting, 0 will be output through the ftoa and ftob pins until the first compare matching occurs. also, when the cclra of the tcsrx is being set to 1, the frc will be cleared to h'0000 when the comparing match a occurs. (2) input capturing operation right after resetting, the frc is initialized to h'0000 to start counting up. the inputting clock can be selected from among three different types of internal clocks or the external clock by setting the cks1 and cks0 of the tcrx. the inputs are transferred to the iedga th rough iedgd of the tcrx through the ftia through ftid pins and, at the same time, the icfa through icfd of the tcsrx are set to 1. at this time, if the iciae through icied of the tier are being set to 1, due interrupt request will be issued to the cpu. when the bufea and bufeb of the tcrx are set to 1, the icrc and icrd work as the buffer register, respectively, of the icra and icrb. when the edge selected by setting the iedga through iedgd of the tcrx is input thro ugh the ftia and ftib pins, the value at the time of the frc is transferred to the icra and icrb and, at the same time, the values of the icra and icrb before updating are transferred to the icrc and icrd. at this time, when the icfa and icfb are being set to 1 and if the iciae and icibe of the tier are being set to 1, due interrupt request will be issued to the cpu. section 17 timer x1 rev.3.00 jan. 10, 2007 page 373 of 1038 rej09b0328-0300 17.3.2 counting timing of the frc the frc is counted up by the inputting clock. by setting the cks1 and cks0 of the tcrx, the inputting clock can be selected from among three different types of clocks ( /4, /16, and /64) and the dvcfg. (1) in case of internal clock operation by setting the cks1 and cks0 bits of the tcrx, three types of internal clocks ( /4, /16, and /64), generated by dividing the system clock ( ) can be selected. figure 17.3 shows the timing chart at this time. frc internal clock frc input clock n n ? 1 n + 1 figure 17.3 count timing in case of internal clock operation (2) in case of dvcfg clock operation by setting the cks1 and cks0 bits of the tcrx to 1, dvcfg clock input can be selected. the dvcfg clock makes counting by use of the edge detecting pulse being selected by the cfg dividing timer. figure 17.4 shows the timing chart at this time. frc cfg frc input clock n n + 1 dvcfg figure 17.4 count timing in case of cfg clock operation section 17 timer x1 rev.3.00 jan. 10, 2007 page 374 of 1038 rej09b0328-0300 17.3.3 output comparing signal outputting timing when a comparing match occurs, the output level having been set by the olvl of the tocr is output through the output comparing signal outputting pins (ftoa and ftob). figure 17.5 shows the timing chart in case of the output comparing signal outputting a. frc olvla ftoa output comparing signal outputting a pin n n clearing * n n n + 1 n + 1 comparing match signal ocra note: * execution of the command is to be designated by the software. figure 17.5 output comparing signal outputting a timing 17.3.4 frc clearing timing the frc can be cleared when th e comparing match a occurs. figure 17.6 shows the timing chart when doing so. frc comparing match a signal n h'0000 figure 17.6 frc clearing timing by occurrence of the comparing match a section 17 timer x1 rev.3.00 jan. 10, 2007 page 375 of 1038 rej09b0328-0300 17.3.5 input capture signal inputting timing (1) input capture si gnal inputting timing as for the input capture signal inputting, rising or falling edge is selected by settings of the iedga through iedgd bits of the tcrx. figure 17.7 shows the timing chart when the rising edge is selected (iedga through iedgd = 1). input capture signal inputting pin input capture signal figure 17.7 input capture signal inputting timing (under normal state) (2) input capture signal inputting ti ming when making buffer operation buffer operation can be made using the icra or icrd as the buffer of the icra or icrb. figure 17.8 shows the input capture signal inputting timing chart in case both of the rising and falling edges are designated (iedga = 1 and iedgc = 0, or iedga = 0 and iedgc = 1), using the icrc as the buffer register for the icra (bufea = 1). input capture signal ftia frc icra icrc n n + 1 n mn mm n m n n figure 17.8 input capture signal inputting timing chart under the buffer mode (under normal state) section 17 timer x1 rev.3.00 jan. 10, 2007 page 376 of 1038 rej09b0328-0300 even when the icrc or icrd is used as the buf fer register, the input ca pture flag will be set up corresponding to the designated edge cha nge of respective input capture signals. for example, when using the icrc as the buffer register for th e icra, when an edge change having been designated by the iedgc bit is detected with the input capture signals c and if the iciec bit is duly set, an interrupt request will be issued. however, in this case, the frc value will not be transferred to the icrc. 17.3.6 input capture flag (icfa through icfd) setting up timing the input capture signal works to set the icfa through icfd to "1" and, simultaneously, the frc value is transferred to the corresponding icra through icrd. figure 17.9 shows the timing chart for the above. input capture signal icfa to icfd icra to icrd frc n n figure 17.9 icfa through icfd setting up timing section 17 timer x1 rev.3.00 jan. 10, 2007 page 377 of 1038 rej09b0328-0300 17.3.7 output comparing flag (ocfa and ocfb) setting up timing the ocfa and ocfb are being set to 1 by the comparing match signal being output when the values of the ocra, ocrb, and frc match. the comparing match signal is generated at the last state of the value match (the timing of the frc's updating the matching count reading). after the values of the ocra, ocrb, and frc match, up until the count up clock signal is generated, the comparing match signal will not be issued. figure 17.10 shows the ocfa and ocfb setting timing chart. comparing match signal ocfa, ocfb ocra, ocrb frc n n n + 1 figure 17.10 ocf setting up timing 17.3.8 overflow flag (cvf) setting up timing the ovf is set to when the frc overflows (h'ffff h'0000). figure 17.11 shows the timing chart for this case. overflowing signal frc h'ffff h'0000 ovf figure 17.11 ovf setting up timing section 17 timer x1 rev.3.00 jan. 10, 2007 page 378 of 1038 rej09b0328-0300 17.4 operation mode of the timer x1 table 17.4 indicated below shows the operation mode of the timer x1. table 17.4 operation mo de of the timer x1 operation mode reset active sleep watch subactive standby subsleep module stop frc reset functions functions reset reset reset reset reset ocra, ocrb reset functions functions reset reset reset reset reset icra to icrd reset functions functions reset reset reset reset reset tier reset functions functions reset reset reset reset reset tcrx reset functions functions reset reset reset reset reset tocr reset functions functions reset reset reset reset reset tcsrx reset functions functions reset reset reset reset reset 17.5 interrupt causes total seven interrupt causes exist with the timer x1, namely, icia through icid, ocia, ocib, and fovi. table 17.5 given below lists the contents of respective interrupt causes. respective interrupt requests can be permitted or prohibited by setting of respective interrupt enabling bits of the tier. also, independent vector addresses are being allocated to respective interrupt causes. table 17.5 interrupt causes of the timer x1 abbreviations of the interrupt ca uses priority degree contents icia interrupt request by the icfa icib interrupt request by the icfb icic interrupt request by the icfc icid interrupt request by the icfd ocia interrupt request by the ocfa ocib interrupt request by the ocfb fovi interrupt request by the ovf high low section 17 timer x1 rev.3.00 jan. 10, 2007 page 379 of 1038 rej09b0328-0300 17.6 exemplary uses of the timer x1 figure 17.12 indicated below shows an example of outputting at optional phase difference of the pulses of the 50% duty. for this setting, follow the procedures listed below. (1) set the cclra bit of the tcsrx to "1". (2) each time a comparing match occurs, the olvla bit and the ol vlb bit are reversed by use of the software. h'ffff ocra ocrb h'0000 ftoa ftob clearing the counter frc figure 17.12 an exemplary pulse outputting section 17 timer x1 rev.3.00 jan. 10, 2007 page 380 of 1038 rej09b0328-0300 17.7 precautions when using the timer x1 pay great attention to the fact that the following competitions and operations occur during operation of the timer x1. 17.7.1 competition between writin g and clearing with the frc when a counter clearing signal is issued under the t2 state where the frc is under the writing cycle, writing into the frc will not be effected and the priority will be given to clearing of the frc. figure 17.13 shows the timing chart in this case. address frc address internal writing signal counter clearing signal frc n h'0000 t1 t2 writing cycle with the frc figure 17.13 competition between writing and clearing with the frc section 17 timer x1 rev.3.00 jan. 10, 2007 page 381 of 1038 rej09b0328-0300 17.7.2 competition between writin g and counting up with the frc when a counting up cause occurs under the t2 st ate where the frc is unde r the writing cycle, the counting up will not be effected and the priority will be given to count writing. figure 17.14 shows the timing chart in this case. address frc address internal writing signal inputting clock to the frc writing data frc n m t1 t2 writing cycle with the frc figure 17.14 competition between writing and counting up with the frc section 17 timer x1 rev.3.00 jan. 10, 2007 page 382 of 1038 rej09b0328-0300 17.7.3 competition between writing and comparing match with the ocr when a comparing match occurs under the t2 state where the ocra and ocrb are under the writing cycle, the priority will be given to writing of the ocr and the comparing match signal will be prohibited. figure 17.15 shows the timing chart in this case. address ocr address internal writing signal comparing match signal frc writing data prohibited ocr n m n n + 1 t1 t2 writing cycle with the ocr figure 17.15 competition between writing and comparing match with the ocr section 17 timer x1 rev.3.00 jan. 10, 2007 page 383 of 1038 rej09b0328-0300 17.7.4 changing over the internal clocks and counter operations depending on the timing of changing over the internal clocks, the frc may count up. table 17.6 indicated below shows the relations between the timing of changing over the internal clocks (re- writing of the cks1 and cks0) and the frc operations. when using an internal clock, the counting clock is being generated detecting the falling edge of the internal clock dividi ng the system clock ( ). for this reason, like item no. 3 of table 17.6, count clock signals are issued deeming the timing before the changeover as the falling edge to have the frc to count up. also, when changing over between an internal clock and the external clock, the frc may count up. table 17.6 changing over the internal clocks and the frc operation no. re-writing timing for the cks1 and cks0 frc operation 1 low low level changeover clock before the changeover clock after the changeover count clock frc re-writing of the cks1 and cks0 n n +1 2 low high level changeover clock before the changeover clock after the changeover count clock frc re-writing of the cks1 and cks0 n n +1 n +2 section 17 timer x1 rev.3.00 jan. 10, 2007 page 384 of 1038 rej09b0328-0300 no. re-writing timing for the cks1 and cks0 frc operation 3 high low level changeover clock before the changeover clock after the changeover count clock frc re-writing of the cks1 and cks0 n * n +1 n +2 4 high high level changeover clock before the changeover clock after the changeover count clock frc re-writing of the cks1 and cks0 n n +1 n +2 note: * the count clock signals are issued deeming the changeover timing as the falling edge to have the frc to count up. section 18 watchdog timer (wdt) rev.3.00 jan. 10, 2007 page 385 of 1038 rej09b0328-0300 section 18 watchdog timer (wdt) 18.1 overview this lsi has an on-chip watchdog timer with one channel (wdt) for monitoring system operation. the wdt outputs an overflow signal if a system crash prevents the cpu from writing to the timer counter, allowing it to overflow. at the same time, the wdt can also generate an internal reset signal or internal nmi interrupt signal. when this watchdog function is not needed, the wdt can be used as an interval timer. in interval timer mode, an interval timer interrupt is generated each time the counter overflows. 18.1.1 features wdt features are listed below. ? switchable between watchdog timer mode and interval timer mode ? wovi interrupt generation in interval timer mode ? internal reset or internal interrupt generated when the timer counter overflows ? choice of internal reset or nmi interrupt generation in watchdog timer mode ? choice of 8 counter input clocks ? maximum wdt interval: system clock period 131072 256 section 18 watchdog timer (wdt) rev.3.00 jan. 10, 2007 page 386 of 1038 rej09b0328-0300 18.1 . 2 block diagram figure 18.1 shows block diagram of wdt. overflow interrupt control ? reset control wovi (interrupt request signal) internal reset signal * wtcnt wtcsr /2 /64 /128 /512 /2048 /8192 /32768 /131072 clock clock select internal clock source bus interface module bus wtcsr wtcnt note: * the internal reset signal can be generated by means of a register setting. : timer control/status register : timer counter internal bus wdt legend: internal nmi interrupt request signal figure 18.1 block diagram of wdt section 18 watchdog timer (wdt) rev.3.00 jan. 10, 2007 page 387 of 1038 rej09b0328-0300 18.1.3 register configuration the wdt has two registers, as summarized in tabl e 18.1. these registers control clock selection, wdt mode switching, the reset signal, etc. table 18.1 wdt registers address * 1 name abbrev. r/w initial value write * 2 read watchdog timer control/status register wtcsr r/(w) * 3 h'00 h'ffbc h'ffbc watchdog timer counter wtcnt r/w h'00 h'ffbc h'ffbd system control register syscr r/w h'09 h'ffe8 h'ffe8 notes: 1. lower 16 bits of the address. 2. for details of write operations, see section 18.2.4, notes on register access. 3. only 0 can be written in bit 7, to clear the flag. section 18 watchdog timer (wdt) rev.3.00 jan. 10, 2007 page 388 of 1038 rej09b0328-0300 18.2 register descriptions 18.2.1 watchdog timer counter (wtcnt) 7 0 r/w 6 0 r/w 5 0 r/w 4 0 r/w 3 0 r/w 0 0 r/w 2 0 r/w 1 0 r/w bit : initial value : r/w : tcnt is an 8-bit readable/writable* up-counter. when the tme bit is set to 1 in wtcsr, wtcnt starts counting pulses generated from the internal clock source selected by bits cks2 to cks0 in wtcsr. when the count overflows (changes from h'ff to h'00), the ovf flag in wtcsr is set to 1. wtcnt is initialized to h'00 by a reset, or when the tme bit is cleared to 0. note: * wtcnt is write-protected by a password to prevent accidental overwriting. for details see section 18.2.4, notes on register access. 18.2.2 watchdog timer control/status register (wtcsr) 7 ovf 0 r/(w) * 6 wt/ it 0 r/w 5 tme 0 r/w 4 rsts 0 r/w 3 rst/ nmi 0 r/w 0 cks0 0 r/w 2 cks2 0 r/w 1 cks1 0 r/w note: * only 0 can be written to clear the flag. bit : initial value : r/w : wtcsr is an 8-bit readable/writable* register. its functions include selecting the clock source to be input to wtcnt, and the timer mode. wtcsr is initialized to h'00 by a reset. note: * wtcsr is write-protected by a password to prevent accidental overwriting. for details see section 18.2.4, notes on register access. section 18 watchdog timer (wdt) rev.3.00 jan. 10, 2007 page 389 of 1038 rej09b0328-0300 bit 7 ? overflow flag (ovf): a status flag that indicates that wtcnt has overflowed from h'ff to h'00. bit 7 ovf description 0 [clearing conditions] (initial value) (1) write 0 in the tme bit (2) read wtcsr when ovf = 1, then write 0 in ovf 1 [setting condition] when wtcnt overflows (changes from h'ff to h'00) when internal reset request generation is selected in watchdog timer mode, ovf is cleared automatically by the internal reset bit 6 ? timer mode select (wt/ it ): selects whether the wdt is used as a watchdog timer or interval timer. if used as an interval timer, the wdt generates an interval timer interrupt request (wovi) when tcnt overflows. if used as a watchdog timer, the wdt generates a reset or nmi interrupt when tcnt overflows. bit 6 wt/ it description 0 interval timer mode: sends the cpu an interval timer interrupt request (wovi) when wtcnt overflows (initial value) 1 watchdog timer mode: sends the cpu a reset or nmi interrupt request when wtcnt overflows bit 5 ? timer enable (tme): selects whether wtcnt runs or is halted. bit 5 tme description 0 wtcnt is initialized to h'00 and halted (initial value) 1 wtcnt counts bit 4 ? reset select (rsts): reserved. this bit should not be set to 1. section 18 watchdog timer (wdt) rev.3.00 jan. 10, 2007 page 390 of 1038 rej09b0328-0300 bit 3 ? reset or nmi (rst/ nmi ): specifies whether an internal reset or nmi interrupt is requested on wtcnt overflow in watchdog timer mode. bit 3 rst/ nimi description 0 an nmi interrupt request is generated (initial value) 1 an internal reset request is generated bits 2 to 0 ? clock select 2 to 0 (cks2 to cks0): these bits select an internal clock source, obtained by dividing the system clock ( ) for input to wtcnt. wdt input clock selection bit 2 bit 1 bit 0 description csk2 csk1 csk0 clock overflow period * (when = 10 mhz) 0 /2 (initial value) 51.2 s 0 1 /64 1.6 ms 0 /128 3.3 ms 0 1 1 /512 13.1 ms 0 /2048 52.4 ms 0 1 /8192 209.7 ms 0 /32768 838.9 ms 1 1 1 /131072 3.36 s note: * the overflow period is the time from when wtcnt starts counting up from h'00 until overflow occurs. section 18 watchdog timer (wdt) rev.3.00 jan. 10, 2007 page 391 of 1038 rej09b0328-0300 18.2.3 system control register (syscr) 7 ? 0 ? 6 ? 0 ? 5 intm1 0 r 4 intm0 0 r/w 3 xrst 1 r 0 ? 1 ? 2 nmieg1 0 r/w 1 nmieg0 0 r/w bit : initial value : r/w : only bit 3 is described here. for details on functions not related to the watchdog timer, see sections 3.2.2 and 6.2.1, system control register (syscr), and the descriptions of the relevant modules. bit 3 ? external reset (xrst): indicates the reset source. when the watchdog timer is used, a reset can be generated by watchdog timer overflow in addition to external reset input. xrst is a read-only bit. it is set to 1 by an external reset, and cleared to 0 by watchdog timer overflow. bit 3 xrst description 0 reset is generated by watchdog timer overflow 1 reset is generated by external reset input (initial value) 18.2.4 notes on register access the watchdog timer's wtcnt and wtcsr registers differ from other registers in being more difficult to write to. the procedures for writing to and reading these registers are given below. (1) writing to wtcnt and wtcsr these registers must be written to by a word transfer instruction. they cannot be written to with byte transfer instructions. figure 18.2 shows the format of data writte n to wtcnt and wtcs r. wtcnt and wtcsr both have the same write address. for a write to wtcnt, the upper byte of the written word must contain h'5a and the lower byte must cont ain the write data. for a write to wtcsr, the upper byte of the written word must contain h'a5 and the lower byte must contain the write data. this transfers the write data from the lower byte to wtcnt or wtcsr. section 18 watchdog timer (wdt) rev.3.00 jan. 10, 2007 page 392 of 1038 rej09b0328-0300 section 18 watchdog timer (wdt) rev.3.00 jan. 10, 2007 page 393 of 1038 rej09b0328-0300 18.3 operation 18.3.1 watchdog timer operation to use the wdt as a watchdog timer, set the wt/ it and tme bits in wtcsr to 1. software must prevent wtcnt overflows by rewriting the wtcnt value (normally by writing h'00) before overflow occurs. this ensures that wtcnt does not overflow while the system is operating normally. if wtcnt overfl ows without being rewritten because of a system crash or other error, the chip is reset, or an nmi interrupt is generated, for 518 system clock periods (518 ). this is illustrated in figure 18.3. an internal reset request from the watchdog timer and reset input from the res pin are handled via the same vector. the reset s ource can be identified from the value of the xrst bit in syscr. if a reset caused by an input signal from the res pin and a reset caused by wdt overflow occur simultaneously, the res pin reset has priority, and the xrst bit in syscr is set to 1. an nmi interrupt request from the watchdog timer and an interrupt request from the nmi pin are handled via the same vector. simultaneous handling of a watchdog timer nmi interrupt request and an nmi pin interrupt request must therefore be avoided. wtcnt value h'00 time h'ff wt/ it = 1 tme = 1 h'00 written to wtcnt wt/ it = 1 tme = 1 h'00 written to wtcnt 518 system clock period internal reset signal wt/ it tme overflow internal reset generated wovf = 1 * : timer mode select bit : timer enable bit note: * cleared to 0 by an internal reset when wovf is set to 1. xrst is cleared to 0. legend: figure 18.3 operation in watchdog timer mode section 18 watchdog timer (wdt) rev.3.00 jan. 10, 2007 page 394 of 1038 rej09b0328-0300 18.3.2 interval timer operation to use the wdt as an inte rval timer, clear the wt/ it bit in wtcsr to 0 and set the tme bit to 1. an interval timer interrupt (wovi) is ge nerated each time wtcnt overflows, provided that the wdt is operating as an interval timer, as shown in figure 18.4. this function can be used to generate interrupt requests at regular intervals. wtcnt value h'00 time h'ff wt/ it = 0 tme = 1 wovi overflow overflow overflow overflow legend: wovi : interval timer interrupt request generation wovi wovi wovi figure 18.4 operation in interval timer mode section 18 watchdog timer (wdt) rev.3.00 jan. 10, 2007 page 395 of 1038 rej09b0328-0300 18.3.3 timing of setting of overflow flag (ovf) the ovf bit in wtcsr is set to 1 if wtcnt overflows during interval timer operation. at the same time, an interval timer interrupt (wovi) is requested. this timing is shown in figure 18.5. if nmi request generation is selected in watchdog timer mode, when wtcnt overflows the ovf bit in wtcsr is set to 1 and at the same time an nmi interrupt is requested. ck wtcnt h'ff h'00 overflow signal (internal signal) ovf figure 18.5 timing of ovf setting section 18 watchdog timer (wdt) rev.3.00 jan. 10, 2007 page 396 of 1038 rej09b0328-0300 18.4 interrupts during interval timer mode operation, an overflow generates an interval timer interrupt (wovi). the interval timer interrupt is requested whenever the ovf flag is set to 1 in wtcsr. ovf must be cleared to 0 in the interrupt handling routine. when nmi interrupt request generation is selected in watchdog timer mode, an overflow generates an nmi interrupt request. 18.5 usage notes 18.5.1 contention between watchdog ti mer counter (wtcnt) write and increment if a timer counter clock pulse is generated during the t2 state of a wtcnt write cycle, the write takes priority and the timer counter is not incremented. figure 18.6 shows this operation. internal address internal internal write signal wtcnt input clock wtcnt nm t 1 t 2 wtcnt write cycle counter write data figure 18.6 contention betw een wtcnt write and increment section 18 watchdog timer (wdt) rev.3.00 jan. 10, 2007 page 397 of 1038 rej09b0328-0300 18.5.2 changing value of cks2 to cks0 if bits cks2 to cks0 in wtcsr are written to while the wdt is operating, errors could occur in the incrementation. software must stop the watchdog timer (by clearing the tme bit to 0) before changing the value of bits cks2 to cks0. 18.5.3 switching between watchdog timer mode and interval timer mode if the mode is switched from watchdog timer to interval timer, or vice versa, while the wdt is operating, errors could occur in the incrementation. software must stop the watchdog timer (by clearing the tme bit to 0) before switching the mode. section 18 watchdog timer (wdt) rev.3.00 jan. 10, 2007 page 398 of 1038 rej09b0328-0300 section 19 8-bit pwm rev.3.00 jan. 10, 2007 page 399 of 1038 rej09b0328-0300 section 19 8-bit pwm 19.1 overview the 8-bit pwm incorporates 4 channels of the duty control method. its outputs can be used to control a reel motor or loading motor. 19.1.1 features ? conversion period: 256-state ? duty control method 19.1.2 block diagram figure 19.1 shows a block diagram of the 8-bit pwm (1 channel). pwmn (n = 3 to 0) 2 0 2 7 ovf match signal legend: pwrn pw8cr : 8-bit pwm data register n : 8-bit pwm control register pwmn ovf : 8-bit pwm square-wave output pin n : overflow signal from frc lower 8-bit pwrn free-running counter (frc) comparator pw8cr polarity specification internal data bus r s q figure 19.1 block diagram of 8-bit pwm section 19 8-bit pwm rev.3.00 jan. 10, 2007 page 400 of 1038 rej09b0328-0300 19.1.3 pin configuration table 19.1 shows the 8-bit pwm pin configuration. table 19.1 pin configuration name abbrev. i/o function 8-bit pwm square-wave output pin 0 pwm0 output 8-bit pwm square-wave output 0 8-bit pwm square-wave output pin 1 pwm1 output 8-bit pwm square-wave output 1 8-bit pwm square-wave output pin 2 pwm2 output 8-bit pwm square-wave output 2 8-bit pwm square-wave output pin 3 pwm3 output 8-bit pwm square-wave output 3 19.1.4 register configuration table 19.2 shows the 8-bit pwm register configuration. table 19.2 8-bit pwm registers name abbrev. r/w size initial value address * 8-bit pwm data register 0 pwr0 w byte h'00 h'd126 8-bit pwm data register 1 pwr1 w byte h'00 h'd127 8-bit pwm data register 2 pwr2 w byte h'00 h'd128 8-bit pwm data register 3 pwr3 w byte h'00 h'd129 8-bit pwm control register pw8cr r/w byte h'f0 h'd12a port mode register 3 pmr3 r/w byte h'00 h'ffd0 note: * lower 16 bits of the address. section 19 8-bit pwm rev.3.00 jan. 10, 2007 page 401 of 1038 rej09b0328-0300 19.2 register descriptions 19.2.1 bit pwm data registers 0, 1, 2, and 3 (pwr0, pwr1, pwr2, pwr3) pwr0 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 6 0 7 pw04 pw03 pw02 pw01 pw00 0 w pw07 w w w pw06 pw05 bit : initial value : r/w : pwr1 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 6 0 7 pw14 pw13 pw12 pw11 pw10 0 w pw17 w w w pw16 pw15 bit : initial value : r/w : pwr2 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 6 0 7 pw24 pw23 pw22 pw21 pw20 0 w pw27 w w w pw26 pw25 bit : initial value : r/w : pwr3 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 6 0 7 pw34 pw33 pw32 pw31 pw30 0 w pw37 w w w pw36 pw35 bit : initial value : r/w : 8-bit pwm data registers 0, 1, 2, and 3 (pwr0, pwr1, pwr2, pwr3) control the duty cycle at 8-bit pwm pins. the data written in pwr0, pwr1, pwr2, and pwr3 correspond to the high- level width of one pwm output waveform cycle (256 states). when data is set in pwr0, pwr1, pwr2, and pwr3, the contents of the data are latched in the pwm waveform generators, updating the pwm waveform generation data. pwr0, pwr1, pwr2, and pwr3 are write-only register s. when read, all bits are always read as 1. pwr0, pwr1, pwr2, and pwr3 are initialized to h'00 by a reset. section 19 8-bit pwm rev.3.00 jan. 10, 2007 page 402 of 1038 rej09b0328-0300 19.2.2 8-bit pwm control register (pw8cr) 0 0 1 0 r/w 2 0 r/w 3 0 4 5 6 7 ? ? ? ? ? ? ? ? pwc3 pwc2 pwc1 pwc0 r/w r/w 1111 bit : initial value : r/w : the 8-bit pwm control register (pw8cr) is an 8-bit readable/writable register that controls pwm functions. pw8cr is initialized to h'00 by a reset. bits 7 to 4 ? reserved: they are always read as 1. writes are disabled. bits 3 to 0 ? output polarity select (pwc3 to pwc0): these bits select the output polarity of pwmn pin between positive or negative (reverse). bit n pwcn description 0 pwmn pin output has positive polarity (initial value) 1 pwmn pin output has negative polarity note: n = 3 to 0 19.2.3 port mode register 3 (pmr3) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 6 0 7 pmr34 pmr33 pmr32 pmr31 pmr30 0 r/w pmr37 r/w r/w r/w pmr36 pmr35 bit : initial value : r/w : the port mode register 3 (pmr3) controls function switching of each pin in the port 3. switching is specified for each bit. the pmr3 is a 8-bit readable/writable register and is initialized to h'00 by a reset. for bits other than 5 to 2, see section 11.5, port 3. section 19 8-bit pwm rev.3.00 jan. 10, 2007 page 403 of 1038 rej09b0328-0300 bits 5 to 2 ? p35/pwm3 to p32/pwm0 pin switching (pmr35 to pmr32): these bits set whether the p3n/pwmn pin is used as i/o pin or it is used as 8-bit pwm output pwmm pin. bit n pmr3n description 0 p3n/pmwm pin functions as p3n i/o pin (initial value) 1 p3n/pmwm pin functions as pwmm output pin note: n = 5 to 2, m = 3 to 0 19.2.4 module stop control register (mstpcr) 7 1 mstp15 r/w mstpcrh 6 1 mstp14 r/w 5 1 mstp13 r/w 4 1 mstp12 r/w 3 1 mstp11 r/w 2 1 mstp10 r/w 1 1 mstp9 r/w 0 1 mstp8 r/w 7 1 mstp7 r/w 6 1 mstp6 r/w 5 1 mstp5 r/w 4 1 mstp4 r/w 3 1 mstp3 r/w 2 1 mstp2 r/w 1 1 mstp1 r/w 0 1 mstp0 r/w mstpcrl bit : initial value : r/w : the mstpcr consists of two 8-bit readable/writable registers that control module stop mode. when mstp4 bit is set to 1, the 8-bit pwm stops its operation upon completion of the bus cycle and transits to the module stop mode. for details, see section 4.5, module stop mode. the mstpcr is initialized to h'ffff by a reset. bit 4: module stop (mstp4): this bit sets the module stop mode of the 8-bit pwm. mstpcrl bit 4 mstp4 description 0 8-bit pwm module stop mode is released 1 8-bit pwm module stop mode is set (initial value) section 19 8-bit pwm rev.3.00 jan. 10, 2007 page 404 of 1038 rej09b0328-0300 19.3 8-bit pwm operation the 8-bit pwm outputs pwm pulses having a cycle length of 256 states and a pulse width determined by the data registers (pwr). the output pwm pulse can be converted to a dc voltage through integration in a low-pass filter. figure 19.2 shows the output waveform example of 8-bit pwm. the pulse width (twidth) can be obtained by the following expression: twidth = (1/ ) (pwr setting value) t width pulse width t width pulse cycle (256 states) t width pulse width t width pulse cycle (256 states) h'00 pwrn setting value h'ff frc lower 8-bit value pwrn pin output (positive polarity) (n = 3 to 0) (negative polarity) figure 19.2 8-bit pwm output waveform (example) section 20 12-bit pwm rev.3.00 jan. 10, 2007 page 405 of 1038 rej09b0328-0300 section 20 12-bit pwm 20.1 overview the 12-bit pwm incorporates 2 channels of the pulse pitch control method and functions as the drum and capstan motor controller. 20.1.1 features two on-chip 12-bit pwm signal generators are provided to control motors. these pwms use the pulse-pitch control method (periodically overriding part of the output). this reduces low- frequency components in the pulse output, enabling a quick response without increasing the clock frequency. the pitch of the pwm signal is modified in response to error data (representing lead or lag in relation to a preset speed and phase). section 20 12-bit pwm rev.3.00 jan. 10, 2007 page 406 of 1038 rej09b0328-0300 20.1.2 block diagram figure 20.1 shows a block diagram of the 12-bit pwm (1 channel). the pwm signal is generated by combining quantizing pulses from a 12-bit pulse generator with quantizing pulses derived from the contents of a data register. low-frequency components are reduced because the two quantizing pulses have different frequencies. the error da ta is represented by an unsigned 12-bit binary number. internal data bus legend: cappwm or drmpwm cappwm /2 /4 /8 /16 /32 /64 /128 drmpwm : capstan mix pin : drum mix pin pwm control register digital filter circuit error data pton pwm data register output control circuit pulse generator counter dfucr cp/ dp figure 20.1 block diagram of 12-bit pwm (1 channel) section 20 12-bit pwm rev.3.00 jan. 10, 2007 page 407 of 1038 rej09b0328-0300 20.1.3 pin configuration table 20.1 shows the 12-bit pwm pin configuration. table 20.1 pin configuration name abbrev. i/o function capstan mix cappwm output 12-bit pwm square-wave output drum mix drmpwm 20.1.4 register configuration table 20.2 shows the 12-bit pwm register configuration. table 20.2 12-bit pwm registers name abbrev. r/w size initial value address * cpwcr w byte h'42 h'd07b 12-bit pwm control register dpwcr w byte h'42 h'd07a 12-bit pwm data register cpwdr r/w word h'f000 h'd07c dpwdr r/w word h'f000 h'd078 note: * lower 16 bits of the address. section 20 12-bit pwm rev.3.00 jan. 10, 2007 page 408 of 1038 rej09b0328-0300 20.2 register descriptions 20.2.1 12-bit pwm control registers (cpwcr, dpwcr) cpwcr 0 0 1 1 w 2 0 w 3 0 4 0 w 0 w 5 6 1 7 ch/l csf/df cck2 cck1 cck0 0 w cpol w w w cdc chiz bit : initial value : r/w : dpwcr 0 0 1 1 w 2 0 w 3 0 4 0 w 0 w 5 6 1 7 dh/l dsf/df dck2 dck1 dck0 0 w dpol w w w ddc dhiz bit : initial value : r/w : cpwcr is the pwm output control register for the capstan motor. dpwcr is the pwm output control register for the drum motor. both are 8-bit writable registers. cpwcr and dpwcr are initialized to h'42 by a reset, or in sleep mode, standby mode, watch mode, subactive mode, subsleep mode, or module stop mode of the servo circuit. bit 7 ? polarity invert (pol): this bit can invert the polarity of the modulated pwm signal for noise suppression and other purposes. this bit is invalid when fixed output is selected (when bit dc is set to 1). bit 7 pol description 0 output with positive polarity (initial value) 1 output with inverted polarity bit 6 ? output select (dc): selects either pwm modulated output, or fixed output controlled by the pin output bits (bits 5 and 4). section 20 12-bit pwm rev.3.00 jan. 10, 2007 page 409 of 1038 rej09b0328-0300 bits 5 and 4 ? pwm pin output (hi-z, h/l): when bit dc is set to 1, the 12-bit pwm output pins (cappwm, drmpwm) output a value determined by the hi-z and h/l bits. the output is not affected by bit pol. in power-down modes, the 12-bit pwm circuit and pin statuses are retained. before making a transition to a power-down mode, first set bits 6 (dc), 5 (hi-z), and 4 (h/l) of the 12-bit pwm control registers (cpwcr and dpwcr) to select a fixed output level. choose one of the following settings: bit 6 bit 5 bit 4 dc hi-z h/l output state 0 low output (initial value) 0 1 high output 1 1 * high-impedance 0 * * modulation signal output legend: * don't care bit 3 ? output data select (sf/df): selects whether the data to be converted to pwm output is taken from the data register or from the digital filter circuit. bit sf/df description 0 modulation by error data from the digital filter circuit (initial value) 1 modulation by error data written in the data register note: when pwms output data from the digital filter circuit, the data consisting of the speed and phase filtering results are modulated by pwms and output from the cappwm and drmpwm pins. however, it is possible to output only drum phase filter results from cappwm pin and only capstan phase filter result from drmpwm pin, by dfucr settings of the digital filter circuit. see the section 28.11 digital filters. section 20 12-bit pwm rev.3.00 jan. 10, 2007 page 410 of 1038 rej09b0328-0300 bits 2 to 0 ? carrier frequency select (ck2 to ck0): selects the carrier frequency of the pwm modulated signal. do not set them to 111. bit 2 bit 1 bit 0 ck2 ck1 ck0 description 0 2 0 1 4 0 8 (initial value) 0 1 1 16 0 32 0 1 64 0 128 1 1 1 (do not set) 20.2.2 12-bit pwm data registers (cpwdr, dpwdr) cpwdr 1 0 r/w cpwdr1 0 0 r/w cpwdr0 3 0 r/w cpwdr3 2 0 r/w cpwdr2 5 0 r/w cpwdr5 4 0 r/w cpwdr4 7 0 r/w cpwdr7 6 0 r/w cpwdr6 9 0 r/w cpwdr9 8 0 r/w cpwdr8 11 0 r/w cpwdr11 10 0 r/w cpwdr10 12 1 13 1 14 1 15 ? ? ? ? ? ? ? ? 1 bit : initial value : r/w : dpwdr 1 0 r/w dpwdr1 0 0 r/w dpwdr0 3 0 r/w dpwdr3 2 0 r/w dpwdr2 5 0 r/w dpwdr5 4 0 r/w dpwdr4 7 0 r/w dpwdr7 6 0 r/w dpwdr6 9 0 r/w dpwdr9 8 0 r/w dpwdr8 11 0 r/w dpwdr11 10 0 r/w dpwdr10 12 1 13 1 14 1 15 1 ? ? ? ? ? ? ? ? bit : initial value : r/w : the 12-bit pwm data registers (cpwdr and dpwdr) are 12-bit readable/writable registers in which the data to be converted to pwm output is written. the data in these registers is converted to pwm output only when bit sf/df of the corresponding control register is set to 1. the error data from the digital filter circuit is written in the data register, and then modulated by pwm. at this time, the error data from the digital filter circuit can be monitored by reading the data register. these registers can be accessed by word only, and cannot be accessed by byte. byte access gives unassured results. section 20 12-bit pwm rev.3.00 jan. 10, 2007 page 411 of 1038 rej09b0328-0300 cpwdr and dpwdr are initialized to h'f000 by a reset, or in sleep mode, standby mode, watch mode, subactive mode, subsleep mode, or module stop mode of the servo circuit. 20.2.3 module stop control register (mstpcr) 7 1 mstp15 r/w mstpcrh 6 1 mstp14 r/w 5 1 mstp13 r/w 4 1 mstp12 r/w 3 1 mstp11 r/w 2 1 mstp10 r/w 1 1 mstp9 r/w 0 1 mstp8 r/w 7 1 mstp7 r/w 6 1 mstp6 r/w 5 1 mstp5 r/w 4 1 mstp4 r/w 3 1 mstp3 r/w 2 1 mstp2 r/w 1 1 mstp1 r/w 0 1 mstp0 r/w mstpcrl bit : initial value : r/w : the mstpcr consists of two 8-bit readable/writable registers that control module stop mode. when the mstp1 bit is set to 1, the 12-bit pwm and servo circuit, stops their operation upon completion of the bus cycle and tr ansits to the module stop mode. for details, see section 4.5, module stop mode. the mstpcr is initialized to h'ffff by a reset. bit 1 ? module stop (mstp1): this bit sets the module stop mode of the 12-bit pwm. this bit also controls the module stop mode of the servo circuit. mstpcrl bit 1 mstp1 description 0 module stop mode of the 12-bit pwm and servo circuit is released 1 module stop mode of the 12-bit pwm and servo circuit is set (initial value) section 20 12-bit pwm rev.3.00 jan. 10, 2007 page 412 of 1038 rej09b0328-0300 20.3 operation 20.3.1 output waveform the pwm signal generator combines the error data with the output from an internal pulse generator to produce a pulse-width modulated signal. when vcc/2 is set as the reference va lue, the following conditions apply: ? when the motor is running at the correct sped and phase, the pwm signal is output with a 50% duty cycle. ? when the motor is running behind the correct speed or phase, it is corrected by periodically holding part of the pwm signal low. the part held low depends on the size of the error. ? when the motor is running ahead of the correct speed or phase, it is corrected by periodically holding part of the pwm signal high. the part held high depends on the size of the error. when the motor is running at the correct speed and phase, the error data is a 12-bit value representing 1/2 (1000 0000 0000), and the pwm output has the same frequency as the selected division clock. after the error data has been converted into a pwm signal, the pwm signal can be smoothed into a dc voltage by an external low-pass filter (lpf). the smoothes error data can be used to control the motor. figure 20.2 shows sample waveform outputs. the 12-bit pwm pin outputs a low-level signal upon reset, in power-down mode or at module- stop. section 20 12-bit pwm rev.3.00 jan. 10, 2007 page 413 of 1038 rej09b0328-0300 1 counter pulse generator pwm data register c10 c11 c12 c13 corresponds to pwr3=1 corresponds to pwr2=1 corresponds to pwr1=1 corresponds to pwr0=1 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 pwr3 2 1 0 "l" 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12 figure 20.2 sample waveform output by 12-bit pwm (4 bits) section 20 12-bit pwm rev.3.00 jan. 10, 2007 page 414 of 1038 rej09b0328-0300 section 21 14-bit pwm rev.3.00 jan. 10, 2007 page 415 of 1038 rej09b0328-0300 section 21 14-bit pwm 21.1 overview the 14-bit pwm is a pulse division type pwm which can be used for v-synthesizer, etc. 21.1.1 features features of the 14-bit pwm are given below: ? choice of two conversion periods a conversion period of 32768/ with a minimum modulation width of 2/ , or a conversion period of 16384/ with a minimum modulation width of 1/ , can be selected. ? pulse division method for less ripple section 21 14-bit pwm rev.3.00 jan. 10, 2007 page 416 of 1038 rej09b0328-0300 21.1.2 block diagram figure 21.1 shows a block diagram of the 14-bit pwm. legend: pwcr /4 /2 pwdrl : pwm control register : pwm data register l pwdru pwm14 : pwm data register u : pwm14 output pin internal data bus pwcr pwdrl pwdru pwm waveform generator pwm14 figure 21.1 block diagram of 14-bit pwm 21.1.3 pin configuration table 21.1 shows the 14-bit pwm pin configuration. table 21.1 pin configuration name abbrev. i/o function pwm 14-bit square-wave output pin pwm14 * output 14-bit pwm square-wave output note: * this pin also functions as p40 general i/o pin. when using this pin, set the pin function by the port mode register 4 (pmr4). for details, see section 11.6, port 4. section 21 14-bit pwm rev.3.00 jan. 10, 2007 page 417 of 1038 rej09b0328-0300 21.1.4 register configuration table 21.2 shows the 14-bit pwm register configuration. table 21.2 14-bit pwm registers name abbrev. r/w size initial value address * pwm control register pwcr r/w byte h'fe h'd122 pwm data register u pwdru w byte h'00 h'd121 pwm data register l pwdrl w byte h'00 h'd120 note: * lower 16 bits of the address. section 21 14-bit pwm rev.3.00 jan. 10, 2007 page 418 of 1038 rej09b0328-0300 21.2 register descriptions 21.2.1 pwm control register (pwcr) 0 0 1 1 2 1 3 1 4 1 5 1 6 1 7 ? ? ? ? ? ? ? ? ? ? ? ? ? ? r/w pwcr0 1 bit : initial value : r/w : the pwm control register (pwcr) is an 8-bit read/write register that controls the 14-bit pwm functions. pwcr is initialized to h'fe by a reset. bits 7 to 1 ? reserved: they are always read as 1. writes are disabled. bit 0 ? clock select (pwcr0): selects the clock supplied to the 14-bit pwm. bit 0 pwcr0 description 0 the input clock is /2 (t = 2/ ) (initial value) the conversion period is 16384/ , with a minimum modulation width of 1/ 1 the input clock is /4 (t = 4/ ) the conversion period is 32768/ , with a minimum modulation width of 2/ note: t/ : period of pwm clock input section 21 14-bit pwm rev.3.00 jan. 10, 2007 page 419 of 1038 rej09b0328-0300 21.2.2 pwm data registers u and l (pwdru, pwdrl) pwdru 0 0 1 0 2 0 3 0 4 0 5 0 6 1 7 ? ? ? ? w pwdru0 w pwdru1 w pwdru2 w pwdru3 w pwdru4 w pwdru5 1 bit : initial value : r/w : pwdrl 0 0 1 0 2 0 3 0 4 0 5 0 6 7 w pwdrl0 w pwdrl1 w pwdrl2 w pwdrl3 w pwdrl4 w pwdrl5 0 w pwdrl6 w pwdrl7 0 bit : initial value : r/w : pwm data registers u and l (pwdru and pwdrl) indicate high level width in one pwn waveform cycle. pwdru and pwdrl form a 14-bit write-only register, with the upper 6 bits assigned to pwdru and the lower 8 bits to pwdrl. the value wr itten in pwdru and pwdrl gives the total high- level width of one pwm waveform cycle. both pwdru and pwdrl are accessible by byte access only. word access gives unassured results. when 14-bit data is written in pwdru and pw drl, the contents are latched in the pwm waveform generator and the pwm waveform gene ration data is updated. when writing the 14-bit data, follow these steps: (1) write the lower 8 bits to pwdrl. (2) write the upper 6 bits to pwdru. write the data first to pwdrl and then to pwdru. pwdru and pwdrl are write-only registers. when read, all bits always read 1. pwdru and pwdrl are initialized to h'c000 by a reset. section 21 14-bit pwm rev.3.00 jan. 10, 2007 page 420 of 1038 rej09b0328-0300 21.2.3 module stop control register (mstpcr) 7 1 mstp15 r/w mstpcrh 6 1 mstp14 r/w 5 1 mstp13 r/w 4 1 mstp12 r/w 3 1 mstp11 r/w 2 1 mstp10 r/w 1 1 mstp9 r/w 0 1 mstp8 r/w 7 1 mstp7 r/w 6 1 mstp6 r/w 5 1 mstp5 r/w 4 1 mstp4 r/w 3 1 mstp3 r/w 2 1 mstp2 r/w 1 1 mstp1 r/w 0 1 mstp0 r/w mstpcrl bit : initial value : r/w : the module stop control register (mstpcr) consists of two 8-bit readable/writable registers that control the module stop mode functions. when the mstp5 bit is set to 1, the 14-bit pwm operation stops at the end of the bus cycle and a transition is made to module stop mode. for details, see section 4.5, module stop mode. mstpcr is initialized to h'ffff by a reset. bit 5 ? module stop (mstp5): specifies the module stop mode of the 14-bit pwm. mstpcrl bit 5 mstp5 description 0 14-bit pwm module stop mode is released 1 14-bit pwm module stop mode is set (initial value) section 21 14-bit pwm rev.3.00 jan. 10, 2007 page 421 of 1038 rej09b0328-0300 21.3 14-bit pwm operation when using the 14-bit pwm, set the registers in this sequence: (1) set bit pmr40 to 1 in port mode register 4 (pmr4) so that pin p40/pwm14 is designated for pwm output. (2) set bit pwcr0 in the pwm control register (pwcr) to select a conversion period of either 32768/ (pwcr0 = 1) or 16384/ (pwcr0 = 0). (3) set the output waveform data in pwm data registers u and l (pwdru, pwdrl). be sure to write byte data first to pwdrl and then to pw dru. when the data is written in pwdru, the contents of these registers are latched in the pwm waveform generator, and the pwm waveform generation data is updated in synchronization with internal signals. one conversion period consists of 64 pulses, as shown in figure 21.2. the total high-level width during this period (t h ) corresponds to the data in pwdru and pwdrl. this relation can be expressed as follows: t h = (data value in pwdru and pwdrl + 64) t /2 where t is the period of pwm clock input: 2/ (bit pwcr0 = 0) or 4/ (bit pwcr0 = 1). if the data value in pwdru and pwdrl is from h'3fc0 to h'3fff, the pwm output stays high. when the data value is h'0000, t h is calculated as follows: t h = 64 t /2 = 32 ? t t h64 t h63 t h3 t h2 t h1 t h = t h1 + t h2 + t h3 + ... + t h64 t f1 = t f2 = t f3 = ... = t f64 t f1 t f2 t f63 t f64 1 conversion period figure 21.2 waveform output by 14-bit pwm section 21 14-bit pwm rev.3.00 jan. 10, 2007 page 422 of 1038 rej09b0328-0300 section 22 prescalar unit rev.3.00 jan. 10, 2007 page 423 of 1038 rej09b0328-0300 section 22 prescalar unit 22.1 overview the prescalar unit (psu) has a 18-bit free running counter (frc) that uses as a clock source and a 5-bit counter that uses w as a clock source. 22.1.1 features ? prescalar s (pss): generates frequency division clocks that are input to peripheral functions. ? prescalar w (psw): when a timer a is used as a clock time ba se, the psw frequency-divides subclocks and generates input clocks. ? stable oscillation wait time count: during the return from the low power consumption mode excluding the sleep mode, the frc counts the stable oscillation wait time. ? 8-bit pwm the lower 8 bits of the frc is used as 8-bit pwm cycle and duty cycle generation counters. (conversion cycle: 256 states) ? 8-bit input capture by ic pins catches the 8 bits of 2 15 to 2 8 of the frc according to the edge of the ic pin for remote control receiving. ? frequency division clock output: can output the frequency division clock for the system clock or the frequency division clock for the subclock from the frequency division clock output pin (tmow). section 22 prescalar unit rev.3.00 jan. 10, 2007 page 424 of 1038 rej09b0328-0300 22.1.2 block diagram figure 22.1 shows a block diagram of the prescalar unit. pwm3 icr1 pcsr 18-bit free runnin g counter (frc) w/128 prescalar w /131072 to /2 prescalar s internal data bus msb lsb w/4 w/8 w/16 w/32 /32 /16 /8 /4 interrupt request 5-bit counter ic pin stable oscillation wait time count output 2 12 2 15 2 8 2 17 2 7 2 0 tmow pin msb lsb 8 bits 6 bits 8 bits pwm2 pwm1 pwm0 le g end: icr1 pcsr : input capture re g ister 1 : prescalar unit control/status re g ister ic tmow : input capture input pin : frequency division clock output pin figure 22.1 block diagram of prescalar unit section 22 prescalar unit rev.3.00 jan. 10, 2007 page 425 of 1038 rej09b0328-0300 22.1.3 pin configuration table 22.1 shows the pin configuration of the prescalar unit. table 22.1 pin configuration name abbrev. i/o function input capture input ic input prescalar unit input capture input pin frequency division clock output tmow output prescalar unit frequency division clock output pin 22.1.4 register configuration table 22.2 shows the register configuration of the prescalar unit. table 22.2 register configuration name abbrev. r/w size initial value address * input capture register 1 icr1 r byte h'00 h'd12c prescalar unit control/status register pcsr r/w byte h'08 h'd12d note: * lower 16 bits of the address. section 22 prescalar unit rev.3.00 jan. 10, 2007 page 426 of 1038 rej09b0328-0300 22.2 registers 22.2.1 input capture register 1 (icr1) 0 0 1 0 r 2 0 r 3 0 4 0 r 0 r 5 6 0 7 icr14 icr13 icr12 icr11 icr10 0 r icr17 r r r icr16 icr15 bit : initial value : r/w : input capture register 1 (icr1) captures 8-bit data of 2 15 to 2 8 of the frc according to the edge of the ic pin. icr1 is an 8-bit read-only register. the write operation becomes invalid. the icr1 values are undefined until the first capture is generated afte r the mode has been set to the standby mode, watch mode, subactive mode, and subsleeve mode. when reset, icr1 is initialized to h'00. 22.2.2 prescalar unit cont rol/status register (pcsr) 0 0 1 0 r/w 2 0 r/w 3 ? ? 1 4 0 r/w 5 0 6 0 7 r/w r/w iceg r/w icie 0 r/(w) * icif ncon/off dcs2 dcs1 dcs0 note: * only 0 can be written to clear the flag. bit : initial value : r/w : the prescalar unit control/status register (pcsr) controls the input capture function and selects the frequency division clock that is output from the tmow pin. pcsr is an 8-bit read/write enable register . when reset, pcsr is initialized to h'08. bit 7 ? input capture interrupt flag (icif): input capture interrupt request flag. this indicates that the input capture was performed according to the edge of the ic pin. bit 7 icif description 0 [clear condition] (initial value) when 0 is written after 1 has been read 1 [set condition] when the input capture was performed according to the edge of the ic pin section 22 prescalar unit rev.3.00 jan. 10, 2007 page 427 of 1038 rej09b0328-0300 bit 6 ? input capture interrupt enable (icie): when icif was set to 1 by the input capture according to the edge of the ic pin, icie enables and disables the generation of an input capture interrupt. bit 6 icie description 0 disables the generation of an input capture interrupt (initial value) 1 enables the generation of an input capture interrupt bit 5 ? ic pin edge select (iceg): iceg selects the input edge sense of the ic pin. bit 5 iceg description 0 detects the falling edge of the ic pin input (initial value) 1 detects the rising edge of the ic pin input bit 4 ? noise cancel on/off (ncon/off): ncon/off selects enable/dis able of the noise cancel function of the ic pin. for the noise cancel function, see section 22.3, noise cancel circuit. bit 4 ncon/off description 0 disables the noise cancel function of the ic pin (initial value) 1 enables the noise cancel function of the ic pin bit 3 ? reseved: when the bit is read, 1 is always read. the write operation is invalid. section 22 prescalar unit rev.3.00 jan. 10, 2007 page 428 of 1038 rej09b0328-0300 bits 2 to 0 ? frequency division clock output select (dcs2 to dcs0): dcs2 to dcs0 select eight types of frequency division clocks that are output from the tmow pin. bit 2 bit 1 bit 0 dcs2 dcs1 dcs0 description 0 outputs pss, /32 (initial value) 0 1 outputs pss, /16 0 outputs pss, /8 0 1 1 outputs pss, /4 0 outputs psw, w/32 0 1 outputs psw, w/16 0 outputs psw, w/8 1 1 1 outputs psw, w/4 22.2.3 port mode register 1 (pmr1) 7 pmr17 0 r/w 6 pmr16 0 r/w 5 pmr15 0 r/w 4 pmr14 0 r/w 3 pmr13 0 r/w 0 pmr10 0 r/w 2 pmr12 0 r/w 1 pmr11 0 r/w bit : initial value : r/w : the port mode register 1 (pmr1) controls switchi ng of each pin function of port 1. the switching is specified in a unit of bit. pmr1 is an 8-bit read/write enable register. when reset, pmr1 is initialized to h'00. bit 7 ? p17/tmow pin switching (pmr17): pmr17 sets whether the p17/tmow pin is used as a p17 i/o pin or a tmow pin for division clock output. bit 7 pmr17 description 0 the p17/tmow pin functions as a p17 i/o pin (initial value) 1 the p17/tmow pin functions as a tmow pin for division clock output section 22 prescalar unit rev.3.00 jan. 10, 2007 page 429 of 1038 rej09b0328-0300 bit 6 ? p16/ ic pin switching (pmr16): pmr16 sets whether the p16/ ic pin is used as a p16 i/o pin or an ic pin for the input capture input of the prescalar unit. bit 6 pmr16 description 0 the p16/ ic pin functions as a p16 i/o pin (initial value) 1 the p16/ ic pin functions as an ic input function 22.3 noise cancel circuit the ic pin has a built-in a noise cancel circuit. the circuit can be used for noise protection such as remote control receiving. the noise cancel circuit samples the input values of the ic pin twice at an interval of 256 states. if the input values are different, they are assumed to be noise. the ic pin can specify enable/disable of the noise cancel function according to the bit 4 (ncon/off) of the prescalar unit control/status register (pcsr). 22.4 operation 22.4.1 prescalar s (pss) the pss is a 17-bit counter that uses the system clock ( = fosc) as an input clock and generates the frequency division clocks ( /131072 to /2) of the peripheral function. the low-order 17 bits of the 18-bit free running counter (frc) corres pond to the pss. the frc is incremented by one clock. the pss output is shared by the timer and serial communication interface (sci), and the frequency division ratio can independently be set by each built-in peripheral function. when reset, the frc is initialized to h'00000, and starts increment after reset has been released. because the system clock oscillator is stopped in standby mode, watch mode, subactive mode, and subsleep mode, the pss operation is also stopped. in this case, the frc is also initialized to h'00000. the frc cannot be read and written from the cpu. section 22 prescalar unit rev.3.00 jan. 10, 2007 page 430 of 1038 rej09b0328-0300 22.4.2 prescalar w (psw) psw is a counter that uses the subclock as an input clock. the psw also generates the input clock of the timer a. in this case, the tim er a functions as a clock time base. when reset, the psw is initialized to h'00, and starts increment after reset has been released. even if the mode has been shifted to the standby mode*, watch mode*, subactive mode*, and subsleep mode*, the psw continues the operation as long as the clocks are supplied by the x1 and x2 pins. the psw can also be initialized to h'00 by setting the tma3 and tma2 bits of the timer mode register a (tma) to 11. note: * when the timer a is in module stop mode, the operation is stopped. figure 22.2 shows the supply of the clocks to the peripheral function by the pss and psw. /131072 to /2 timer sci osc1 fosc osc2 w/128 w/4 w timer a prescalar s x1 (fx) x2 cpu rom ram tmow pin peripheral register i/o port medium speed clock frequency divider prescalar w system clock selection subclock frequency dividers (1/2, 1/4, and 1/8) subclock oscillator system clock oscillator system clock duty correction circuit figure 22.2 clock supply 22.4.3 stable oscillation wait time count for the count of the stable oscillation stable wait time during the return from the low power consumption mode excluding the sleep mode, see section 4, power-down state. section 22 prescalar unit rev.3.00 jan. 10, 2007 page 431 of 1038 rej09b0328-0300 22.4.4 8-bit pwm this 8-bit pwm controls the duty control pwm signal in the conversion cycle 256 states. it counts the cycle and the duty cycle at 2 7 to 2 0 of the frc. it can be used for controlling reel motors and loading motors. for details, see section 19, 8-bit pwm. 22.4.5 8-bit input capture using ic pin this function catches the 8-bit data of 2 15 to 2 8 of the frc according to the edge of the ic pin. it can be used for remote control receiving. for the edge of the ic pin, the rising and falling edges can be selected. the ic pin has a built-in noise cancel circuit. see section 22.3, noise cancel circuit. an interrupt request is generated due to the input capture using the ic pin. note: rewriting the iceg bit, ncon/off bit, or pmr16 bit is incorrectly recognized as edge detection according to the combinations betw een the state and detection edge of the ic pin and the icif bit may be set after up to 384 seconds. 22.4.6 frequency division clock output the frequency division clock can be output from the tmow pin. for the frequency division clock, eight types of clocks ca n be selected according to the dcs2 to dcs0 bits in pcsr. the clock in which the system clock was frequen cy-divided is output in active mode and sleep mode and the clock in which the subclock was frequency-divided is output in active mode*, sleep mode*, and subactive mode. note: * when the timer a is in module stop mode, no clock is output. section 22 prescalar unit rev.3.00 jan. 10, 2007 page 432 of 1038 rej09b0328-0300 section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 433 of 1038 rej09b0328-0300 section 23 serial communication interface 1 (sci1) 23.1 overview the serial communication inte rface 1 (sci1) can handle both asynchronous and clocked synchronous serial communication. a function is also provided for serial communication between processors (multiprocessor communication function). 23.1.1 features sci1 features are listed below. (1) choice of asynchronous or clock synchronous serial communication mode asynchronous mode ? serial data communication is executed using an asynchronous system in which synchronization is achieved character by character ? serial data communication can be carried out with standard asynchronous communication chips such as a universal asynchronous r eceiver/transmitter (uart) or asynchronous communication interface adapter (acia) ? a multiprocessor communication function is provided that enables serial data communication with a number of processors ? choice of 12 serial data transfer formats ? data length: 7 or 8 bits ? stop bit length: 1 or 2 bits ? parity: even, odd, or none ? multiprocessor bit: 1 or 0 ? receive error detection: parity , overrun, and framing errors ? break detection: break can be detected by reading the si1 pin level directly in case of a framing error clock synchronous mode ? serial data communication is synchronized with a clock ? serial data communication can be carried out with other chips that have a synchronous communication function ? one serial data transfer format ? data length: 8 bits ? receive error detection: overrun errors detected section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 434 of 1038 rej09b0328-0300 (2) full-duplex communication capability ? the transmitter and receiver are mutually inde pendent, enabling transmission and reception to be executed simultaneously ? double-buffering is used in both the tran smitter and the receiver, enabling continuous transmission and continuous reception of serial data (3) built-in baud rate generator allows any bit rate to be selected (4) choice of serial clock source: internal clock from baud rate generator or external clock from sck1 pin (5) four interrupt sources ? four interrupt sources (transmit-data-empty, transmit-end, receive-data-full, and receive error) that can issue requests independently section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 435 of 1038 rej09b0328-0300 23.1.2 block diagram figure 23.1 shows a block diagram of the sci1. si1 so1 sck1 clock external clock /4 /16 /64 tei txi rxi eri rsr rdr1 tsr tdr1 smr1 scr1 ssr1 scmr1 brr1 : receive shift register : receive data register1 : transmit shift register : transmit data register1 : serial mode register1 : serial control register1 : serial status register1 : serial interface mode register1 : bit rate register1 scmr1 ssr1 scr1 smr1 transmission/ reception control baud rate generator brr1 module data bus bus interface internal data bus rdr1 tsr rsr parity gfeneration parity check legend: tdr1 figure 23.1 block diagram of sci1 section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 436 of 1038 rej09b0328-0300 23.1.3 pin configuration table 23.1 shows the serial pins used by the sci1. table 23.1 sci pins channel pin name symbol i/o function 1 serial clock pin 1 sck1 i/o sci1 clock input/output receive data pin 1 si1 input sci1 receive data input transmit data pin 1 so1 output sci1 transmit data output 23.1.4 register configuration the sci1 has the internal registers shown in ta ble 23.2. these registers are used to specify asynchronous mode or synchronous mode, the data format, and the bit rate, and to control the transmitter/receiver. table 23.2 sci registers channel name abbrev. r/w initial value address * 1 serial mode register 1 smr1 r/w h'00 h'd148 bit rate register 1 brr1 r/w h'ff h'd149 serial control register 1 scr1 r/w h'00 h'd14a transmit data register 1 tdr1 r/w h'ff h'd14b serial status register 1 ssr1 r/(w) * 2 h'84 h'd14c receive data register 1 rdr1 r h'00 h'd14d 1 serial interface mode register 1 scmr1 r/w h'f2 h'd14e common module stop control register mstpcrh r/w h'ff h'ffec mstpcrl r/w h'ff h'ffed notes: 1. lower 16 bits of the address. 2. only 0 can be written, to clear flags. section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 437 of 1038 rej09b0328-0300 23.2 register descriptions 23.2.1 receive shift register (rsr) 7 ? 6 ? 5 ? 4 ? 3 ? 0 ? 2 ? 1 ? bit : r/w : rsr is a register used to receive serial data. the sci1 sets serial data input from the si1 pin in rsr in the order received, starting with the lsb (bit 0), and converts it to parallel data. when one byte of data has been received, it is transferred to rdr1 automatically. rsr cannot be directly read or written to by the cpu. 23.2.2 receive data register (rdr1) 7 0 r 6 0 r 5 0 r 4 0 r 3 0 r 0 0 r 2 0 r 1 0 r bit : initial value : r/w : rdr1 is a register that stores received serial data. when the sci1 has received one byte of serial data , it transfers the received serial data from rsr to rdr1 where it is stored, a nd completes the receive operation. after this, rsr is receive- enabled. since rsr and rdr1 function as a double buffer in this way, continuous receive operations can be performed. rdr1 is a read-only register, and cannot be written to by the cpu. rdr1 is initialized to h'00 by a reset, and in standby mode, watch mode, subactive mode, subsleep mode, and module stop mode. section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 438 of 1038 rej09b0328-0300 23.2.3 transmit shift register (tsr) 7 ? 6 ? 5 ? 4 ? 3 ? 0 ? 2 ? 1 ? bit : r/w : tsr is a register used to transmit serial data. to perform serial data transmission, the sci1 first transfers transmit data from tdr1 to tsr, then sends the data to the so1 pin starting with the lsb (bit 0). when transmission of one byte is completed, the next transmit data is transferred from tdr1 to tsr, and transmission started, automatically. however, data transfer from tdr1 to tsr is not performed if the tdre bit in ssr1 is set to 1. tsr cannot be directly read or written to by the cpu. 23.2.4 transmit data register (tdr1) 7 1 r/w 6 1 r/w 5 1 r/w 4 1 r/w 3 1 r/w 0 1 r/w 2 1 r/w 1 1 r/w bit : initial value : r/w : tdr1 is an 8-bit register that st ores data for serial transmission. when the sci1 detects that tsr is empty, it transfers the transmit data written in tdr1 to tsr and starts serial transmission. c ontinuous serial transmission can be carried out by writing the next transmit data to tdr1 during serial transmission of the data in tsr. tdr1 can be read or written to by the cpu at all times. tdr1 is initialized to h'ff by a reset, and in standby mode, watch mode, subactive mode, subsleep mode, and module stop mode. section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 439 of 1038 rej09b0328-0300 23.2.5 serial mode register (smr1) 7 c/ a 0 r/w 6 chr 0 r/w 5 pe 0 r/w 4 o/ e 0 r/w 3 stop 0 r/w 0 cks0 0 r/w 2 mp 0 r/w 1 cks1 0 r/w bit : initial value : r/w : smr1 is an 8-bit register used to set the sci1?s serial transfer format and select the baud rate generator clock source. smr1 can be read or written to by the cpu at all times. smr1 is initialized to h'00 by a reset, and in standby mode, watch mode, subactive mode, subsleep mode, and module stop mode. bit 7 ? communication mode (c/ a ): selects asynchronous mode or clock synchronous mode as the sci1 operating mode. bit 7 c/ a description 0 asynchronous mode (initial value) 1 clock synchronous mode bit 6 ? character length (chr): selects 7 or 8 bits as the data length in asynchronous mode. in synchronous mode, a fixed data length of 8 bits is used regardless of the chr setting. bit 6 chr description 0 8-bit data (initial value) 1 7-bit data * note: * when 7-bit data is selected, the msb (bit 7) of tdr1 is not transmitted, and lsb- first/msb-first selection is not available. section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 440 of 1038 rej09b0328-0300 bit 5 ? parity enable (pe): in asynchronous mode, selects whether or not parity bit addition is performed in transmission, and parity bit checking in reception. in synchronous mode, or when a multiprocessor format is used, parity bit addition and checking is not performed, regardless of the pe bit setting. bit 5 pe description 0 parity bit addition and checking disabled (initial value) 1 parity bit addition and checking enabled * note: * when the pe bit is set to 1, the parity (even or odd) specified by the o/ e bit is added to transmit data before transmission. in reception, the parity bit is checked for the parity (even or odd) specified by the o/ e bit. bit 4 ? parity mode (o/ e ): selects either even or odd parity for use in parity addition and checking. the o/ e bit setting is only valid when the pe bit is set to 1, enabling parity bit addition and checking, in asynchronous mode. the o/ e bit setting is invalid in synchronous mode, when parity bit addition and checking is disabled in asynchronous mode, and when a multiprocessor format is used. bit 4 o/ e description 0 even parity * 1 (initial value) 1 odd parity * 2 notes: 1. when even parity is set, parity bit addition is performed in transmission so that the total number of 1 bits in the transmit character plus the parity bit is even. in reception, a check is performed to see if the total number of 1 bits in the receive character plus the parity bit is even. 2. when odd parity is set, parity bit addition is performed in transmission so that the total number of 1 bits in the transmit character plus the parity bit is odd. in reception, a check is performed to see if the total number of 1 bi ts in the receive character plus the parity bit is odd. section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 441 of 1038 rej09b0328-0300 bit 3 ? stop bit length (stop): selects 1 or 2 bits as the stop bit length in asynchronous mode. the stop bit setting is only valid in asynchronous mode. if synchronous mode is set the stop bit setting is invalid since stop bits are not added. bit 3 stop description 0 1 stop bit * 1 (initial value) 1 2 stop bits * 2 notes: 1. in transmission, a single 1 bit (stop bi t) is added to the end of a transmit character before it is sent. 2. in transmission, two 1 bits (stop bits) are added to the end of a transmit character before it is sent. in reception, 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; if it is 0, it is treated as the start bit of the next transmit character. bit 2 ? multiprocessor mode (mp): selects multiprocessor format. when multiprocessor format is selected, the pe bit and o/ e bit parity settings are invalid. the mp bit setting is only valid in asynchronous mode; it is invalid in synchronous mode. for details of the multiprocessor communication function, see section 23.3.3, multiprocessor communication function. bit 2 mp description 0 multiprocessor function disabled (initial value) 1 multiprocessor format selected section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 442 of 1038 rej09b0328-0300 bits 1 and 0 ? clock select 1 and 0 (cks1, cks0): these bits select the clock source for the baud rate generator. the clock source can be selected from , /4, /16, and /64, according to the setting of bits cks1 and cks0. for the relation between the clock source, the bit rate register setting, and the baud rate, see section 23.2.8, bit rate register (brr1). bit 1 bit 0 cks1 cks0 description 0 clock (initial value) 0 1 /4 clock 1 0 /16 clock 1 /64 clock 23.2.6 serial control register (scr1) 7 tie 0 r/w 6 rie 0 r/w 5 te 0 r/w 4 re 0 r/w 3 mpie 0 r/w 0 cke0 0 r/w 2 teie 0 r/w 1 cke1 0 r/w bit : initial value : r/w : scr1 is a register that performs enabling or disabling of sci1 transfer operations, serial clock output in asynchronous mode, and interrupt requests, and selection of the serial clock source. scr1 can be read or written to by the cpu at all times. scr1 is initialized to h'00 by a reset, and in standby mode, watch mode, subactive mode, subsleep mode, and module stop mode. bit 7 ? transmit interrupt enable (tie): enables or disables transmit-data-empty interrupt (txi) request generation when serial transmit data is transferred from tdr1 to tsr and the tdre flag in ssr1 is set to 1. bit 7 tie description 0 transmit-data-empty interrupt (txi) request disabled * (initial value) 1 transmit-data-empty interrupt (txi) request enabled note: * txi interrupt request cancellation can be performed by reading 1 from the tdre flag, then clearing it to 0, or clearing the tie bit to 0. section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 443 of 1038 rej09b0328-0300 bit 6 ? receive interrupt enable (rie): enables or disables receive -data-full interrupt (rxi) request and receive-error interrupt (eri) request generation when seri al receive data is transferred from rsr to rdr1 and the rdrf flag in ssr1 is set to 1. bit 6 rie description 0 receive-data-full interrupt (rxi) request and receive-error interrupt (eri) request disabled * (initial value) 1 receive-data-full interrupt (rxi) request and receive-error interrupt (eri) request enabled note: * rxi and eri interrupt request cancellation can be performed by reading 1 from the rdrf, fer, per, or orer flag, then clearing the flag to 0, or clearing the rie bit to 0. bit 5 ? transmit enable (te): enables or disables the start of serial transmission by the sci1. bit 5 te description 0 transmission disabled * 1 (initial value) 1 transmission enabled * 2 notes: 1. the tdre flag in ssr1 is fixed at 1. 2. in this state, serial transmission is started when transmit data is written to tdr1 and the tdre flag in ssr1 is cleared to 0. smr1 setting must be performed to decide the transmission format before setting the te bit to 1. bit 4 ? receive enable (re): enables or disables the start of serial reception by the sci1. bit 4 re description 0 reception disabled * 1 (initial value) 1 reception enabled * 2 notes: 1. clearing the re bit to 0 does not affect the rdrf, fer, per, and orer flags, which retain their states. 2. serial reception is started in this state when a start bit is detected in asynchronous mode or serial clock input is detected in synchronous mode. smr1 setting must be performed to decide the reception format before setting the re bit to 1. section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 444 of 1038 rej09b0328-0300 bit 3 ? multiprocessor interrupt enable (mpie): enables or disables multiprocessor interrupts. the mpie bit setting is only valid in asynchronous mode when receiving with the mp bit in smr1 set to 1. the mpie bit setting is invalid in clock synchronous mode or when the mp bit is cleared to 0. bit 3 mpie description 0 multiprocessor interrupts disabled (normal reception performed) (initial value) [clearing conditions] (1) when the mpie bit is cleared to 0 (2) when data with mpb = 1 is received 1 multiprocessor interrupts enabled * receive interrupt (rxi) requests, receive-error interrupt (eri) requests, and setting of the rdrf, fer, and orer flags in ssr are disabled until data with the multiprocessor bit set to 1 is received. note: * when receive data including mpb = 0 is received, receive data transfer from rsr to rdr1, receive error detection, and setting of the rdrf, fer, and orer flags in ssr1, is not performed. when receive data with mpb = 1 is received, the mpb bit in ssr1 is set to 1, the mpie bit is cleared to 0 automatically, and generation of rxi and eri interrupts (when the tie and rie bits in scr1 are set to 1) and fer and orer flag setting is enabled. bit 2 ? transmit end interrupt enable (teie): enables or disables transmit-end interrupt (tei) request generation if there is no valid transmit data in tdr1 when the msb is transmitted. bit 2 teie description 0 transmit-end interrupt (tei) request disabled * (initial value) 1 transmit-end interrupt (tei) request enabled * note: * tei cancellation can be performed by reading 1 from the tdre flag in ssr1, then clearing it to 0 and clearing the tend flag to 0, or clearing the teie bit to 0. bits 1 and 0 ? clock enable 1 and 0 (cke1, cke0): these bits are used to select the sci1 clock source and enable or disable clock output from the sck1 pin. the combination of the cke1 and cke0 bits determines whether the sck1 pin functions as an i/o port, the serial clock output pin, or the serial clock input pin. the setting of the cke0 bit, however, is only valid for internal clock operation (cke1 = 0) in asynchronous mode. the cke0 bit setting is invalid in synchronous mode, and in the case of external clock operation (cke1 = 1). note that the sci1?s operating mode must be decided using section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 445 of 1038 rej09b0328-0300 smr1 before setting the cke1 and cke0 bits. for details of clock source selection, see table 23.9. bit 1 bit 0 cke1 cke0 description asynchronous mode internal clock/sck1 pin functions as i/o port * 1 0 clock synchronous mode internal clock/sck1 pin functions as serial clock output * 1 asynchronous mode internal clock/sck1 pin functions as clock output * 2 0 1 clock synchronous mode internal clock/sck1 pin functions as serial clock output asynchronous mode external clock/sck1 pin functions as clock input * 3 0 clock synchronous mode external clock/sck1 pin functions as serial clock input asynchronous mode external clock/sck1 pin functions as clock input * 3 1 1 clock synchronous mode external clock/sck1 pin functions as serial clock input notes: 1. initial value 2. outputs a clock of the same frequency as the bit rate. 3. inputs a clock with a frequency 16 times the bit rate. 23.2.7 serial status register (ssr1) 7 tdre 1 r/(w) * 6 rdrf 0 r/(w) * 5 orer 0 r/(w) * 4 fer 0 r/(w) * 3 per 0 r/(w) * 0 mpbt 0 r/w 2 tend 1 r 1 mpb 0 r note: * only 0 can be written to clear the flag. bit : initial value : r/w : ssr1 is an 8-bit register containing status flags that indicate the operating status of the sci1, and multiprocessor bits. ssr1 can be read or written to by the cpu at a ll times. however, 1 cannot be written to flags tdre, rdrf, orer, per, and fer. also note that in order to clear these flags they must be read as 1 beforehand. the tend flag and mpb fl ag are read-only flags and cannot be modified. section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 446 of 1038 rej09b0328-0300 ssr1 is initialized to h'84 by a reset, and in standby mode, watch mode, subactive mode, subsleep mode, and module stop mode. bit 7 ? transmit data register empty (tdre): indicates that data has been transferred from tdr1 to tsr and the next serial data can be written to tdr1. bit 7 tdre description 0 [clearing condition] when 0 is written in tdre after reading tdre = 1 1 [setting conditions] (initial value) (1) when the te bit in scr1 is 0 (2) when data is transferred from tdr1 to tsr and data can be written to tdr1 bit 6 ? receive data register full (rdrf): indicates that the received data is stored in rdr1. bit 6 rdrf description 0 [clearing condition] (initial value) when 0 is written in rdrf after reading rdrf = 1 1 [setting condition] when serial reception ends normally and receive data is transferred from rsr to rdr1 note: rdr1 and the rdrf flag are not affected and retain their previous values when an error is detected during reception or when the re bit in scr1 is cleared to 0. if reception of the next data is completed while the rdrf flag is still set to 1, an overrun error will occur and the receive data will be lost. section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 447 of 1038 rej09b0328-0300 bit 5 ? overrun error (orer) indicates that an overrun error occurred du ring reception, causing abnormal termination. bit 5 orer description 0 [clearing condition] (initial value) * 1 when 0 is written in orer after reading orer = 1 1 [setting condition] when the next serial reception is completed while rdrf = 1 * 2 notes: 1. the orer flag is not affected and retains its previous state when the re bit in scr1 is cleared to 0. 2. the receive data prior to the overrun error is retained in rdr1, and the data received subsequently is lost. also, subsequent serial reception cannot be continued while the orer flag is set to 1. in clock synchronous mode, serial transmission cannot be continued, either. bit 4 ? framing error (fer): indicates that a framing error occurred during reception in asynchronous mode, causing abnormal termination. bit 4 fer description 0 [clearing condition] (initial value) * 1 when 0 is written in fer after reading fer = 1 1 [setting condition] when the sci1 checks the stop bit at the end of the receive data when reception ends, and the stop bit is 0 * 2 notes: 1. the fer flag is not affected and retains its previous state when the re bit in scr1 is cleared to 0. 2. in 2-stop-bit mode, only the first stop bit is checked for a value of 1; the second stop bit is not checked. if a framing error occurs, the receive data is transferred to rdr1 but the rdrf flag is not set. also, subsequent serial reception cannot be continued while the fer flag is set to 1. in clock synchronous mode, serial transmission cannot be continued, either. section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 448 of 1038 rej09b0328-0300 bit 3 ? parity error (per): indicates that a parity error oc curred during reception using parity addition in asynchronous mode, causing abnormal termination. bit 3 per description 0 [clearing condition] (initial value) * 1 when 0 is written in per after reading per = 1 1 [setting condition] when, in reception, the number of 1 bits in the receive data plus the parity bit does not match the parity setting (even or odd) specified by the o/ e bit in smr1 * 2 notes: 1. the per flag is not affected and retains its previous state when the re bit in scr1 is cleared to 0. 2. if a parity error occurs, the receive data is transferred to rdr1 but the rdrf flag is not set. also, subsequent serial reception cannot be continued while the per flag is set to 1. in clock synchronous mode, serial transmission cannot be continued, either. bit 2 ? transmit end (tend): indicates that there is no valid data in tdr1 when the last bit of the transmit character is sent, a nd transmission has been ended. the tend flag is read-only and cannot be modified. bit 2 tend description 0 [clearing condition] when 0 is written in tdre after reading tdre = 1 1 [setting conditions] (initial value) (1) when the te bit in scr1 is 0 (2) when tdre = 1 at transmission of the last bit of a 1-byte serial transmit character section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 449 of 1038 rej09b0328-0300 bit 1 ? multiprocessor bit (mpb): when reception is performed using a multiprocessor format in asynchronous mode, mpb stores the multiprocessor bit in the receive data. mpb is a read-only bit, and cannot be modified. bit 1 mpb description 0 [clearing condition] (initial value) * when data with a 0 multiprocessor bit is received 1 [setting condition] when data with a 1 multiprocessor bit is received note: * retains its previous state when the re bit in scr1 is cleared to 0 with multiprocessor format. bit 0 ? multiprocessor bit transfer (mpbt): when transmission is performed using a multiprocessor format in asynchronous mode, mpbt stores the multiprocessor bit to be added to the transmit data. the mpbt bit setting is invalid when a multiprocessor format is not used, when not transmitting, and in synchronous mode. bit 0 mpbt description 0 data with a 0 multiprocessor bit is transmitted (initial value) 1 data with a 1 multiprocessor bit is transmitted 23.2.8 bit rate register (brr1) 7 1 r/w 6 1 r/w 5 1 r/w 4 1 r/w 3 1 r/w 0 1 r/w 2 1 r/w 1 1 r/w bit : initial value : r/w : brr1 is an 8-bit register that sets the serial transfer bit rate in accordance with the baud rate generator operating clock selected by bits cks1 and cks0 in smr1. brr1 can be read or written to by the cpu at all times. brr1 is initialized to h'ff by a reset, and in standby mode, watch mode, subactive mode, subsleep mode, and module stop mode. table 23.3 shows sample brr1 settings in asynchronous mode, and table 23.4 shows sample brr1 settings in clock synchronous mode. section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 450 of 1038 rej09b0328-0300 table 23.3 brr1 settings for various bit rates (asynchronous mode) operating frequency (mhz) 2 2.097152 2.4576 3 bit rate (bits/s) n n error (%) n n error (%) n n error (%) n n error (%) 110 1 141 0.03 1 148 ? 0.04 1 174 ? 0.26 1 212 0.03 150 1 103 0.16 1 108 0.21 1 127 0.00 1 155 0.16 300 0 207 0.16 0 217 0.21 0 255 0.00 1 77 0.16 600 0 103 0.16 0 108 0.21 0 127 0.00 0 155 0.16 1200 0 51 0.16 0 54 ? 0.70 0 63 0.00 0 77 0.16 2400 0 25 0.16 0 26 1.14 0 31 0.00 0 38 0.16 4800 0 12 0.16 0 13 ? 2.48 0 15 0.00 0 19 ? 2.34 9600 ? ? ? 0 6 ? 2.48 0 7 0.00 0 9 ? 2.34 19200 ? ? ? ? ? ? 0 3 0.00 0 4 ? 2.34 31250 0 1 0.00 ? ? ? 0 ? ? 0 2 0.00 38400 ? ? ? ? ? ? 0 1 0.00 ? ? ? operating frequency (mhz) 3.6864 4 4.9152 5 bit rate (bits/s) n n error (%) n n error (%) n n error (%) n n error (%) 110 2 64 0.70 2 70 0.03 2 86 0.31 2 88 ? 0.25 150 1 191 0.00 1 207 0.16 1 255 0.00 2 64 0.16 300 1 95 0.00 1 103 0.16 1 127 0.00 1 129 0.16 600 0 191 0.00 0 207 0.16 0 255 0.00 1 64 0.16 1200 0 95 0.00 0 103 0.16 0 127 0.00 0 129 0.16 2400 0 47 0.00 0 51 0.16 0 63 0.00 0 64 0.16 4800 0 23 0.00 0 25 0.16 0 31 0.00 0 32 ? 1.36 9600 0 11 0.00 0 12 0.16 0 15 0.00 0 15 1.73 19200 0 5 0.00 ? ? ? 0 7 0.00 0 7 1.73 31250 ? ? ? 0 3 0.00 0 4 ? 1.70 0 4 0.00 38400 0 2 0.00 ? ? ? 0 3 0.00 0 3 1.73 section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 451 of 1038 rej09b0328-0300 operating frequency (mhz) 6 6.144 7.3728 8 bit rate (bits/s) n n error (%) n n error (%) n n error (%) n n error (%) 110 2 106 ? 0.44 2 108 0.08 2 130 ? 0.07 2 141 0.03 150 2 77 0.16 2 79 0.00 2 95 0.00 2 103 0.16 300 1 155 0.16 1 159 0.00 1 191 0.00 1 207 0.16 600 1 77 0.16 1 79 0.00 1 95 0.00 1 103 0.16 1200 0 155 0.16 0 159 0.00 0 191 0.00 0 207 0.16 2400 0 77 0.16 0 79 0.00 0 95 0.00 0 103 0.16 4800 0 38 0.16 0 39 0.00 0 47 0.00 0 51 0.16 9600 0 19 ? 2.34 0 19 0.00 0 23 0.00 0 25 0.16 19200 0 9 ? 2.34 0 9 0.00 0 11 0.00 0 12 0.16 31250 0 5 0.00 0 5 2.40 ? ? ? 0 7 0.00 38400 0 4 ? 2.34 0 4 0.00 0 5 0.00 ? ? ? operating frequency (mhz) 9.8304 10 bit rate (bits/s) n n error (%) n n error (%) 110 2 174 ? 0.26 2 177 ? 0.25 150 2 127 0.00 2 129 0.16 300 1 255 0.00 2 64 0.16 600 1 127 0.00 1 129 0.16 1200 0 255 0.00 1 64 0.16 2400 0 127 0.00 0 129 0.16 4800 0 63 0.00 0 64 0.16 9600 0 31 0.00 0 32 ? 1.36 19200 0 15 0.00 0 15 1.73 31250 0 9 ? 1.70 0 9 0.00 38400 0 7 0.00 0 7 1.73 section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 452 of 1038 rej09b0328-0300 table 23.4 brr1 settings for various bit rates (clock synchronous mode) operating frequency (mhz) 2 4 8 10 bit rate (bits/s) n n n n n n n n 110 3 70 ? ? 250 2 124 2 249 3 124 ? ? 500 1 249 2 124 2 249 ? ? 1 k 1 124 1 249 2 124 ? ? 2.5 k 0 199 1 99 1 199 1 249 5 k 0 99 0 199 1 99 1 124 10 k 0 49 0 99 0 199 0 249 25 k 0 19 0 39 0 79 0 99 50 k 0 9 0 19 0 39 0 49 100 k 0 4 0 9 0 19 0 24 250 k 0 1 0 3 0 7 0 9 500 k 0 0 * 0 1 0 3 0 4 1 m 0 0 * 0 1 2.5 m 0 0 * 5 m legend: blank: cannot be set. ? : can be set, but there will be a degree of error. * : continuous transfer is not possible. note: as far as possible, the setting should be made so that the error is no more than 1%. section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 453 of 1038 rej09b0328-0300 the brr1 setting is f ound from the following equations. ? asynchronous mode: n = 10 6 ? 1 64 2 2n ? 1 b ? clock synchronous mode: n = 10 6 ? 1 8 2 2n ? 1 b where b: bit rate (bits/s) n: brr1 setting for baud rate generator (0 n 255) : operating frequency (mhz) n: baud rate generator input clock (n = 0 to 3) (see the table below for the relation between n and the clock.) smr1 setting n clock cks1 cks0 0 0 0 1 /4 0 1 2 /16 1 0 3 /64 1 1 the bit rate error in asynchronous mode is found from the following equation: error (%) = { 10 6 ? 1 } 100 (n + 1) b 64 2 2n ? 1 table 23.5 shows the maximum bit rate for each frequency in asynchrono us mode. tables 23.6 and 23.7 show the maximum bit rates with external clock input. section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 454 of 1038 rej09b0328-0300 table 23.5 maximum bit rate for each frequency (asynchronous mode) (mhz) maximum bit rate (bits/s) n n 2 62500 0 0 2.097152 65536 0 0 2.4576 76800 0 0 3 93750 0 0 3.6864 115200 0 0 4 125000 0 0 4.9152 153600 0 0 5 156250 0 0 6 187500 0 0 6.144 192000 0 0 7.3728 230400 0 0 8 250000 0 0 9.8304 307200 0 0 10 312500 0 0 section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 455 of 1038 rej09b0328-0300 table 23.6 maximum bit rate with external clock input (asynchronous mode) (mhz) external input clock (mhz) maximum bit rate (bit/s) 2 0.5000 31250 2.097152 0.5243 32768 2.4576 0.6144 38400 3 0.7500 46875 3.6864 0.9216 57600 4 1.0000 62500 4.9152 1.2288 76800 5 1.2500 78125 6 1.5000 93750 6.144 1.5360 96000 7.3728 1.8432 115200 8 2.0000 125000 9.8304 2.4576 153600 10 2.5000 156250 table 23.7 maximum bit rate with external clock input (clock synchronous mode) (mhz) external input clock (mhz) maximum bit rate (bit/s) 2 0.3333 333333.3 4 0.6667 666666.7 6 1.0000 1000000.0 8 1.3333 1333333.3 10 1.6667 1666666.7 section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 456 of 1038 rej09b0328-0300 23.2.9 serial interface mode register (scmr1) 7 ? 1 ? 6 ? 1 ? 5 ? 1 ? 4 ? 1 ? 3 sdir 0 r/w 0 smif 0 r/w 2 sinv 0 r/w 1 ? 1 ? bit : initial value : r/w : scmr1 is an 8-bit readable/writable register used to select sci1 functions. scmr1 is initialized to h'f2 by a reset, and in standby mode, watch mode, subactive mode, subsleep mode, and module stop mode. bits 7 to 4 ? reserved: these bits cannot be modified and are always read as 1. bit 3 ? data transfer direction (sdir): selects the serial/parallel conversion format. bit 3 sdir description 0 tdr1 contents are transmitted lsb-first (initial value) receive data is stored in rdr1 lsb-first 1 tdr1 contents are transmitted msb-first receive data is stored in rdr1 msb-first bit 2 ? data invert (sinv): specifies inversion of the data logic level. the sinv bit does not affect the logic level of the parity bit(s): parity bit inversion requires inversion of the o/ e bit in smr1. bit 2 sinv description 0 tdr1 contents are transmitted without modification (initial value) receive data is stored in rdr1 without modification 1 tdr1 contents are inverted before being transmitted receive data is stored in rdr1 in inverted form section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 457 of 1038 rej09b0328-0300 bit 1 ? reserved: this bit cannot be modified and is always read as 1. bit 0 ? serial communication interf ace mode select (smif): 1 should not be written in this bit. bit 0 smif description 0 normal sci1 mode (initial value) 1 reserved mode 23.2.10 module stop control register (mstpcr) 7 1 r/w 6 1 r/w 5 1 r/w 4 1 r/w 3 1 r/w 2 1 r/w 1 1 r/w 0 1 r/w 7 1 r/w 6 1 r/w 5 1 r/w 4 1 r/w 3 1 r/w 2 1 r/w 1 1 r/w 0 1 r/w mstpcrh mstpcrl mstp15 mstp14 mstp13 mstp12 mstp11 mstp10 mstp9 mstp8 mstp7 mstp6 mstp5 mstp4 mstp3 mstp2 mstp1 mstp0 bit : initial value : r/w : mstpcr, comprising two 8-bit readable/writable registers, performs module stop mode control. when bit mstp8 is set to 1, sci1 operation stops at the end of the bus cycle and a transition is made to module stop mode. for details, see section 4.5, module stop mode. mstpcr is initialized to h'ffff by a reset. bit 0 ? module stop (mstp8): specifies the sci1 module stop mode. mstpcrh bit 0 mstp8 description 0 sci1 module stop mode is cleared 1 sci1 module stop mode is set (initial value) section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 458 of 1038 rej09b0328-0300 23.3 operation 23.3.1 overview the sci1 can carry out serial communication in two modes: asynchronous mode in which synchronization is achieved character by character, and synchronous mode in which synchronization is achieved with clock pulses. selection of asynchronous or synchronous mode and the transmission format is made using smr1 as shown in table 23.8. the sci1 clock is determined by a combination of the c/ a bit in smr1 and the cke1 and cke0 bits in scr1, as shown in table 23.9. (1) asynchronous mode ? data length: choice of 7 or 8 bits ? choice of parity addition, multiprocessor bit addition, and addition of 1 or 2 stop bits (the combination of these parameters determines the transfer format and character length) ? detection of framing, parity, and ove rrun errors, and breaks, during reception ? choice of internal or external clock as sci1 clock source ? when internal clock is selected: the sci1 operates on the baud rate generator clock and a clock with the same frequency as the bit rate can be output ? when external clock is selected: a clock with a frequency of 16 times the bit rate must be input (the built-in baud rate generator is not used) (2) clock synchronous mode ? transfer format: fixed 8-bit data ? detection of overrun errors during reception ? choice of internal or external clock as sci1 clock source ? when internal clock is selected: the sci1 operates on the baud rate generator clock and a serial clock is output off-chip ? when external clock is selected: the built-in baud rate generator is not used, and the sci1 operates on the input serial clock section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 459 of 1038 rej09b0328-0300 table 23.8 smr1 settings and serial transfer format selection smr1 settings sci1 transfer format bit 7 bit 6 bit 2 bit 5 bit 3 c/ a chr mp pe stop mode data length multiproc- essor bit parity bit stop bit length 0 1 bit 0 1 no 2 bits 0 1 bit 0 1 1 8-bit data yes 2 bits 0 1 bit 0 1 no 2 bits 0 1 bit 1 0 1 1 asynchro-nous mode 7-bit data no yes 2 bits ? 0 1 bit 0 ? 1 8-bit data 2 bits ? 0 1 bit 0 1 1 ? 1 asynchro-nous mode (multi- processor format) 7-bit data yes 2 bits 1 ? ? ? ? clock synchronous mode 8-bit data no no table 23.9 smr1 and scr1 settings and sci1 clock source selection smr1 scr1 setting bit 7 bit 1 bit 0 sci1 transfer clock c/ a cke1 cke0 mode clock source sck1 pin function 0 sci1 does not use sck1 pin 0 1 internal outputs clock with same frequency as bit rate 0 0 1 1 asynchronous mode external inputs clock with frequency of 16 times the bit rate 0 0 1 internal outputs serial clock 0 1 1 1 clock synchronous mode external inputs serial clock section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 460 of 1038 rej09b0328-0300 23.3.2 operation in asynchronous mode in asynchronous mode, characters are sent or r eceived, each preceded by a start bit indicating the start of communication and followed by one or two stop bits indicating the end of communication. serial communication is thus carried out with synchronization established on a character-by- character basis. inside the sci1, the transmitter and receiver are independent units, enabling full-duplex communication. both the transmitter and the receive r also have a double-buffered structure, so that data can be read or written during tran smission or reception, enabling continuous data transfer. figure 23.2 shows the general format for asynchronous serial communication. in asynchronous serial communication, the transmission line is usually held in the mark state (high level). the sci1 monitors the tr ansmission line, and when it goes to the space state (low level), recognizes a start bit and starts serial communication. one serial communication character consists of a start bit (low level), followed by data (in lsb- first order), a parity bit (high or low level), and finally one or two stop bits (high level). in asynchronous mode, the sci1 performs synchronization at the falling edge of the start bit in reception. the sci1 samples the data on the 8th pul se of a clock with a frequency of 16 times the length of one bit, so that the transfer data is latched at the center of each bit. lsb start bit msb idle state (mark state) stop bit(s) 0 transmit/receive data d0 d1 d2 d3 d4 d5 d6 d7 0/1 1 1 1 1 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 23.2 data format in asynchronous communication (example with 8-bit data, parity, two stop bits) section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 461 of 1038 rej09b0328-0300 (1) data transfer format table 23.10 shows the data transfer formats that can be used in asynchronous mode. any of 12 transfer formats can be selected by settings in smr1. table 23.10 serial transfer formats (asynchronous mode) pe 0 0 1 1 0 0 1 1 ? ? ? ? s 8-bit data stop s 7-bit data stop s 8-bit data stop stop s 8-bit data p stop s 7-bit data stop p s 8-bit data mpb stop s 8-bit data mpb stop stop s 7-bit data stop mpb s 7-bit data stop mpb stop s 7-bit data stop stop chr 0 0 0 0 1 1 1 1 0 0 1 1 mp 0 0 0 0 0 0 0 0 1 1 1 1 stop 0 1 0 1 0 1 0 1 0 1 0 1 smr1 settings 123456789101112 serial transfer format and frame length stop s 8-bit data p stop s 7-bit data stop p stop legend: s stop p mpb : start bit : stop bit : parity bit : multiprocessor bit section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 462 of 1038 rej09b0328-0300 (2) clock either an internal clock generated by the built-in baud rate generator or an external clock input at the sck1 pin can be selected as the sci1?s serial clock, according to the setting of the c/ a bit in smr1 and the cke1 and cke0 bits in scr1. for details of sci1 clock source selection, see table 23.9. when an external clock is input at the sck1 pin, the clock frequency should be 16 times the bit rate used. when the sci1 is operated on an internal clock, the clock can be output from the sck1 pin. the frequency of the clock output in this case is equal to the bit rate, and the phase is such that the rising edge of the clock is at the center of each transmit data bit, as shown in figure 23.3. 0 1 frame d0 d1 d2 d3 d4 d5 d6 d7 0/1 1 1 figure 23.3 relation between output clock and transfer data phase (asynchronous mode) section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 463 of 1038 rej09b0328-0300 (3) data transfer operations (a) sci1 initialization (asynchronous mode) before transmitting and receiving data, first clear the te and re bits in scr1 to 0, then initialize the sci1 as described below. when the operating mode, transfer format, etc ., is changed, the te and re bits must be cleared to 0 before making the change using the following procedure. when the te bit is cleared to 0, the tdre flag is set to 1 and tsr is initialized. note that clearing the re bit to 0 does not change the contents of the rdrf, per, fer, and orer flags, or the contents of rdr1. when an external clock is used the clock should not be stopped during operation, including initialization, since operation is uncertain. figure 23.4 shows a sample sci1 initialization flowchart. wait section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 464 of 1038 rej09b0328-0300 (b) serial data transmission (asynchronous mode) figure 23.5 shows a sample flowchart for serial transmission. the following procedure should be used for serial data transmission. no < end > [1] yes initialization start transmission read tdre flag in ssr1 [1] write transmit data to tdr1 and clear tdre flag in ssr1 to 0 no yes no yes read tend flag in ssr1 [3] no yes [4] clear pdr to 0 and set pcr to 1 clear te bit in scr1 to 0 tdre = 1 all data transmitted? tend = 1 break output? sci1 initialization: the so1 pin is automatically designated as the transmit data output pin. sci1 status check and transmit data write: read ssr1 and check that the tdre flag is set to 1, then write transmit data to tdr1 and clear the tdre flag to 0. serial transmission continuation procedure: to continue serial transmission, read 1 from the tdre flag to confirm that writing is possible, then write data to tdr1, and then clear the tdre flag to 0. break output at the end of serial transmission: to output a break in serial transmission, set pcr for the port corresponding to the so1 pin to 1, clear pdr to 0, then clear the te bit in scr1 to 0. [1] [2] [3] [4] figure 23.5 sample serial transmission flowchart section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 465 of 1038 rej09b0328-0300 in serial transmission, the sci1 operates as described below. [1] the sci1 monitors the tdre flag in ssr1, and if it is 0, recognizes that data has been written to tdr1, and transfers the data from tdr1 to tsr. [2] after transferring data from tdr1 to tsr, the sci1 sets the tdre flag to 1 and starts transmission. if the tie bit is set to 1 at this time, a transmit data empty interrupt (txi) is generated. the serial transmit data is sent from the so1 pin in the following order. [a] start bit: one 0-bit is output. [b] transmit data: 8-bit or 7-bit data is output in lsb-first order. [c] parity bit or multiprocessor bit: one parity bit (even or odd parity), or one multiprocessor bit is output. a format in which neither a parity bit nor a multiprocessor bit is 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 sci1 checks the td re flag at the timing for sending the stop bit. if the tdre flag is cleared to 0, the data is transferred from tdr1 to tsr, the stop bit is sent, and then serial transmission of the next frame is started. if the tdre flag is set to 1, the tend flag in ssr1 is set to 1, the stop bit is sent, and then the mark state is entered in which 1 is output continuously. if the teie bit in scr1 is set to 1 at this time, a tei interrupt request is generated. figure 23.6 shows an example of the operation for transmission in asynchronous mode. section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 466 of 1038 rej09b0328-0300 tdre tend 0 1 frame d0 d1 d7 0/1 1 0 d0 d1 d7 0/1 1 1 1 data start bit parity bit stop bit start bit data parity bit stop bit txi interrupt request generated data written to tdr1 and tdre flag cleared to 0 in txi interrupt handling routine tei interrupt request generated idle state (mark state) txi interrupt request generated figure 23.6 example of operation in transmission in asynchronous mode (example with 8-bit data, parity, one stop bit) section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 467 of 1038 rej09b0328-0300 (c) serial data recepti on (asynchronous mode) figure 23.7 shows a sample flow chart for serial reception. the following procedure should be used for serial data reception. yes < end > [1] no initialization start reception [2] no yes read rdrf flag in ssr1 [4] [5] clear re bit in scr1 to 0 read orer, per, fer flags in ssr1 error handling (continued on next page) [3] read receive data in rdr1, and clear rdrf flag in ssr1 to 0 no yes per fer orer = 1 rdrf = 1 all data received? sci1 initialization: the si1 pin is automatically designated as the receive data input pin. receive error handling and break detection: if a receive error occurs, read the orer, per, and fer flags in ssr1 to identify the error. after performing the appropriate error handling, ensure that the orer, per, and fer flags are all cleared to 0. reception cannot be resumed if any of these flags are set to 1. in the case of a framing error, a break can be detected by reading the value of the input port corresponding to the si1 pin. sci1 status check and receive data read: read ssr1 and check that rdrf = 1, then read the receive data in rdr1 and clear the rdrf flag to 0. transition of the rdrf flag from 0 to 1 can also be identified by an rxi interrupt. serial reception continuation procedure: to continue serial reception, before the stop bit for the current frame is received, read the rdrf flag, read rdr1, and clear the rdrf flag to 0. [1] [2][3] [4] [5] figure 23.7 sample serial reception data flowchart (1) section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 468 of 1038 rej09b0328-0300 < end > [3] error handling parity error handling yes no clear orer, per, and fer flags in ssr1 to 0 no yes no yes framing error handling no yes overrun error handling orer = 1 fer = 1 break? per = 1 clear re bit in scr1 to 0 figure 23.7 sample serial reception data flowchart (2) section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 469 of 1038 rej09b0328-0300 in serial reception, the sci1 operates as described below. [1] the sci1 monitors the transmission line, and if a 0 stop bit is detected, performs internal synchronization and starts reception. [2] the received data is stored in rsr in lsb-to-msb order. [3] the parity bit and stop bit are received. after receiving these bits, the sci1 carries out the following checks. [a] parity check: the sci1 checks whether the numbe r of 1 bits in the receive da ta agrees with the parity (even or odd) set in the o/ e bit in smr1. [b] stop bit check: the sci1 checks whethe r the stop bit is 1. if there are two stop bits, only the first is checked. [c] status check: the sci1 checks whether the rd rf flag is 0, indicating th at the receive data can be transferred from rsr to rdr1. if all the above checks are passed , the rdrf flag is set to 1, and the receive data is stored in rdr1. if a receive error* is detected in the error ch eck, the operation is as shown in table 23.11. note: * subsequent receive opera tions cannot be performed when a receive error has occurred. also note that the rdrf flag is not set to 1 in reception, and so the error flags must be cleared to 0. [4] if the rie bit in scr1 is se t to 1 when the rdrf flag ch anges to 1, a receive-data-full interrupt (rxi) request is generated. also, if the rie bit in scr1 is set to 1 when the orer, per, or fer flag changes to 1, a receive-error interrupt (eri) request is generated. table 23.11 receive errors and conditions for occurrence receive error abbrev. occurrence condition data transfer overrun error orer when the next data reception is completed while the rdrf flag in ssr1 is set to 1 receive data is not transferred from rsr to rdr1 framing error fer when the stop bit is 0 receive data is transferred from rsr to rdr1 parity error per when the received data differs from the parity (even or odd) set in smr1 receive data is transferred from rsr to rdr1 section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 470 of 1038 rej09b0328-0300 figure 23.8 shows an example of the operation for reception in asynchronous mode. rdrf fer 0 1 frame d0 d1 d7 0/1 1 0 d0 d1 d7 0/1 0 1 1 data start bit parity bit stop bit start bit data parity bit stop bit eri interrupt request generated by framing error idle state (mark state) rdr1 data read and rdrf flag cleared to 0 in rxi interrupt handling routine rxi interrupt request generation figure 23.8 example of sc i1 operation in reception (example with 8-bit data, parity, one stop bit) 23.3.3 multiprocessor communication function the multiprocessor communication function performs serial communication using a multiprocessor format, in which a multiprocessor bit is added to the transfer data, in asynchronous mode. use of this function enables data transfer to be performed among a number of processors sharing transmission lines. when multiprocessor communication is carried out, each receiving station is addressed by a unique id code. the serial communication cycle consists of tw o component cycles: an id transmission cycle which specifies the receiving station, and a data transmission cycle. the multiprocessor bit is used to differentiate between the id transmissi on cycle and the data transmission cycle. the transmitting station first sends the id of the receiving station with which it wants to perform serial communication as data with a 1 multiprocessor bit added. it then sends transmit data as data with a 0 multiprocessor bit added. the receiving station skips the data until data with a 1 multiprocessor bit is sent. when data with a 1 multiprocessor bit is received, the receiving station compares that data with its own id. the station whose id matc hes then receives the data sent next. stations whose id does not match continue to skip the data until data with a 1 multiprocessor bit is again received. in this way, data communication is carried out among a number of processors. figure 23.9 shows an example of inter-processor communication using a multiprocessor format. section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 471 of 1038 rej09b0328-0300 (1) data transfer format there are four data transfer formats. when a multiprocessor format is specified, the parity bit specification is invalid. for details, see table 23.10. (2) clock see the section on asynchronous mode. transmitting station receiving station a (id = 01) receiving station b (id = 02) receiving station c (id = 03) receiving station d (id = 04) serial communication line serial data id transmission cycle: receiving station specification data transmission cycle: data transmission to receiving station specified by id (mpb = 1) (mpb = 0) h'01 h'aa legend: mpb : multiprocessor bit figure 23.9 example of inter-processor communication using mu ltiprocessor format (transmission of data h'aa to receiving station a) (3) data transfer operations (a) multiprocessor serial data transmission figure 23.10 shows a sample flowchart for multiprocessor serial data transmission. the following procedure should be used for multiprocessor serial data transmission. section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 472 of 1038 rej09b0328-0300 no < end > [1] yes initialization start transmission read tdre flag in ssr1 [2] write transmit data to tdr1 and set mpbt bit in ssr1 no yes no yes read tend flag in ssr1 [3] no yes [4] clear pdr to 0 and set pcr to 1 clear te bit in scr1 to 0 tdre = 1 transmission end? tend = 1 break output? clear tdre flag to 0 sci1 initialization: the so1 pin is automatically designated as the transmit data output pin. sci1 status check and transmit data write: read ssr1 and check that the tdre flag is set to 1, then write transmit data to tdr1. set the mpbt bit in ssr1 to 0 or 1. finally, clear the tdre flag to 0. serial transmission continuation procedure: to continue serial transmission, be sure to read 1 from the tdre flag to confirm that writing is possible, then write data to tdr1, and then clear the tdre flag to 0. break output at the end of serial transmission: to output a break in serial transmission, set the port pcr to 1, clear pdr to 0, then clear the te bit in scr1 to 0. [1] [2] [3] [4] figure 23.10 sample multiprocessor serial transmission flowchart section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 473 of 1038 rej09b0328-0300 in serial transmission, the sci1 operates as described below. [1] the sci1 monitors the tdre flag in ssr1, and if it is 0, recognizes that data has been written to tdr1, and transfers the data from tdr1 to tsr. [2] after transferring data from tdr1 to tsr, the sci1 sets the tdre flag to 1 and starts transmission. if the tie bit is set to 1 at this time, a transmit-data-empty interrupt (txi) is generated. the serial transmit data is sent from the so2 pin in the following order. [a] start bit: one 0-bit is output. [b] transmit data: 8-bit or 7-bit data is output in lsb-first order. [c] multiprocessor bit one multiprocessor bit (mpbt value) is output. [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 sci1 checks the td re flag at the timing for sending the stop bit. if the tdre flag is cleared to 0, data is transferred from tdr1 to tsr, the stop bit is sent, and then serial transmission of the next frame is started. if the tdre flag is set to 1, the tend flag in ssr1 is set to 1, the stop bit is sent, and then the mark state is entered in which 1 is output continuously. if the teie bit in scr1 is set to 1 at this time, a transmit-end interrupt (tei) request is generated. section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 474 of 1038 rej09b0328-0300 figure 23.11 shows an example of sci1 operation for transmission using a multiprocessor format. tdre tend 0 1 frame d0 d1 d7 0/1 1 0 d0 d1 d7 0/1 1 1 data data txi interrupt request general data written to tdr1 and tdre flag cleared to 0 in txi interrupt handling routine tei interrupt request generated idle state (mark state) txi interrupt request generated start bit multi- processor bit stop bit start bit stop bit 1 multi- processor bit figure 23.11 example of sci1 operation in transmission (example with 8-bit data, multip rocessor bit, one stop bit) (b) multiprocessor serial data reception figure 23.12 shows a sample flowchart for multiprocessor serial reception. the following procedure should be used for multiprocessor serial data reception. section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 475 of 1038 rej09b0328-0300 yes < end > [1] no initialization start reception no yes [4] clear re bit in scr1 to 0 error handling (continued on next page) [5] no yes fer orer = 1 rdrf = 1 all data received? set mpie bit in scr1 to 1 [2] read orer and fer flags in ssr1 read rdrf flag in ssr1 [3] read receive data in rdr1 no yes this station's id? read orer and fer flags in ssr1 yes no read rdrf flag in ssr1 no yes fer orer = 1 read receive data in rdr1 rdrf = 1 sci1 initialization: the si1 pin is automatically designated as the receive data input pin. id reception cycle: set the mpie bit in scr1 to 1. sci1 status check, id reception and comparison: read ssr1 and check that the rdrf flag is set to 1, then read the receive data in rdr1 and compare it with this station's id. if the data is not this station's id, set the mpie bit to 1 again, and clear the rdrf flag to 0. if the data is this station's id, clear the rdrf flag to 0. sci1 status check and data reception: read ssr1 and check that the rdrf flag is set to 1, then read the data in rdr1. receive error handling and break detectioon: if a receive error occurs, read the orer and fer flags in ssr1 to identify the error. after performing the appropriate error handling, ensure that the orer and fer flags are both cleared to 0. reception cannot be resumed if either of these flags is set to 1. in the case of a framing error, a break can be detected by reading the si1 in value. [1] [2] [3] [4] [5] figure 23.12 sample multiprocesso r serial reception flowchart (1) section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 476 of 1038 rej09b0328-0300 < end > error handling yes no clear orer, per, and fer flags in ssr1 to 0 no yes no yes framing error handling overrun error handling orer = 1 fer = 1 break? clear re bit in scr1 to 0 [5] figure 23.12 sample multiprocesso r serial reception flowchart (2) figure 23.13 shows an example of sci1 operation for multiprocessor format reception. section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 477 of 1038 rej09b0328-0300 mpie rdr1 value 0 d0 d1 d7 1 1 0 d0 d1 d7 0 1 1 1 data (id1) start bit mpb stop bit start bit data (data 1) mpb stop bit rxi interrupt request (multi- processor interrupt) generated idle state (mark state) rdrf rdr1 data read and rdrf flag cleared to 0 in rxi interrupt handling routine if not this station's id, mpie bit is set to 1 again rxi interrupt request is not generated, and rdr1 retains its state id1 (a) data does not match station's id mpie rdr1 value 0 d0 d1 d7 1 1 0 d0 d1 d7 0 1 1 1 data (id2) start bit mpb stop bit start bit data (data 2) mpb stop bit rxi interrupt request (multi- processor interrupt) generated idle state (mark state) rdrf rdr1 data read and rdrf flag cleared to 0 in rxi interrupt handling routine matches this station's id, so reception continues, and data is received in rxi interrupt handling routine mpie bit set to 1 again id2 (b) data matches station's id data2 id1 mpie = 0 mpie = 0 figure 23.13 example of sci operation in reception (example with 8-bit data, multip rocessor bit, one stop bit) section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 478 of 1038 rej09b0328-0300 23.3.4 operation in clock synchronous mode in clock synchronous mode, data is transmitted or received in synchronization with clock pulses, making it suitable for high-speed serial communication. inside the sci1, the transmitter and receiver are independent units, enabling full-duplex communication by use of a common clock. both the transmitter and the receiver also have a double-buffered structure, so that data can be read or written during transmission or reception, enabling continuous data transfer. figure 23.14 shows the general format for clock synchronous serial communication. don't care don't care one unit of transfer data (character or frame) bit 0 serial data synchronous clock bit 1 bit 3 bit 4 bit 5 lsb msb bit 2 bit 6 bit 7 * * note: * high except in continuous transmit/reception figure 23.14 data format in clock synchronous communication in clock synchronous serial communication, data on the transmission line is output from one falling edge of the serial clock to the next. data is guaranteed valid at the rising edge of the serial clock. in clock synchronous serial communication, one character consists of data output starting with the lsb and ending with the msb. after the msb is output, the transmission line holds the msb state. in clock synchronous mode, the sci1 receives data in synchronization with the rising edge of the serial clock. (1) data transfer format a fixed 8-bit data format is used. no parity or multiprocessor bits are added. (2) clock either an internal clock generated by the built-in baud rate generator or an external serial clock input at the sck1 pin can be select ed, according to the setting of the c/ a bit in smr1 and the cke1 and cke0 bits in scr1. for details on sci1 clock source selection, see table 23.9. when the sci1 is operated on an internal clock, the serial clock is output from the sck1 pin. section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 479 of 1038 rej09b0328-0300 eight serial clock pulses are out put in the transfer of one char acter, and when no transfer is performed the clock is fixed high. when only receive operations are performed, however, the serial clock is output until an overrun error occurs or the re bit is cleared to 0. to perform receive operations in units of one character, se lect an external cloc k as the clock source. (3) data transfer operations (a) sci1 initialization (synchronous mode) before transmitting and receiving data, first clear the te and re bits in scr1 to 0, then initialize the sci1 as described below. when the operating mode, transfer format, etc ., is changed, the te and re bits must be cleared to 0 before making the change using the following procedure. when the te bit is cleared to 0, the tdre flag is set to 1 and tsr is initialized. note that clearing the re bit to 0 does not change the settings of the rdrf, per, fer, and orer flags, or the contents of rdr1. figure 23.15 shows a sample sci1 initialization flowchart. section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 480 of 1038 rej09b0328-0300 wait section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 481 of 1038 rej09b0328-0300 (b) serial data transmission (clock synchronous mode) figure 23.16 shows a sample flowchart for serial transmission. the following procedure should be used for serial data transmission. no < end > [1] yes initialization start transmission read tdre flag in ssr1 [2] write transmit data to tdr1 and clear tdre flag in ssr1 to 0 no yes no yes read tend flag in ssr1 [3] clear te bit in scr1 to 0 tdre = 1 all data transmitted? tend = 1 sci1 initialization: the so1 pin is automatically designated as the transmit data output pin. sci1 status check and transmit data write: read ssr1 and check that the tdre flag is set to 1, then write transmit data to tdr1 and clear the tdre flag to 0. serial transmission continuation procedure: to continue serial transmission, be sure to read 1 from the tdre flag to confirm that writing is possible, then write data to tdr1, and then clear the tdre flag to 0. [1] [2] [3] figure 23.16 sample serial transmission flowchart section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 482 of 1038 rej09b0328-0300 in serial transmission, the sci1 operates as described below. [1] the sci1 monitors the tdre flag in ssr1, and if it is 0, recognizes that data has been written to tdr1, and transfers the data from tdr1 to tsr. [2] after transferring data from tdr1 to tsr, the sci1 sets the tdre flag to 1 and starts transmission. if the tie bit is set to 1 at this time, a transmit-data-empty interrupt (txi) is generated. when clock output mode has been set, the sci1 outputs 8 serial clock pulses. when use of an external clock has been specified, data is output synchronized with the input clock. the serial transmit data is sent from the so1 pin starting with the lsb (bit 0) and ending with the msb (bit 7). [3] the sci1 checks the td re flag at the timing for sending the msb (bit 7). if the tdre flag is cleared to 0, data is transf erred from tdr1 to tsr, and serial transmission of the next frame is started. if the tdre flag is set to 1, the tend flag in ssr1 is set to 1, the msb (bit 7) is sent, and the so1 pin maintains its state. if the teie bit in scr1 is set to 1 at this time, a transmit-end interrupt (tei) request is generated. [4] after completion of serial transmission, the sck1 pin is held in a constant state. figure 23.17 shows an example of sci1 operation in transmission. transfer direction bit 0 serial data synchronous clock 1 frame tdre tend data written to tdr1 and tdre flag cleared to 0 in txi interrupt handling routine txi interrupt request generated bit 1 bit 7 bit 0 bit 1 bit 6 bit 7 txi interrupt request generated tei interrupt request generated figure 23.17 example of sci1 operation in transmission section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 483 of 1038 rej09b0328-0300 (c) serial data reception (clock synchronous mode) figure 23.18 shows a sample flow chart for serial reception. the following procedure should be used for serial data reception. when changing the operating mode from asynchronous to synchronous, be sure to check that the orer, per, and fer flags are all cleared to 0. the rdrf flag will not be set if the fer or per flag is set to 1, and neither transmit nor receive operations will be possible. section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 484 of 1038 rej09b0328-0300 yes < end > [1] no initialization start reception [2] no yes read rdrf flag in ssr1 [4] [5] clear re bit in scr1 to 0 error handling (continued below) [3] read receive data in rdr1, and clear rdrf flag in ssr1 to 0 no yes orer = 1 rdrf = 1 all data received? read orer flag in ssr1 < end > error handling clear orer flag in ssr1 to 0 overrun error handling [3] sci1 initialization: the si1 pin is automatically designated as the receive data input pin. receive error handling: if a receive error occurs, read the orer flag in ssr1, and after performing the appropriate error handling, clear the orer flag to 0. transfer cannot be resumed if the orer flag is set to 1. sci1 status check and receive data read: read ssr1 and check that the rdrf flag is set to 1, then read the receive data in rdr1 and clear the rdrf flag to 0. transition of the rdrf flag from 0 to 1 can also be identified by and rxi interrupt. serial reception continuation procedure: to continue serial reception, before the msb (bit 7) of the current frame is received, finish reading the rdrf flag, reading rdr1, and clearing the rdrf flag to 0 [1] [2][3] [4] figure 23.18 sample s erial reception flowchart section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 485 of 1038 rej09b0328-0300 in serial reception, the sci1 operates as described below. [1] the sci1 performs internal initialization in synchronization with serial clock i nput or output. [2] the received data is stored in rsr in lsb-to-msb order. after reception, the sci1 checks whether the rdrf flag is 0 and the receive data can be transferred from rsr to rdr1. if this check is passed, the rdrf flag is set to 1, and the receive data is stored in rdr1. if a receive error is detected in the error check , the operation is as shown in table 23.11. neither transmit nor receive operations can be performed subsequently when a receive error has been found in the error check. [3] if the rie bit in scr1 is se t to 1 when the rdrf flag ch anges to 1, a receive-data-full interrupt (rxi) request is generated. also, if the rie bit in scr1 is set to 1 when the orer flag changes to 1, a receive-error interrupt (eri) request is generated. figure 23.19 shows an example of sci1 operation in reception. bit 7 serial data synchronous clock 1 frame rdrf orer eri interrupt request generated by overrun error rxi interrupt request generated rdr1 data read and rdrf flag cleared to 0 in rxi interrupt handling routine rxi interrupt request generated bit 0 bit 7 bit 0 bit 1 bit 6 bit 7 figure 23.19 example of sc i1 operation in reception (d) simultaneous serial data transmissi on and reception (clock synchronous mode) figure 23.20 shows a sample flowchart for simultaneous serial transmit and receive operations. the following procedure should be used for simultaneous serial data transmit and receive operations. section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 486 of 1038 rej09b0328-0300 yes < end > [1] no initialization start transfer [5] error handling [3] read receive data in rdr1, and clear rdrf flag in ssr1 to 0 no yes orer = 1 all data received? [2] read tdre flag in ssr1 no yes tdre = 1 write transmit data to tdr1 and clear tdre flag in ssr1 to 0 no yes rdr = 1 read orer flag in ssr1 [4] read rdrf flag in ssr1 clear te and re bits in scr1 to 0 note: when switching from transmit or receive operation to simultaneous transmit and receive operations, first clear the te bit and re bit to 0, then set both these bits to 1 simultaneously. sci1 initialization: the so1 pin is designated as the transmit data output pin, and the si1 pin is designated as the receive data input pin, enabling simultaneous transmit and receive operations. sci1 status check and transmit data write: read ssr1 and check that the tdre flag is set to 1, then write transmit data to tdr1 and clear the tdre flag to 0. transition of the tdre flag from 0 to 1 can also be identified by a txi interrupt. receive error handling: if a receive error occurs, read the orer flag in ssr1, and after performing the appropriate error handling, clear the orer flag to 0. transmission/reception cannot be resumed if the orer flag is set to 1. sci1 status check and receive data read: read ssr1 and check that the rdrf flag is set to 1, then read the receive data in rdr1 and clear the rdrf flag to 0. transition of the rdrf flag from 0 to 1 can also be identified by an rxi interrupt. serial transmission/reception continuation procedure: to continue serial transmission/reception, before the msb (bit 7) of the current frame is received, finish reading the rdrf flag, reading rdr1, and clearing the rdrf flag to 0. also before the msb (bit 7) of the current frame is transmitted, read 1 from the tdre flag to confirm that writing is possible, then write data to tdr1 and clear [1] [2] [3] [4] [5] figure 23.20 sample flowchar t of simultaneous serial tr ansmit and receive operations section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 487 of 1038 rej09b0328-0300 23.4 sci1 interrupts the sci1 has four interrupt so urces: the transmit-end interrupt (tei) request, receive-error interrupt (eri) request, receive-data-full interr upt (rxi) request, and transmit-data-empty interrupt (txi) request. table 23.12 shows the interrupt sources and their relative priorities. individual interrupt sources can be enabled or disabled with the tie, rie, and teie bits in scr1. each kind of interrupt request is sent to the interrupt controller independently. when the tdre flag in ssr1 is set to 1, a txi interrupt request is generated. when the tend flag in ssr1 is set to 1, a tei interrupt request is generated. when the rdrf flag in ssr1 is set to 1, an rx i interrupt request is generated. when the orer, per, or fer flag in ssr1 is set to 1, an eri interrupt request is generated. table 23.12 sci1 interrupt sources channel interrupt source description priority * eri interrupt by receive error (orer, fer, or per) rxi interrupt by receive data register full (rdrf) txi interrupt by transmit data register empty (tdre) 1 tei interrupt by transmit end (tend) high low the tei interrupt is requested when the tend flag is set to 1 while the teie bit is set to 1. the tend flag is cleared at the same time as the tdre flag. consequently, if a tei interrupt and a txi interrupt are requested simultaneously, the txi interrupt will have priority for acceptance, and the tdre flag and tend flag may be cleared. note that the tei interrupt will not be accepted in this case. section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 488 of 1038 rej09b0328-0300 23.5 usage notes the following points should be noted when using the sci1. (1) relation between writes to tdr1 and the tdre flag the tdre flag in ssr1 is a status flag that i ndicates that transmit data has been transferred from tdr1 to tsr. when the sci1 transfers data from tdr1 to tsr, the tdre flag is set to 1. data can be written to tdr1 regardless of the state of the tdre flag. however, if new data is written to tdr1 when the tdre flag is cleared to 0, the data stored in tdr1 will be lost since it has not yet been transferred to tsr. it is therefore essential to check that the tdre flag is set to 1 before writing transmit data to tdr1. (2) operation when multiple recei ve errors occur simultaneously if a number of receive errors occur at the same tim e, the state of the status flags in ssr1 is as shown in table 23.13. if there is an overrun error, data is not transferred from rsr to rdr1, and the receive data is lost. table 23.13 state of ssr1 status flags and transfer of receive data ssr1 status flags rdrf orer fer per receive data transfer rsr rdr1 receive errors 1 1 0 0 overrun error 0 0 1 0 { framing error 0 0 0 1 { parity error 1 1 1 0 overrun error + framing error 1 1 0 1 overrun error + parity error 0 0 1 1 { framing error + parity error 1 1 1 1 overrun error + framing error + parity error notes: { : receive data is transferred from rsr to rdr1. : receive data is not transferred from rsr to rdr1. (3) break detection and processing when a framing error (fer) is detected, a break can be detected by reading the si1 pin value directly. in a break, the input from the si1 pin becomes all 0s, and so the fer flag is set, and the parity error flag (per) may also be set. note that, since the sci1 cont inues the receive operation after receiving a break, even if the fer flag is cleared to 0, it will be set to 1 again. section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 489 of 1038 rej09b0328-0300 (4) sending a break the so1 pin has a dual function as an i/o port whose direction (input or output) is determined by pdr and pcr. this feature can be used to send a break. between serial transmission initialization and setting of the te bit to 1, the mark state is replaced by the value of pdr (the pin does not function as the so1 pin until the te bit is set to 1). consequently, pcr and pdr for the port corresponding to the so1 pin should first be set to 1. to send a break during serial transmission, first clear pdr to 0, then clear the te bit to 0. when the te bit is cleared to 0, the transmitter is initialized regardless of the current transmission state, the so1 pin becomes an i/o port, and 0 is output from the so1 pin. (5) receive error flags and transmit oper ations (clock synchronous mode only) transmission cannot be started when a receive error flag (orer, per, or fer) is set to 1, even if the tdre flag is cleared to 0. be sure to clear the receive error flags to 0 before starting transmission. note also that receive error flag s cannot be cleared to 0 even if the re bit is cleared to 0. (6) receive data sampling timing and reception margin in asynchronous mode in asynchronous mode, the sci1 operates on a base clock with a frequency of 16 times the transfer rate. in reception, the sci1 samples the falling edge of the start bit using the base clock, and performs internal synchronization. receive data is latched internally at the rising edge of the 8th pulse of the base clock. this is illustrated in figure 23.21. internal base clock 16 clocks 8 clocks receive data synchronization sampling timing start bit d0 d1 data sampling timing 15 0 7 15 0 07 figure 23.21 receive data samplin g timing in asynchronous mode section 23 serial communication interface 1 (sci1) rev.3.00 jan. 10, 2007 page 490 of 1038 rej09b0328-0300 thus the receive margin in asynchronous mode is given by equation (1) below. m = ? (0.5 ? 1 ) ? (l ? 0.5) f ? ? d ? 0.5 ? ? 100% 2n n ?..(1) where m: receive margin (%) n: ratio of bit rate to clock (n = 16) d: clock duty (d = 0 to 1.0) l: frame length (l = 9 to 12) f: absolute value of clock rate deviation assuming values of f = 0 and d = 0.5 in equation (1), a receive margin of 46.875% is given by equation (2) below. when d = 0.5 and f = 0, m = (0.5 ? 1 ) 100% 2 16 = 46.875% ?..(2) however, this is only a theoretical value, and a margin of 20% to 30% should be allowed in system design. section 24 serial communication interface 2 (sci2) rev.3.00 jan. 10, 2007 page 491 of 1038 rej09b0328-0300 section 24 serial communication interface 2 (sci2) 24.1 overview the serial communication interface 2 (sci2) that has a 32-byte da ta buffer carries out clocked synchronous serial transmission of 32 bytes by a single operation. 24.1.1 features sci2 features are listed below. ? 32 bytes data transfer can be automatically carried out ? choice of 7 internal clocks ( /256, /64, /32, /16, /8, /4, and /2) and an external clock as serial clock source ? interrupt occurs when transmission has been completed or an error has occurred ? data transfer at intervals of 1 byte can be set data transfer can be carried out at intervals of 1 byte. the interval can be selected from a multiple of internal clock cycle by 56, 24, or 8 times ? start of data transfer can be controlled by input of chip select ? strobe pulse is output for each 1-byte transfer section 24 serial communication interface 2 (sci2) rev.3.00 jan. 10, 2007 page 492 of 1038 rej09b0328-0300 24.1.2 block diagram figure 24.1 shows a block diagram of the sci2. legend: star /256, /64, /32, /16, /8, /4, /2 edar : starting address register : ending address register sck2 strb : sci2 clock input/output pin : sci2 strobe signal output pin scr2 scsr2 : serial control register 2 : serial control status register cs so2 : sci2 chip select signal input pin : sci2 transmit data output pin si2 : sci2 receive data input pin internal clock sck2 interrupt request si2 so2 cs strb sck2 shift register star edar scr2 scsr2 data buffer (32 bytes) interrupt generation circuit transmit/ receive control circuit internal data bus figure 24.1 block diagram of sci2 section 24 serial communication interface 2 (sci2) rev.3.00 jan. 10, 2007 page 493 of 1038 rej09b0328-0300 24.1.3 pin configuration table 24.1 shows pin configuration of the sci2. table 24.1 pin configuration name abbrev. i/o function sci2 clock sck2 i/o sci2 clock input/output pin sci2 data input si2 input sci2 receive data input pin sci2 data output so2 output sci2 transmit data output pin sci2 strobe strb output sci2 strobe signal output pin sci2 chip select cs input sci2 chip select signal input pin 24.1.4 register configuration table 24.2 shows register configuration of the sci2. table 24.2 register configuration name abbrev. r/w initial value address * starting address register star r/w h'e0 h'd0e0 ending address register edar r/w h'e0 h'd0e1 serial control register 2 scr2 r/w h'20 h'd0e2 serial control status register 2 scsr2 r/w h'60 h'd0e3 serial data buffer (32 bytes) ? r/w undefined h'd0c0 to h'd0df note: * lower 16 bits of the address. section 24 serial communication interface 2 (sci2) rev.3.00 jan. 10, 2007 page 494 of 1038 rej09b0328-0300 24.2 register descriptions 24.2.1 starting address register (star) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 6 1 7 ? ? ? ? ? ? r/w r/w sta4 sta3 sta2 sta1 sta0 11 bit : initial value : r/w : the star is a readable/writable register that specifies the tran sfer starting address within the address space (h'ffd0c0 to h'ffd0df) to which a 32-byte data buffer is assigned. the 5 low- order bits of the star correspond to the 5 low-order bits of the address of 32-byte buffer. the range for executing continuous data transfer on star and edar is specified. when the value of star is equal to that of edar, only one-byte transfer is carried out. since the 7 to 5 bits of the star are reserved, writes are disabl ed. when each bit is read, 1 is read at all times. the star is initialized to h'e0 by a reset. 24.2.2 ending address register (edar) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 6 1 7 ? ? ? ? ? ? r/w r/w eda4 eda3 eda2 eda1 eda0 11 bit : initial value : r/w : the edar is a readable/writable register that specifies the tran sfer ending address within the address space (h'ffd0c0 to h'ffd0df) to which 32-byte data buffer is assigned. the 5 low- order bits of edar correspond to the 5 low-order bits of the address of 32-byte buffer. the range for executing continuous data transfer is specifi ed by the edar and the star. if the value of the star is equal to that of the edar, only one-byte transfer is carried out. since the 7 to 5 bits of the edar are reserved, writes are disabl ed. when each bit is read, 1 is read at all times. the edar is initialized to h'e0 by a reset. section 24 serial communication interface 2 (sci2) rev.3.00 jan. 10, 2007 page 495 of 1038 rej09b0328-0300 24.2.3 serial control register 2 (scr2) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 ? ? 6 7 r/w r/w gap1 0 r/w abtie r/w teie gap0 cks2 cks1 cks0 01 bit : initial value : r/w : the scr 2 is a readable/writable register that enables or disables generation of sci2 interrupt and selects an data transfer inte rval and transfer clock when an internal clock is used. the scr2 is initialized to h'20 by a reset. bit 7 ? transmit end interrupt enable (teie): enables or disables th e occurrence of transmit- end interrupt when data transfer has been completed and tei of the scr2 has been set to 1. bit 7 teie description 0 transmit-end interrupt disabled (initial value) 1 transmit-end interrupt enabled bit 6 ? transmit cutoff interrupt (abtie): enables or disables th e occurrence of transmit- cutoff interrupt when the cs pin has entered a high level during transmission and abt of the scrs2 has been set to 1. bit 6 abtie description 0 transmit-cutoff interrupt disabled (initial value) 1 transmit-cutoff interrupt enabled bit 5 ? reserved: when read, 1 is read at a ll times. writes are disabled. section 24 serial communication interface 2 (sci2) rev.3.00 jan. 10, 2007 page 496 of 1038 rej09b0328-0300 bits 4 and 3 ? transmit data interval select 1 and 0 (gap1, gap0): when an internal clock is used, data can be transmitted at 1-byte intervals. during that time, the sck2 pin retains the high level. when data is transmitted without interv als, the strb signal retains the low level. bit 4 bit 3 gap1 gap0 description 0 0 data transmission without intervals (initial value) 0 1 data intervals: 8 clocks 1 0 data intervals: 24 clocks 1 1 data intervals: 56 clocks bits 2 to 0 ? transfer clock select 2 to 0 (cks2 to cks0): selects transfer clock. bit 2 bit 1 bit 0 transfer clock cycle cks2 cks1 cks0 sck2 pin clock source prescaler division ratio = 10 mhz = 5 mhz 0 0 0 /256 (initial value) 25.6 s 51.2 s 0 0 1 /64 6.4 s 12.8 s 0 1 0 /32 3.2 s 6.4 s 0 1 1 /16 1.6 s 3.2 s 1 0 0 /8 0.8 s 1.6 s 1 0 1 /4 0.4 s 0.8 s 1 1 0 sck2 output prescaler s /2 ? 0.4 s 1 1 1 sck2 inputexternal clock ? ? ? section 24 serial communication interface 2 (sci2) rev.3.00 jan. 10, 2007 page 497 of 1038 rej09b0328-0300 24.2.4 serial control status register 2 (scsr2) 0 0 1 0 r/(w) * 2 0 r/(w) * 3 0 4 0 r/w 5 6 ? ? ? ? 7 r/w r/(w) * sol r/(w) * tei orer wt abt stf 01 1 note: * only 0 can be written to clear the flag. bit : initial value : r/w : the scsr2 is an 8-bit register that indicates the sci2?s st ate of operation and error. the scsr2 is initialized to h'60 by a reset. bit 7 ? transmit end interrupt request flag (tei): indicates that data transmission or reception has been completed. bit 7 tei description 0 [clearing condition] (initial value) when 0 is written after reading 1 1 [setting condition] when transmission or reception has been completed bits 6 and 5 ? reserved: when each bit is read, 1 is read at all times. writes are disabled. bit 4 ? extension data bit (sol): the sol sets the output level of the so2 pin. when read, the output level of the so2 pin is read. output of the so2 pin after completion of transmission retains the value of final bit of transfer data, but the output level of the so2 pin can be changed by operating this bit before or after transmission. however, setting of the sol bit becomes invalid when the next transmission is started. therefore, if the output level of the so2 pin is changed after completion of transmission, write operation for sol must be performed every time when transmission is terminated. since writing to this register during data transfer may cause malfunction, write operation must not be performed during transmission. bit 4 sol description read the so2 pin output is at a low level (initial value) 0 write the so2 pin output is changed to a low level 1 read the so2 pin output is at a high level write the so2 pin output is changed to a high level section 24 serial communication interface 2 (sci2) rev.3.00 jan. 10, 2007 page 498 of 1038 rej09b0328-0300 bit 3 ? overrun error flag (orer): the orer indicates an occurrence of overrun error while an external clock is used. when excessive pulse s are overlapped with the normal transfer clock caused by external noise, etc. during transmission, this bit is set to 1. at this time data transfer cannot be assured. when a clock is input after completion of transmission, it is also found to be in the state of overrun and this bit is set to 1. however, overrun is not detected when the cs pin is at a high level. bit 3 orer description 0 [clearing condition] (initial value) when 0 is written after reading 1 1 [setting condition] when excessive pulses are overlapped with a normal transfer clock while an external clock is used, or when a clock is input after completion of transmission bit 2 ? wait flag (wt): the wt indicates that read/ or write to serial data buffer (32 bytes) has been executed during transmission and in the cs input standby mode. the instruction at that time is ignored and this bit is set to 1. bit 2 wt description 0 [clearing condition] (initial value) when 0 is written after reading 1 1 [setting condition] when an instruction to read/write to serial data buffer (32 bits) is directed during transmission and in the cs input standby mode section 24 serial communication interface 2 (sci2) rev.3.00 jan. 10, 2007 page 499 of 1038 rej09b0328-0300 bit 1 ? abort flag (abt): the abt indicates that the cs pin has entered a high level during transmission. when a high level of the cs pin is detected during transfer, the transfer is immediately cut off, and this bit is set to 1, and then the sck2 and so2 pins go into the high impedance state. at this time values of internal registers other than scsr2 and serial data buffer (32 bytes) are retained. transfer cannot be carried out while this bit is set to 1. resume transfer after clearing to 0. bit 1 abt description 0 [clearing condition] (initial value) when 0 is written after reading 1 1 [setting condition] during transfer and when cs pin has entered a high level bit 0 ? start flag (stf): the stf controls the start of transfer operations. when this bit is set to 1 and pmr30 of pmr3 is 0, transfer operation of the sci2 is started. when pmr30 of pmr3 is 1, the low level of the cs pin is detected and transfer is started. this bit retains 1 during transfer and in the cs input standby mode, and it is cleared to 0 after completion of transfer and when transfer is cut off by the cs pin. therefore, this bit can be used as a busy flag. when this bit is cleared to 0 during transfer, the transfer is cut off and the sc i2 is initialized. at this time the contents of internal registers other than the scsr2 and the serial data buffer (32 bytes) are retained. bit 0 stf description read transfer operations stops (initial value) 0 write transfer operation discontinues and the sci2 is initialized 1 read during transfer operation or in cs input standby mode write transfer operation starts section 24 serial communication interface 2 (sci2) rev.3.00 jan. 10, 2007 page 500 of 1038 rej09b0328-0300 24.2.5 module stop control register (mstpcr) 7 1 mstp15 r/w mstpcrh 6 1 mstp14 r/w 5 1 mstp13 r/w 4 1 mstp12 r/w 3 1 mstp11 r/w 2 1 mstp10 r/w 1 1 mstp9 r/w 0 1 mstp8 r/w 7 1 mstp7 r/w 6 1 mstp6 r/w 5 1 mstp5 r/w 4 1 mstp4 r/w 3 1 mstp3 r/w 2 1 mstp2 r/w 1 1 mstp1 r/w 0 1 mstp0 r/w mstpcrl bit : initial value : r/w : the mstpcr, comprising two 8-bit readable/writable registers, performs module stop mode control. when the mstpcr is set to 1, the sci2 stops at the end of bus cycle and a transition is made to the module stop mode. for details, see section 4.5 module stop mode. the mstpcr is initialized to h'ffff by a reset. bit 7 ? module stop (mstp7): specifies the sci2 module stop mode. mstpcrl bit 7 mstp7 description 0 sci2 module stop mode is cleared 1 sci2 module stop mode is set (initial value) section 24 serial communication interface 2 (sci2) rev.3.00 jan. 10, 2007 page 501 of 1038 rej09b0328-0300 24.3 operation the sci2, comprising 32 bytes serial data buffer, can continuously transmit a maximum of 32 bytes data by a single operation, synchronized with clock pulse. installation of a register enables to select transmit, receive, or simu ltaneous transmit/receive. when transm it is set, the value of serial data buffer is retained even after completion of transmission. an internal or external clock can be selected as tr ansfer clock. when an in ternal clock is selected, data can be transmitted at 1-byte intervals. the strobe signal can also be output from the strb pin. when an external clock is selected, malfunction due to clock can be detected by the overrun flag. the start of transfer and its for ced cutoff can be controlled by cs input. forced cutoff can be detected by the abort flag. 24.3.1 clock selection of a transfer clock can be made from seven internal clocks and an external clock. when an internal clock is selected, the sck2 pin becomes a clock output pin. 24.3.2 data transfer format figures 24.2 and 24.3 show transfer format of the sci2. lsb-first transfer that allows to transmit/receive from the lowest-order bit of data is performed. transmit data is output from the fall of the transfer clock to its next fall. receive data is collected at the rise of the transfer clock. when an internal clock is selected as a transfer clock, data can be transferred at intervals of 1 byte. the sck2 output is retained at a high level between transfer data. the strobe signal can be output from the strb pin. selection of interval of transfer data is set at gap1 or gap0. section 24 serial communication interface 2 (sci2) rev.3.00 jan. 10, 2007 page 502 of 1038 rej09b0328-0300 so2/si2 sck2 start of transfer bit 0 end of transfer cs strb bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 figure 24.2 transfer format (transfer data without intervals) section 24 serial communication interface 2 (sci2) rev.3.00 jan. 10, 2007 page 503 of 1038 rej09b0328-0300 so2/si2 sck2 start of transfer 8, 24, and 56 clocks bit 0 end of transfer cs strb bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 figure 24.3 transfer format (transfer data with intervals) section 24 serial communication interface 2 (sci2) rev.3.00 jan. 10, 2007 page 504 of 1038 rej09b0328-0300 24.3.3 data transfer operations (1) sci2 initialization to carry out data transfer, first initialize the sci2 using software. initialization is performed as described below: (1) use pmr2, pmr3, star, edar, and scr2 to set the pin and transmission mode while stf of scsr2 is set to 0. (2) the sci2 pin is also used as a port. switching of a port is performed on pmr3. the so2 pin allows to select cmos output or nmos open drain output on pmr2. transfer clock and transfer data intervals can be set on scr2. (3) the starting and ending addresses in the tr ansfer data area are set on star and edar. if the value of the ending address is smaller than th at of the starting address, transfer data at h'ffd0df and then return to h'ffd0c0 so that transfer to the ending address can be carried out as shows in figure 24.4. if the value of the starting address is equal to that of the ending address is equal, perform one-byte transfer. end h'ffd0c0 ending address starting address h'ffd0df start figure 24.4 if the value of the ending address is smaller than that of the starting address section 24 serial communication interface 2 (sci2) rev.3.00 jan. 10, 2007 page 505 of 1038 rej09b0328-0300 (2) transmit operations transmit operations are performed as described below: (1) set pmr26 and pmr27 of pmr2 to 1 and set them to the so2 and sck2 pins, respectively. set the so2 pin to the open drain output using pmr20 of pmr2 and set them to the cs and strb pins, respectively, using pmr30 and pmr31 of pmr3, as necessary. (2) set the transfer clock and transfer data intervals (only when an internal clock is in operation) by setting scr2. (3) write transmit data to serial data buffer. in transmit operations, the contents of the data buffer will be retained even after the end of transmission. when the same data is transmitted again, it is not necessary to write data. (4) set star to the 5 low-order bits at the transmission starting address and edar to the 5 low-order bits at the transmission ending address. (5) set stf to 1. when pmr30 of pmr3 is se t to 0, transmission is started by setting stf. while pmr30 of pmr3 is set to 1, transmission is started when low level of the cs pin is detected. (6) after completion of transmission, tei of scsr2 is set to 1. stf is cleared to 0. when an internal clock is selected, synchronous clock is output from the sck2 pin at the time of starting transmission. when transmission has been completed, synchronous clock is not output until the next stf is set. during that time, the so2 pin continues to output the value of final bit of the immediately preceding data. when an external clock is selected, data is tran smitted, synchronized with the clock input from the sck2 pin. if the synchronous clock is continuously input after completion of transmission, no transmission is performed as the overrun state has been found and then orer of the scsr2 is set to 1. the so2 pin continues to retain the value of final bit of the preceding data. however, if the cs of pmr3 is set to 1, overrun is not detected when the cs pin is at a high level. the output value of the so2 pin while transmission is being stopped can be changed by sol of scsr2. data buffer cannot be read or written from cpu during transmission or in the cs standby mode. when a read instruction has been executed, h'ff is read. even if a write instruction is executed, buffer does not change. when a read/write instruction has been executed during transmission or in the cs input standby mode, wt of the scsr2 is set. while pmr30 of pmr3 is set to 1, transmission is immediately cut off when a high level of the cs pin has been detected during transmission, and abt is set to 1, and then stf is cleared to 0. the sck2 and so2 pins enter the high impedance state. therefore, note that transmission may not be carried out while abt is set to 1, and thus transmission must be resumed after clearing to 0. section 24 serial communication interface 2 (sci2) rev.3.00 jan. 10, 2007 page 506 of 1038 rej09b0328-0300 (3) receive operations receive operations are perfor med as described below: (1) set pmr25 and pmr27 of pmr2 to 1 and set them to the si2 and sck2 pins, respectively. set them to the cs pin, using pmr30 of pmr3 as necessary. (2) set the transfer clock and transfer data intervals (only when an internal clock is in operation) by setting scr2. (3) set star to 5 low-order bits at the receive starting address and edar to 5 low-order bits at the receive ending address. this enables to determine the area in the serial data buffer where receive data is stored. (4) set stf to 1. when pmr30 of pmr3 is set to 0, reception is started by setting stf. while pmr30 of pmr3 is set to 1, recepti on is started when low level of the cs pin is detected. (5) after completion of reception, tei of sc sr2 is set to 1. stf is cleared to 0. (6) read the receive data stored from the serial data buffer. when an internal clock is selected, synchronous clock is output from the sck2 pin at the time of starting reception. when reception has been completed, synchronous clock is not output until the next stf is set. when an external clock is selected, data is r eceived, synchronized with the clock input from the sck2 pin. if the synchronous clock is continu ously input after completion of reception, no reception is performed as the overrun state has been found and then orer of the scsr2 is set to 1. however, if the cs of pmr3 is set to 1, overrun is not detected when the cs pin is at a high level. data buffer cannot be read or written from cpu during reception or in the cs standby mode. when a read instruction has been executed, h'ff is read. even if a write instruction is executed, buffer does not change. when a read/write instruction has been executed during reception or in the cs input standby mode, wt of the scsr2 is set. while cs of pmr3 is set to 1, transmission is immediately cut off when a high level of the cs pin has been detected during transmission, and abt is set to 1, and then stf is cleared to 0. the sck2 and so2 pins enter the high impedance state. therefore, note that transmission may not be carried out while abt is set to 1, and thus transmission must be resumed after clearing to 0. section 24 serial communication interface 2 (sci2) rev.3.00 jan. 10, 2007 page 507 of 1038 rej09b0328-0300 (4) simultaneous transmit/receive operations simultaneous transmit/receive operations are performed as described below: (1) set pmr25, pmr26 and pmr27 of pmr2 to 1 and set them to the si2, so2 and sck2 pins, respectively. set the so2 pin to open drain output, using pmr20 of pmr2, and set them to the cs and strb pins, respectively, using pmr30 and pmr31, as necessary. (2) set the transfer clock and transfer data intervals (only when an internal clock is in operation) by setting scr2. (3) write transmit data to serial data buffer. in the simultaneous transmit/receive operations, the receive data is stored in the same address alternately with the transmit data. (4) set star to 5 low-order bits at the transmission starting address and edar to 5 low-order bits at the transmission ending address. (5) set stf to 1. when pmr30 of pmr3 is se t to 0, transmission is started by setting stf. while pmr30 of pmr3 is set to 1, transmission is started when low level of the cs pin is detected. (6) after completion of transmission, tei of scsr2 is set to 1. stf is cleared to 0. (7) read the receive data stored from the serial data buffer. when an internal clock is selected, synchronous clock is output from the sck2 pin at the time of starting transmission. when transmission has been completed, synchronous clock is not output until the next stf is set. during that time, the so2 pin continues to output the value of final bit of the preceding data. when an external clock is selected, data is tr ansmitted, synchronized with the clock input from the sck2 pin. if the synchronous clock is continuously input after completion of transmission, no transmission is performed as the overrun state has been found and then orer of the scsr2 is set to 1. the so2 pin continues to retain the value of final bit of the preceding data. however, if the cs of pmr3 is set to 1, overrun is not detected when the cs pin is at a high level. the output value of the so2 pin while transmission is being stopped can be changed by sol of scsr2. data buffer cannot be read or written from cpu during transmission or in the cs standby mode. when a read instruction has been executed, h'ff is read. even if a write instruction is executed, buffer does not change. when a read /write instruction has been executed during transmission or in the cs input standby mode, wt of the scsr2 is set. while the cs of pmr3 is set to 1, transmission is immediately cut off when a high level of the cs pin has been detected during transmission, and abt is set to 1, and then st f is cleared to 0. the sck2 and so2 pins enter the high impedance state. therefore, note that transmission may not be carried out while abt is set to 1, and thus transmission must be resumed after clearing to 0. section 24 serial communication interface 2 (sci2) rev.3.00 jan. 10, 2007 page 508 of 1038 rej09b0328-0300 24.4 interrupt sources an interrupt source of the sci2 is transmission cutoff by completion of transmission and the cs pin, to which different vector addresses are assigned. on completion of data transfer, tei of scsr2 is set to 1, and transfer-end interrupt request is generated. this interrupt can specify enable/disable by setting teie of scr2. while pmr30 of pmr3 is set to 1, transfer is cut off when the cs pin enters a high level during data transfer, and abt of scsr2 is set to 1 and th en transfer cutoff interrupt request is generated. this interrupt can specify enable/disable by setting abtie of scr2. in the cas e of transfer cutoff by the cs pin, overrun error, and read/write to serial data buffer during transfer and in the cs standby mode, abt, orer, and wt of the scsr2 is set to 1, respectively. these bits allow to determine error factors. section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 509 of 1038 rej09b0328-0300 section 25 i 2 c bus interface (iic) 25.1 overview the i 2 c bus interface conforms to and provides a subset of the philips i 2 c bus (inter-ic bus) interface functions. the register c onfiguration that controls the i 2 c bus differs partly from the philips configuration, however. each i 2 c bus interface channel uses only one data line (sda) and one clock line (scl) to transfer data, saving board and connector space. 25.1.1 features ? selection of addressing format or non-addressing format ? i 2 c bus format: addressing format with acknowledge bit, for master/slave operation ? serial format: non-addressing format without acknowledge bit, for master operation only ? conforms to philips i 2 c bus interface (i 2 c bus format) ? two ways of setting slave address (i 2 c bus format) ? start and stop conditions generated automatically in master mode (i 2 c bus format) ? selection of acknowledge out put levels when receiving (i 2 c bus format) ? automatic loading of acknowle dge bit when transmitting (i 2 c bus format) ? wait function in master mode (i 2 c bus format) ? a wait can be inserted by driving the sc l pin low after data transfer, excluding acknowledgement. the wait can be cleared by clearing the interrupt flag. ? wait function in slave mode (i 2 c bus format) ? a wait request can be generated by driving the scl pin low after data transfer, excluding acknowledgement. the wait request is cleared when the next transfer becomes possible. ? three interrupt sources ? data transfer end (including transmission mode transition with i 2 c bus format and address reception after loss of master arbitration) ? address match: when any slave address matche s or the general call address is received in slave receive mode (i 2 c bus format) ? stop condition detection ? selection of 16 internal clocks (in master mode) ? direct bus drive (with scl and sda pins) ? two pins-p24/scl and p23/sda- (normally cmos pins) function as nmos-only outputs when the bus drive f unction is selected. section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 510 of 1038 rej09b0328-0300 25.1.2 block diagram figure 25.1 shows a block diagram of the i 2 c bus interface. figure 25.2 shows an example of i/o pin connections to external circuits. i/o pins are driven only by nmos and apparently function as nmos open-drain outputs. however, applicable voltages to input pins depend on the power (vcc) voltage of this lsi. scl ps noise canceller bus state decision circuit output data control circuit iccr clock control icmr icsr icdrs address comparator arbitration decision circuit sar, sarx sda noise canceler interrupt generator interrupt request internal data bus legend: iccr icmr icsr icdr sar sarx ps : i 2 c control register : i 2 c mode register : i 2 c status register : i 2 c data register : slave address register : slave address register x : prescaler icdrr icdrt figure 25.1 block diagram of i 2 c bus interface section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 511 of 1038 rej09b0328-0300 v cc scl in scl out scl sda in sda out (master) this chip sda scl sda scl in scl out scl sda in sda out (slave 1) sda scl in scl out scl sda in sda out (slave 2) sda v cc figure 25.2 i 2 c bus interface connections (example: this chip as master) 25.1.3 pin configuration table 25.1 summarizes the input/output pins used by the i 2 c bus interface. table 25.1 i 2 c bus interface pins name abbrev. i/o function serial clock pin scl i/o iic serial clock input/output serial data pin sda i/o iic serial data input/output section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 512 of 1038 rej09b0328-0300 25.1.4 register configuration table 25.2 summarizes the registers of the i 2 c bus interface. table 25.2 register configuration name abbrev. r/w initial value address * 1 i 2 c bus control register iccr r/w h'01 h'd158 i 2 c bus status register icsr r/w h'00 h'd159 i 2 c bus data register icdr r/w ? h'd15e * 2 i 2 c bus mode register icmr r/w h'00 h'd15f * 2 slave address register sar r/w h'00 h'd15f * 2 second slave address register sarx r/w h'01 h'd15e * 2 serial/timer control register stcr r/w h'00 h'ffee module stop control register mstpcrh r/w h'ff h'ffec mstpcrl r/w h'ff h'ffed notes: 1. lower 16 bits of the address. 2. the register that can be written or read depends on the ice bit in the i 2 c bus control register. the slave address register can be accessed when ice = 0, and the i 2 c bus mode register can be accessed when ice = 1. section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 513 of 1038 rej09b0328-0300 25.2 register descriptions 25.2.1 i 2 c bus data register (icdr) 7 icdr7 ? r/w 6 icdr6 ? r/w 5 icdr5 ? r/w 4 icdr4 ? r/w 3 icdr3 ? r/w 0 icdr0 ? r/w 2 icdr2 ? r/w 1 icdr1 ? r/w bit : initial value : r/w : icdrr 7 icdrr7 ? r 6 icdrr6 ? r 5 icdrr5 ? r 4 icdrr4 ? r 3 icdrr3 ? r 0 icdrr0 ? r 2 icdrr2 ? r 1 icdrr1 ? r bit : initial value : r/w : icdrs 7 icdrs7 ? ? 6 icdrs6 ? ? 5 icdrs5 ? ? 4 icdrs4 ? ? 3 icdrs3 ? ? 0 icdrs0 ? ? 2 icdrs2 ? ? 1 icdrs1 ? ? bit : initial value : r/w : icdrt 7 icdrt7 ? w 6 icdrt6 ? w 5 icdrt5 ? w 4 icdrt4 ? w 3 icdrt3 ? w 0 icdrt0 ? w 2 icdrt2 ? w 1 icdrt1 ? w bit : initial value : r/w : tdre, rdrf (internal flag) ? rdrf 0 ? ? tdre 0 ? bit : initial value : r/w : icdr is an 8-bit readable/writable register th at is used as a transmit data register when transmitting and a receive data register when recei ving. icdr is divided internally into a shift register (icdrs), receive buffer (icdrr), and tran smit buffer (icdrt). icdrs cannot be read or written by the cpu, icdrr is read-only, and icdrt is write-only. data transfers among the three registers are performed automatically in co ordination with changes in the bus state, and section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 514 of 1038 rej09b0328-0300 affect the status of internal flags such as tdre and rdrf. after transmission/reception of one frame of data using icdrs, if the i 2 c bus is in transmit mode and the next data is in icdrt (the tdre flag is 0), data is transferred automatically from icdrt to icdrs. after transmission/reception of one frame of data using icdrs, if the i 2 c bus is in receive mode and no previous data remains in icd rr (the rdrf flag is 0), data is transferred automatically from icdrs to icdrr. if the number of bits in a frame, excluding the acknowledge bit, is less than 8, transmit data and receive data are stored differently. transmit data should be written justified toward the msb side when mls = 0, and toward the lsb side when ml s = 1. receive data bits read from the lsb side should be treated as valid when mls = 0, and bits read from the msb side when mls = 1. icdr is assigned to the same address as sarx, and can be written and read only when the ice bit is set to 1 in iccr. the value of icdr is undefined after a reset. the tdre and rdrf flags are set and cleared under the conditions shown below. setting the tdre and rdrf flags affects the status of the interrupt flags. tdre description 0 the next transmit data is in icdr (icdrt), or transmission cannot be started [clearing conditions] (initial value) (1) when transmit data is written in icdr (icdrt) in transmit mode (trs = 1) (2) when a stop condition is detected in the bus line state after a stop condition is issued with the i 2 c bus format or serial format selected (3) when a stop condition is detected with the i 2 c bus format selected (4) in receive mode (trs = 0) (a 0 write to trs during transfer is valid after reception of a frame containing an acknowledge bit) 1 the next transmit data can be written in icdr (icdrt) [setting conditions] (1) in transmit mode (trs = 1), when a start condition is detected in the bus line state after a start condition is issued in master mode with the i 2 c bus format or serial format selected (2) when data is transferred from icdrt to icdrs (data transfer from icdrt to icdrs when trs = 1 and tdre = 0, and icdrs is empty) (3) when a switch is made from receive mode (trs = 0) to transmit mode (trs = 1) after detection of a start condition section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 515 of 1038 rej09b0328-0300 rdrf description 0 the data in icdr (icdrr) is invalid (initial value) [clearing condition] when icdr (icdrr) receive data is read in receive mode 1 the icdr (icdrr) receiv e data can be read [setting condition] when data is transferred from icdrs to icdrr (data transfer from icdrs to icdrr in case of normal termination with trs = 0 and rdrf = 0) 25.2.2 slave address register (sar) 7 sva6 0 r/w 6 sva5 0 r/w 5 sva4 0 r/w 4 sva3 0 r/w 3 sva2 0 r/w 0 fs 0 r/w 2 sva1 0 r/w 1 sva0 0 r/w bit : initial value : r/w : sar is an 8-bit readable/writable register th at stores the slave address and selects the communication format. when the chip is in slave mode (and the addressing format is selected), if the upper 7 bits of sar match the upper 7 bits of the first frame received after a start condition, the chip operates as the slave de vice specified by the master device. sar is assigned to the same address as icmr, and can be written and read onl y when the ice bit is cleared to 0 in iccr. sar is initialized to h'00 by a reset. bits 7 to 1 ? slave address (sva6 to sva0): set a unique address in bits sva6 to sva0, differing from the addresses of other slave devices connected to the i 2 c bus. bit 0 ? format select (fs): used together with the fsx bit in sarx to select the communication format. ? i 2 c bus format: addressing format with acknowledge bit ? synchronous serial format: non-addressing format without acknowledge bit, for master mode only section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 516 of 1038 rej09b0328-0300 the fs bit also specifies whether or not sar slave address recognition is performed in slave mode. sar sarx bit 0 bit 0 fs fsx operating mode 0 i 2 c bus format ? sar and sarx slave addresses recognized 0 1 i 2 c bus format (initial value) ? sar slave address recognized ? sarx slave address ignored 0 i 2 c bus format ? sar slave address ignored ? sarx slave address recognized 1 1 clock synchronous serial format ? sar and sarx slave addresses ignored 25.2.3 second slave address register (sarx) 7 svax6 0 r/w 6 svax5 0 r/w 5 svax4 0 r/w 4 svax3 0 r/w 3 svax2 0 r/w 0 fsx 1 r/w 2 svax1 0 r/w 1 svax0 0 r/w bit : initial value : r/w : sarx is an 8-bit readable/writable register that stores the second slave address and selects the communication format. when the chip is in slave mode (and the addressing format is selected), if the upper 7 bits of sarx match the upper 7 bits of the first frame received after a start condition, the chip operates as the slave de vice specified by the master device. sarx is assigned to the same address as icdr, and can be written and read onl y when the ice bit is cleared to 0 in iccr. sarx is initialized to h'01 by a reset and in hardware standby mode. bits 7 to 1 ? second slave address (svax6 to svax0): set a unique address in bits svax6 to svax0, differing from the addresses of ot her slave devices connected to the i 2 c bus. section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 517 of 1038 rej09b0328-0300 bit 0 ? format select x (fsx): used together with the fs bit in sar to select the communication format. ? i 2 c bus format: addressing format with acknowledge bit ? synchronous serial format: non-addressing format without acknowledge bit, for master mode only the fsx bit also specifies whether or not sarx slave address recognition is performed in slave mode. for details, see the description of the fs bit in sar. 25.2.4 i 2 c bus mode register (icmr) 7 mls 0 r/w 6 wait 0 r/w 5 cks2 0 r/w 4 cks1 0 r/w 3 cks0 0 r/w 0 bc0 0 r/w 2 bc2 0 r/w 1 bc1 0 r/w bit : initial value : r/w : icmr is an 8-bit readable/writable register that selects whether the msb or lsb is transferred first, performs master mode wait control, and sel ects the master mode transfer clock frequency and the transfer bit count. icmr is assigned to the same address as sar. icmr can be written and read only when the ice bit is set to 1 in iccr. icmr is initialized to h'00 by a reset. bit 7 ? msb-first/lsb-first select (mls): selects whether data is transferred msb-first or lsb-first. if the number of bits in a frame, excluding the acknowledge bit, is less than 8, transmit data and receive data are stored differently. transmit data should be written justified toward the msb side when mls = 0, and toward the lsb side when ml s = 1. receive data bits read from the lsb side should be treated as valid when mls = 0, and bits read from the msb side when mls = 1. do not set this bit to 1 when the i 2 c bus format is used. bit 7 mls description 0 msb-first (initial value) 1 lsb-first section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 518 of 1038 rej09b0328-0300 bit 6 ? wait insertion bit (wait): selects whether to insert a wait between the transfer of data and the acknowledge bit, in master mode with the i 2 c bus format. when wait is set to 1, after the fall of the clock for the final data bit, the iric flag is set to 1 in iccr, and a wait state begins (with scl at the low level). when the iric flag is cleared to 0 in iccr, the wait ends and the acknowledge bit is transferred. if wait is cleared to 0, data and acknowledge bits are transferred consecutively with no wait inserted. the iric flag in iccr is set to 1 on completion of the acknowledge bit transfer, regardless of the wait setting. the setting of this bit is invalid in slave mode. bit 6 wait description 0 data and acknowledge bits transferred consecutively (initial value) 1 wait inserted between data and acknowledge bits section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 519 of 1038 rej09b0328-0300 bits 5 to 3 ? transfer clock select (cks2 to cks0): these bits, together with the iicx bit in the stcr register, select the seri al clock frequency in master m ode. they should be set according to the required transfer rate. stcr bit 6 bit 5 bit 4 bit 3 transfer rate iicx cks2 cks1 cks0 clock = 5 mhz = 8 mhz = 10 mhz 0 /28 179 khz 286 khz 357 khz 0 1 /40 125 khz 200 khz 250 khz 0 /48 104 khz 167 khz 208 khz 0 1 1 /64 78.1 khz 125 khz 156 khz 0 /80 62.5 khz 100 khz 125 khz 0 1 /100 50.0 khz 80.0 khz 100 khz 0 /112 44.6 khz 71.4 khz 89.3 khz 0 1 1 1 /128 39.1 khz 62.5 khz 78.1 khz 0 /56 89.3 khz 143 khz 179 khz 0 1 /80 62.5 khz 100 khz 125 khz 0 /96 52.1 khz 83.3 khz 104 khz 0 1 1 /128 39.1 khz 62.5 khz 78.1 khz 0 /160 31.3 khz 50.0 khz 62.5 khz 0 1 /200 25.0 khz 40.0 khz 50.0 khz 0 /224 22.3 khz 35.7 khz 44.6 khz 1 1 1 1 /256 19.5 khz 31.3 khz 39.1 khz section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 520 of 1038 rej09b0328-0300 bits 2 to 0 ? bit counter (bc2 to bc0): bits bc2 to bc0 specify the number of bits to be transferred next. with the i 2 c bus format (when the fs bit in sar or the fsx bit in sarx is 0), the data is transferred with one addition acknowledge bit. bit bc2 to bc0 settings should be made during an interval between transfer frames. if bits bc2 to bc0 are set to a value other than 000, the setting should be made while the scl line is low. the bit counter is initiali zed to 000 by a reset and when a st art condition is de tected. the value returns to 000 at the end of a data transfer, including the acknowledge bit. bit 2 bit 1 bit 0 bits/frame bc2 bc1 bc0 synchronous serial format i 2 c bus format 0 8 9 (initial value) 0 1 1 2 0 2 3 0 1 1 3 4 0 4 5 0 1 5 6 0 6 7 1 1 1 7 8 section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 521 of 1038 rej09b0328-0300 25.2.5 i 2 c bus control register (iccr) 7 ice 0 r/w 6 ieic 0 r/w 5 mst 0 r/w 4 trs 0 r/w 3 acke 0 r/w 0 scp 1 w 2 bbsy 0 r/w 1 iric 0 r/(w) * note: * only 0 can be written to clear the flag. bit : initial value : r/w : iccr is an 8-bit readable/writable regi ster that enables or disables the i 2 c bus interface, enables or disables interrupts, selects master or slave mode and transmission or reception, enables or disables acknowledgement, confirms the i 2 c bus interface bus status, issues start/stop conditions, and performs interrupt flag confirmation. iccr is initialized to h'01 by a reset. bit 7 ? i 2 c bus interface enable (ice): selects whether or not the i 2 c bus interface is to be used. when ice is set to 1, port pins function as scl and sda input/output pins and transfer operations are enabled. when ice is cleared to 0, the i 2 c bus interface module is disabled, and the internal state is initialized. the sar and sarx registers can be accessed when ice is 0. the icmr and icdr registers can be accessed when ice is 1. bit 7 ice description 0 i 2 c bus interface module disabled, with scl and sda signal pins set to port function sar and sarx can be accessed. the internal state of the i 2 c bus interface module is initialized. (initial value) 1 i 2 c bus interface module enabled for transfer operations (pins scl and sda are driving the bus) icmr and icdr can be accessed bit 6 ? i 2 c bus interface interrupt enable (ieic): enables or disables interrupts from the i 2 c bus interface to the cpu. bit 6 ieic description 0 interrupts disabled (initial value) 1 interrupts enabled section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 522 of 1038 rej09b0328-0300 bit 5 ? master/slave select (mst) bit 4 ? transmit/receive select (trs) mst selects whether the i 2 c bus interface operates in master mode or slave mode. trs selects whether the i 2 c bus interface operates in transmit mode or receive mode. 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 mo de. in slave receive mode with the addressing format (fs = 0 or fsx = 0), hard ware automatically selects transm it or receive mode according to the r/w bit in the first frame after a start condition. modification of the trs bit during transfer is deferred until transfer of the frame containing the acknowledge bit is completed, and the changeover is made after completion of the transfer. mst and trs select the operating mode as follows. bit 5 bit 4 mst trs description 0 slave receive mode (initial value) 0 1 slave transmit mode 1 0 master receive mode 1 master transmit mode bit 5 mst description 0 slave mode (initial value) [clearing conditions] (1) when 0 is written by software (2) when bus arbitration is lost after transmission is started in i 2 c bus format master mode 1 master mode [setting conditions] (1) when 1 is written by software (in cases other than clearing condition 2) (2) when 1 is written in mst after reading mst = 0 (in case of clearing condition 2) section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 523 of 1038 rej09b0328-0300 bit 4 trs description 0 receive mode (initial value) [clearing conditions] (1) when 0 is written by software (in cases other than setting condition 3) (2) when 0 is written in trs after reading trs = 1 (in case of setting condition 3) (3) when bus arbitration is lost after transmission is started in i 2 c bus format master mode 1 transmit mode [setting conditions] (1) when 1 is written by software (in cases other than clearing conditions 3) (2) when 1 is written in trs after reading trs = 0 (in case of clearing conditions 3) (3) when a 1 is received as the r/w bit of the first frame in i 2 c bus format slave mode bit 3 ? acknowledge bit judgement selection (acke): specifies whether the value of the acknowledge bit returned from the receiving device when using the i 2 c bus format is to be ignored and continuous transfer is performed, or transf er is to be aborted and error handling, etc., performed if the acknowledge b it is 1. when the acke bit is 0, the value of the received acknowledge bit is not indicated by the ackb bit, which is always 0. when the acke bit is 0, the tdre, iric, and irtr flags are set on completion of data transmission, regardless of the value of the acknowledge bit. when the acke bit is 1, the tdre, iric, and irtr flags are set on completion of data transmission when the acknowledge bit is 0, and the iric flag alone is set on completion of da ta transmission when the acknowledge bit is 1. depending on the receiving device, the acknowledge bit ma y be significant, in indicating completion of processing of the received data, for instance, or may be fixed at 1 and have no significance. bit 3 acke description 0 the value of the acknowledge bit is ignored, and continuous transfer is performed (initial value) 1 if the acknowledge bit is 1, continuous transfer is interrupted section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 524 of 1038 rej09b0328-0300 bit 2 ? bus busy (bbsy): the bbsy flag can be read to check whether the i 2 c bus (scl, sda) is busy or free. in master mode, this bit is also used to issue start and stop conditions. a high-to-low transition of sda while scl is high is recognized as a start condition, setting bbsy to 1. a low-to-high trans ition of sda while scl is high is recognized as a stop condition, clearing bbsy to 0. to issue a start condition, use a mov instruction to write 1 in bbsy and 0 in scp. a retransmit start condition is issued in the same way. to issue a stop condition, use a mov instruction to write 0 in bbsy and 0 in scp. it is not possible to write to bbsy in slave mode; the i 2 c bus interface must be set to master transmit mode before issuing a start condition. mst and trs should both be set to 1 before writing 1 in bbsy and 0 in scp. bit 2 bbsy description 0 bus is free (initial value) [clearing condition] when a stop condition is detected 1 bus is busy [setting condition] when a start condition is detected bit 1 ? i 2 c bus interface interrupt request flag (iric): indicates that the i 2 c bus interface has issued an interrupt request to the cpu. iric is set to 1 at the end of a data transfer, when a slave address or general call address is detected in slav e receive mode, when bus arbitration is lost in master transmit mode, and when a stop condition is detected. iric is set at different times depending on the fs bit in sar and the wait bit in icmr. see section 25.3.6, iric setting timing and scl control. the conditions under which iric is set also differ depending on the setting of the acke bit in iccr. iric is cleared by reading iric after it has been set to 1, then writing 0 in iric. when the dtc is used, iric is cleared automatically and transfer can be performed continuously without cpu intervention. section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 525 of 1038 rej09b0328-0300 bit 1 iric description 0 waiting for transfer, or transfer in progress (initial value) [clearing condition] when 0 is written in iric after reading iric = 1 1 interrupt requested [setting conditions] ? i 2 c bus format master mode (1) when a start condition is detected in the bus line state after a start condition is issued (when the tdre flag is set to 1 because of first frame transmission) (2) when a wait is inserted between the data and acknowledge bit when wait = 1 (3) at the end of data transfer (at the rise of the 9th transmit clock pulse, and at the fall of the 8th transmit/receive clock pulse when a wait is inserted) (4) when a slave address is received after bus arbitration is lost (when the al flag is set to 1) (5) when 1 is received as the acknowledge bit when the acke bit is 1 (when the ackb bit is set to 1) ? i 2 c bus format slave mode (1) when the slave address (sva, svax) matches (when the aas and aasx flags are set to 1) and at the end of data transfer up to the subsequent retransmission start condition or stop condition detection (when the tdre or rdrf flag is set to 1) (2) when the general call address is detected (when fs = 0 and the adz flag is set to 1) and at the end of data transfer up to the subsequent retransmission start condition or stop condition detection (when the tdre or rdrf flag is set to 1) (3) when 1 is received as the acknowledge bit when the acke bit is 1 (when the ackb bit is set to 1) (4) when a stop condition is detected (when the stop or estp flag is set to 1) ? synchronous serial format (1) at the end of data transfer (when the tdre or rdrf flag is set to 1) (2) when a start condition is detected with serial format selected when conditions are occured such that the tdre or rdrf flag is set to 1 when, with the i 2 c bus format selected, iric is set to 1 and an interrupt is generated, other flags must be checked in order to identify the source that set iric to 1. although each source has a section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 526 of 1038 rej09b0328-0300 corresponding flag, caution is need ed at the end of a transfer. when the tdre or rdrf internal flag is set, th e readable irtr flag may or may not be set. the irtr flag (the dtc* start request flag) is not set at the end of a data transfer up to detection of a retransmission start condition or stop condition afte r a slave address (sva) or general call address match in i 2 c bus format slave mode. even when the iric flag and irtr flag are set, the tdre or rdrf internal flag may not be set. the iric and irtr flags are not cleared at th e end of the specified number of transfers in continuous transfer using the dtc*. the tdre or rdrf flag is cleared, however, since the specified number of icdr reads or writes have been completed. table 25.3 shows the relationship between the flags and the transfer states. note: * this lsi does not incorporate dtc. table 25.3 flags and transfer states mst trs bbsy estp stop irtr aasx al aas adz ackb state 1/0 1/0 0 0 0 0 0 0 0 0 0 idle state (flag clearing required) 1 1 0 0 0 0 0 0 0 0 0 start condition issuance 1 1 1 0 0 1 0 0 0 0 0 start condition established 1 1/0 1 0 0 0 0 0 0 0 0/1 master mode wait 1 1/0 1 0 0 1 0 0 0 0 0/1 master mode transmit/receive end 0 0 1 0 0 0 1/0 1 1/0 1/0 0 arbitration lost 0 0 1 0 0 0 0 0 1 0 0 sar match by first frame in slave mode 0 0 1 0 0 0 0 0 1 1 0 general call address match 0 0 1 0 0 0 1 0 0 0 0 sarx match 0 1/0 1 0 0 0 0 0 0 0 0/1 slave mode transmit/receive end (except after sarx match) 0 0 1/0 1 1 1 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 1 slave mode transmit/receive end (after sarx match) 0 1/0 0 1/0 1/0 0 0 0 0 0 0/1 stop condition detected section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 527 of 1038 rej09b0328-0300 bit 0 ? start condition/stop condition prohibit (scp): controls the issuing of start and stop 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. if 1 is written, the data is not stored. bit 0 scp description 0 writing 0 issues a start or stop condition, in combination with the bbsy flag 1 reading always returns a value of 1 (initial value) writing is ignored 25.2.6 i 2 c bus status register (icsr) 7 estp 0 r/(w) * 6 stop 0 r/(w) * 5 irtr 0 r/(w) * 4 aasx 0 r/(w) * 3 al 0 r/(w) * 0 ackb 0 r/w 2 aas 0 r/(w) * 1 adz 0 r/(w) * note: * only 0 can be written to clear the flag. bit : initial value : r/w : icsr is an 8-bit readable/writable register that performs flag confirmation and acknowledge confirmation and control. icsr is initialized to h'00 by a reset. bit 7 ? error stop condition detection flag (estp): indicates that a stop condition has been detected during frame transfer in i 2 c bus format slave mode. bit 7 estp description 0 no error stop condition (initial value) [clearing conditions] (1) when 0 is written in estp after reading estp = 1 (2) when the iric flag is cleared to 0 1 ? in i 2 c bus format slave mode error stop condition detected [setting condition] when a stop condition is detected during frame transfer ? in other modes no meaning section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 528 of 1038 rej09b0328-0300 bit 6 ? normal stop condition detection flag (stop): indicates that a stop condition has been detected after completion of frame transfer in i 2 c bus format slave mode. bit 6 stop description 0 no normal stop condition (initial value) [clearing conditions] (1) when 0 is written in stop after reading stop = 1 (2) when the iric flag is cleared to 0 1 ? in i 2 c bus format slave mode error stop condition detected [setting condition] when a stop condition is detected after completion of frame transfer ? in other modes no meaning section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 529 of 1038 rej09b0328-0300 bit 5 ? i 2 c bus interface continuous transmission/reception interrupt request flag (irtr): indicates that the i 2 c bus interface has issued an interr upt request to the cpu, and the source is completion of reception/transmission of one frame in continuous transmission/reception for which dtc* activation is possible. when the irtr flag is set to 1, the iric flag is also set to 1 at the same time. irtr flag setting is performed when the tdre or rdrf flag is set to 1. irtr is cleared by reading irtr after it has been set to 1, then writing 0 in irtr. irtr is also cleared automatically when the iric flag is cleared to 0. note: * this lsi does not incorporate dtc. bit 5 irtr description 0 waiting for transfer, or transfer in progress (initial value) [clearing conditions] (1) when 0 is written in irtr after reading irtr = 1 (2) when the iric flag is cleared to 0 1 continuous transfer state [setting conditions] ? in i 2 c bus interface slave mode when the tdre or rdrf flag is set to 1 when aasx = 1 ? in other modes when the tdre or rdrf flag is set to 1 section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 530 of 1038 rej09b0328-0300 bit 4 ? second slave address recognition flag (aasx): in i 2 c bus format slave receive mode, this flag is set to 1 if the first frame following a start condition matches bits svax6 to svax0 in sarx. aasx is cleared by reading aasx af ter it has been set to 1, then writing 0 in aasx. aasx is also cleared automatically when a start condition is detected. bit 4 aasx description 0 second slave address not recognized (initial value) [clearing conditions] (1) when 0 is written in aasx after reading aasx = 1 (2) when a start condition is detected (3) in master mode 1 second slave address recognized [setting condition] when the second slave address is detected in slave receive mode while fsx = 0 bit 3 ? arbitration lost (al): this flag indicates that arbitra tion was lost in master mode. the i 2 c bus interface monitors the bus. when two or more master devices attempt to seize the bus at nearly the same time, if the i 2 c bus interface detects data differing from the data it sent, it sets al to 1 to indicate that the bus has been taken by another master. al is cleared by reading al after it has been set to 1, then writing 0 in al. in addition, al is reset automatically by write access to icdr in transmit mode, or read access to icdr in receive mode. bit 3 al description 0 bus arbitration won (initial value) [clearing conditions] (1) when icdr data is written (transmit mode) or read (receive mode) (2) when 0 is written in al after reading al = 1 1 arbitration lost [setting conditions] (1) if the internal sda and sda pin disagree at the rise of scl in master transmit mode (2) if the internal scl line is high at the fall of scl in master transmit mode section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 531 of 1038 rej09b0328-0300 bit 2 ? slave address recognition flag (aas): in i 2 c bus format slave receive mode, this flag is set to 1 if the first frame following a start condition matches bits sva6 to sva0 in sar, or if the general call address (h'00) is detected. aas is cleared by reading aas after it has been set to 1, then writing 0 in aas. in addition, aas is reset automatically by write acce ss to icdr in transmit mode, or read access to icdr in receive mode. bit 2 aas description 0 slave address or general call address not recognized (initial value) [clearing conditions] (1) when icdr data is written (transmit mode) or read (receive mode) (2) when 0 is written in aas after reading aas = 1 (3) in master mode 1 slave address or general call address recognized [setting condition] when the slave address or general call address is detected in slave receive mode bit 1 ? general call address recognition flag (adz): in i 2 c bus format slave receive mode, this flag is set to 1 if the first frame following a start condition is the general call address (h'00). adz is cleared by reading adz after it has been set to 1, then writing 0 in adz. in addition, adz is reset automatically by write acce ss to icdr in transmit mode, or read access to icdr in receive mode. bit 1 adz description 0 general call address not recognized (initial value) [clearing conditions] (1) when icdr data is written (transmit mode) or read (receive mode) (2) when 0 is written in adz after reading adz = 1 (3) in master mode 1 general call address recognized [setting condition] if the general call address is detected when fsx = 0 or fs = 0 is selected in the slave receive mode. section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 532 of 1038 rej09b0328-0300 bit 0 ? acknowledge bit (ackb): stores acknowledge data. in transmit mode, after the receiving device receives data, it retu rns acknowledge data, and this da ta is loaded into ackb. in receive mode, after data has been received, the ack nowledge data set in this bit is sent to the transmitting device. when this bit is read, in transmission (when trs = 1), the value loaded from the bus line (returned by the receiving device) is read. in reception (when trs = 0), the value set by internal software is read. bit 0 ackb description 0 receive mode: 0 is output at acknowledge output timing (initial value) transmit mode: indicates that the receiving device has acknowledged the data (signal is 0) 1 receive mode: 1 is output at acknowledge output timing transmit mode: indicates that the receiving device has not acknowledged the data (signal is 1) 25.2.7 serial/timer control register (stcr) 7 ? 0 ? 6 iicx 0 r/w 5 iicrst 0 r/w 4 ? 0 ? 3 flshe 0 r/w 0 ? 0 ? 2 ? 0 ? 1 ? 0 ? bit : initial value : r/w : stcr is an 8-bit readable/writabl e register that controls the i 2 c bus interface operating mode. stcr is initialized to h'00 by a reset. bit 7 ? reserved bit 6 ? i 2 c transfer select (iicx): this bit, together with bits cks2 to cks0 in icmr of i 2 c, selects the transfer rate in master mode. for details, see section 25.2.4, i 2 c bus mode register (icmr). section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 533 of 1038 rej09b0328-0300 bit 5 ? i 2 c controller reset (iicrst): this bit controls the initialization of the internal state of the i 2 c bus interface. when the i 2 c bus interface operating mode is hung because of communications error, and the iicrst bit is then set to 1, the i 2 c bus interface controller is initialized of the internal state, and this allows the internal state of the i 2 c bus interface to be initialized without making port setti ngs or initializing registers. for the detail, refer to section 25.3.9, initialization of internal state. the initialization is continuous and the i 2 c bus interface cannot operate, when the iicst bit remains set to 1. therefore, be sure to clear the iicrst bit after setting it. bit 5 iicrst description 0 i 2 c bus interface controller is not reset (initial value) 1 i 2 c bus interface controller is reset bits 3 ? flash memory control resister enable (flshe): this bit selects the control resister of the flash memory. for details, refer to section 7.3.4 or 8.3.5, serial/timer control resister (stcr). bits 4 and 2 to 0 ? reserved 25.2.8 module stop control register (mstpcr) 7 1 mstp15 r/w mstpcrh 6 1 mstp14 r/w 5 1 mstp13 r/w 4 1 mstp12 r/w 3 1 mstp11 r/w 2 1 mstp10 r/w 1 1 mstp9 r/w 0 1 mstp8 r/w 7 1 mstp7 r/w 6 1 mstp6 r/w 5 1 mstp5 r/w 4 1 mstp4 r/w 3 1 mstp3 r/w 2 1 mstp2 r/w 1 1 mstp1 r/w 0 1 mstp0 r/w mstpcrl bit : initial value : r/w : mstpcr comprises two 8-bit readable/writable registers, and is used to perform module stop mode control. when the corresponding bit in mstpcr is set to 1, operation of the corresponding i 2 c module is halted at the end of the bus cycle, and a transition is made to module stop mode. for details, see section 4.5, module stop mode. mstpcr is initialized to h'ffff by a reset. it is not initialized in standby mode. section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 534 of 1038 rej09b0328-0300 mstpcrl bit 6 ? module stop (mstp6): specifies i 2 c module stop mode. mstpcrl bit 6 mstp6 description 0 i 2 c module stop mode is cleared 1 i 2 c module stop mode is set (initial value) section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 535 of 1038 rej09b0328-0300 25.3 operation 25.3.1 i 2 c bus data format the i 2 c bus interface has serial and i 2 c bus formats. the i 2 c bus formats are addressing formats with an acknowledge bit. these are shown in figure 25.3. the first frame following a start condition always consists of 8 bits. the serial format is a non-addressing format with no acknowledge bit. this is shown in figure 25.4. figure 25.5 shows the i 2 c bus timing. the symbols used in figures 25.3 to 25.5 are explained in table 25.4. sa sla 7n r/ w data a 1 1m 11 1 a/ a 1 p 1 transfer bit count (n = 1 to 8) transfer frame count (m = 1 or above) 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 upper: transfer bit count (n1 and n2 = 1 to 8) lower: transfer frame count (m1 and m2 = 1 or above) (a) fs = 0 or fsx = 0 (b) start condition transmission, fs = 0 or fsx = 0 w figure 25.3 i 2 c bus data formats (i 2 c bus formats) s data 8n data 1 1m p 1 transfer bit count (n = 1 to 8) transfer frame count (m = 1 or above) fs = 1 and fsx = 1 figure 25.4 i 2 c bus data format (serial format) section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 536 of 1038 rej09b0328-0300 sda scl s sla r/ w a 9 8 1-7 9 8 1-7 9 8 1-7 data a data a/a p figure 25.5 i 2 c bus timing table 25.4 i 2 c bus data format symbols s start condition. the master device drives sda from high to low while scl is hig sla slave address, by which the master device selects a slave device r/ w indicates the direction of data transfer: from 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 receiving device (the slav e in master transmit mode, or the master in master receive mode) drives sda low to acknowledge a transfer data transferred data. the bit length is set by bits bc2 to bc0 in icmr. the msb-first or lsb-first format is selected by bit mls in icmr p stop condition. the master device drives sda from low to high while scl is high 25.3.2 master transmit operation in i 2 c bus format master transmit mode, the master device outputs the transmit clock and transmit data, and the slave device returns an acknowl edge signal. the transmission procedure and operations synchronize with the icdr writing are described below. [1] set bit ice in iccr to 1. set bits mls, wait, cks2 to cks0 in icmr, and bit iicx in stcr, according to the operating mode. [2] read the bbsy flag in iccr to confirm that the bus is free. [3] set bits mst and trs to 1 in iccr to select master transmit mode. [4] write 1 to bbsy and 0 to scp. this changes sda from high to low when scl is high, and generates the start condition. [5] then iric and irtr flags are set to 1. if the ieic bit in iccr has been set to 1, an interrupt request is sent to the cpu. [6] write the data (slave address + r/ w ) to icdr. after the start condition instruction has been issued and the start conditon has been generated, write data to icdr. if this procedure is not followed, data may not be output correctly. with the i 2 c bus format (when the fs bit in sar or the fsx bit in sarx is 0), the first frame data following the start condition indicates the 7- bit slave address and transmit/recei ve direction. as indicating the end of the transfer, and so section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 537 of 1038 rej09b0328-0300 the iric flag is cleared to 0. after writing ic dr, clear iric immediatel y not to execute other interrupt handling routine. if one frame of data has been transmitted before the iric clearing, it can not be determine the end of transmission. the master device sequentially sends the transmission clock and the data written to icdr using the timing shown in figure 25.6. the selected slave device (i.e. the slave device with the matching slave address) drives sda low at the 9th transmit clock pulse and returns an acknowledge signal. [7] when one frame of data has been transmitted, the iric flag is set to 1 at the rise of the 9th transmit clock pulse. after one frame has been transmitted scl is automatically fixed low in synchronization with the internal clock until the next transmit data is written. [8] read the ackb bit in icsr to confirm that ackb is cleared to 0. when the slave device has not acknowledged (ackb bit is 1), operate the step [12] to end transmission, and retry the transmit operation. [9] write the transmit data to icdr. as indicating the end of the transfer, and so the iric flag is cleared to 0. after writing icdr, clear iric immediately not to execute other interrupt handling routine. the master device sequentially sends the transmission clock and the data written to icdr. transmission of the next frame is performed in synchronization with the internal clock. [10] when one frame of data has been transmitted, the iric flag is set to 1 at the rise of the 9th transmit clock pulse. after one frame has been transmitted scl is automatically fixed low in synchronization with the internal clock until the next transmit data is written. [11] read the ackb bit in icsr and confirm ackb is cleared to 0. when there is data to be transmitted, go to the step [9] to continue next transmission. when the slave device has not acknowledged (ackb bit is set to 1), operate the step [12] to end transmission. [12] clear the iric flag to 0. and write 0 to bbsy and scp in iccr. this changes sda from low to high when scl is high, and generates the stop condition. section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 538 of 1038 rej09b0328-0300 sda (master output) sda (slave output) 2 1 r/ w 4 36 58 7 12 9 a bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 7 bit 6 iric irtr icdr scl (master output) start condition geberation slave address data 1 [9] icdr write [9] iric clear [6] icdr write [6] iric clear address + r/ w [7] [5] note: data write timing in icdr icdr writing prohibited [4] write bbsy = 1 and scp = 0 (start condition issuance) icdr writing enable data 1 user processing these processes are executed continuously. these processes are executed continuously. figure 25.6 example of master transmit mode operation timing (mls = wait = 0) section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 539 of 1038 rej09b0328-0300 25.3.3 master receive operation in master receive mode, the master device outputs the receive clock, receives data, and returns an acknowledge signal. the slave device transmits data. i 2 c bus interface module consists of the data buffers of icdrr and icdrs, so data can be r eceived continuously in master receive mode. for this construction, when stop condition issuing timing delayed, it may occurs the internal contention between stop condition i ssuance and scl clock output for next data receiving, and then the extra scl clock would be outputted automatically or the scl line would be held to low. and for i 2 c bus interface system, the acknowledge bit must be set to 1 at the last data receiving, so the change timing of ackb bit in icsr should be controlled by software. to take measures against these problems, the wait function should be used in master receive mode. the reception procedure and operations with the wait function in ma ster receive mode are described below. [1] clear the trs bit in iccr to 0 to switch from transmit mode to receive mode, and set the wait bit in icmr to 1. also clear the ackb bit in icsr to 0 (acknowledge data setting). [2] when icdr is read (dummy da ta read), reception is started, and the receive clock is output, and data received, in synchronization with the in ternal clock. in order to detect wait operation, set the iric flag in iccr must be cleared to 0. after reading icdr, clear iric immediately not to execute other interrupt ha ndling routine. if one frame of data has been received before the iric clearing, it can not be determine the end of reception. [3] the iric flag is set to 1 at the fall of the 8th receive clock pulse. if the ieic bit in iccr has been set to 1, an interrupt request is sent to the cpu. scl is automatically fixed low in synchronization with the internal clock until the iric flag clearing. if the first frame is the last receive data, execute step [10] to halt reception. [4] clear the iric flag to rel ease from the wait state. the mast er device outputs the 9th clock and drives sda at the 9th receive clock pulse to return an acknowledge signal. [5] when one frame of data has been received, the iric flag in iccr and the irtr flag in icsr are set to 1 at the rise of the 9th receive cl ock pulse. the master device outputs scl clock to receive next data. [6] read icdr. [7] clear the iric flag to detect next wait operation. from clearing of the iric flag to negation of a wait as described in step [4] (and [9]) to clearing of the iric flag as described in steps [5], [6], and [7], must be performed within the time taken to transfer one byte. [8] the iric flags set to 1 at the fall of the 8t h receive clock pulse. scl is automatically fixed low in synchronization with the internal clock until the iric flag clearing. if this frame is the last receive data, execute st ep [10] to halt reception. [9] clear the iric flag in iccr to cancel wait operation. the master device outputs the 9th clock and drives sda at the 9th receive clock pulse to return an acknowledge signal. data can be received continuously by repe ating steps [5] to [9]. section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 540 of 1038 rej09b0328-0300 [10] set the ackb bit in icsr to 1 so as to return ?no acknowledge? data. also set the trs bit to 1 to switch from receive mode to transmit mode. [11] clear iric flag to 0 to release from the wait state. [12] when one frame of data has been received, th e iric flag is set to 1 at the rise of the 9th receive clock pulse. [13] clear the wait bit to 0 to switch from wait mode to no wait mode. read icdr and the iric flag to 0. clearing of the iric flag should be after the wait = 0. (if the stop-condition generation command is execut ed after clearing the iric flag to 0 and then clearing the wait bit to 0, the sda line is fixed low and the stop condition cannot be generated.) [14] clear the bbsy bit and scp bit to 0. this changes sda from low to high when scl is high, and generates the stop condition. 9 a bit7 master receive mode master transmit mode scl (master output) sda (slave output) sda (master output) iric irtr icdr user processing [1] trs cleared to 0 wait set to 1 ackb cleared to 0 [2] icdr read (dummy read) [2] iric clearance [4] iric clearance [6] icdr read (data 1) [7] iric clearance bit6 bit5 bit4 bit3 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 12 34 56 78 [3] [5] a 912 3 45 data 1 data 2 data 1 these processes are executed continuously. these processes are executed continuously. figure 25.7 example of master r eceive mode operation timing (mls = ackb = 0, wait = 1) section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 541 of 1038 rej09b0328-0300 8 bit0 data 2 scl (master output) sda (slave output) sda (master output) iric irtr icdr user processing [9] iric clearance [6] icdr read (data 2) [7] iric clearance [9] iric clearance [6] icdr read (data 3) [7] iric clearance bit7 [8] [5] a bit6 bit5 bit4 bit7 bit6 bit3 bit2 bit1 bit0 91 23 45 67 [8] [5] a 8912 data 3 data 4 data 3 data 2 data 1 these processes are executed continuously. these processes are executed continuously. figure 25.8 example of master r eceive mode operation timing (mls = ackb = 0, wait = 1) continued 25.3.4 slave recei ve operation in slave receive mode, the master device outputs the transmit clock and transmit data, and the slave device returns an acknowledge signal. the r eceive procedure and operations in slave receive mode are described below. [1] set bit ice in iccr to 1. set bits mls in icmr and bits mst and tr s in iccr according to the operating mode. [2] a start condition output by the master device sets the bbsy flag to 1 in iccr. [3] after the slave device detects th e start condition, if the first frame matches its slave address, it functions as the slave device designated as the master device. if the 8th bit data (r/ w ) is 0, trs bit in iccr remains 0 and executes slave receive operation. [4] at the ninth clock pul se of the receive frame, the slave device drives sda low to acknowledge the transfer. at the same time, the iric flag is set to 1 in iccr. if ieic is 1 in iccr, a cpu interrupt is requested. if the rdrf internal flag is 0, it is set to 1 and continuous reception is performed. if the rdrf internal flag is 1, the slave device holds scl low from the fall of the receive clock until it has read the data in icdr. [5] read icdr and clear iric to 0 in iccr. at this time, the rdfr fl ag is cleared to 0. steps [4] and [5] can be repeated to receive da ta continuously. when a stop condition is detected (a low-to-high transition of sda while scl is high), the bbsy flag is cleared to 0 in iccr. section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 542 of 1038 rej09b0328-0300 sda (master output) sda (slave output) 2 1 2 1 4 36 58 79 bit 7 bit 6 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 iric icdrs icdrr rdrf scl (master output) start condition issurance scl (slave output) interrupt request generated address + r/ w address + r/ w [5] read icdr [5] clear iric user processing slave address data 1 [4] a r/ w figure 25.9 example of ti ming in slave receive mode (mls = ackb = 0) (1) section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 543 of 1038 rej09b0328-0300 sda (master output) sda (slave output) 2 14 36 58 79 8 79 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 1 bit 0 iric icdrs icdrr rdrf scl (master output) scl (slave output) interrupt request generated interrupt request generated data 2 data 2 data 1 data 1 [5] read icdr [5] clear iric user processing data 2 data 1 [4] [4] a a figure 25.10 example of timing in sl ave receive mode (mls = ackb = 0) (2) section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 544 of 1038 rej09b0328-0300 25.3.5 slave transmit operation in slave transmit mode, the slave device outputs the transmit data, and the master device outputs the transmit clock and returns an acknowledge signal. the transmit procedure and operations in slave transmit mode are described below. [1] set bit ice in iccr to 1. set bits mls in icmr and bits mst and trs in iccr according to the operating mode. [2] after the slave device detects a start condition, if the first frame matches its slave address, at the ninth clock pulse the slave device drives sda low to acknowledge the transfer. at the same time, the iric flag is set to 1 in iccr, and if the ieic bit in iccr is set to 1 at this time, an interrupt request is sent to the cpu. if the eighth data bit (r/ w ) is 1, the trs bit is set to 1 in iccr, automatically causing a transition to slave transmit mode. the slave device holds scl low from the fall of the transmit clock until data is written in icdr. [3] clear the iric flag to 0, then write data in icdr. the written data is transferred to icdrs, and the tdre internal flag and the iric and irtr flags are set to 1 again. clear iric to 0, then write the next data in icdr. the slave device outputs the written data serially in step with the clock output by the master device, with the timing shown in figure 25.11. [4] when one frame of data has been transmitted, at the rise of the ninth transmit clock pulse iric is set to 1 in iccr. if the tdre internal flag is 1, the slave device holds scl low from the fall of the transmit clock until data is written in icdr. the master device drives sda low at the ninth clock pulse to acknowledge the data. the acknowledge signal is stored in the ackb bit in icsr, and can be used to check whether th e transfer was carried out normally. if tdre internal flag is set to 0, the data written in icdr is transferred to icdrs, then transmission starts and tdre internal flag and iric and irtr flags are all set to 1 again. [5] to continue transmitting, clear iric to 0, then write the next transmit data in icdr. steps [4] and [5] can be repeated to transmit continuously. to end the transmission, write h'ff in icdr so that the sda may be freed on the slave side. when a stop condition is detected (a low-to- high transition of sda while scl is high), th e bbsy flag will be cleared to 0 in iccr. section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 545 of 1038 rej09b0328-0300 sda (slave output) sda (master output) scl (slave output) 2 1 2 1 4 36 58 79 9 8 bit 7 bit 6 bit 5 bit 7 bit 6 bit 4 bit 3 bit 2 bit 1 bit 0 iric icdrs icdrt tdre scl (master output) interrupt request generated interrupt request generated interrupt request generated slave receive mode slave transmit mode data 1 data 2 [3] clear iric [5] clear iric [3] write icdr [3] write icdr [5] write icdr user processing data 1 data 1 data 2 data 2 a r/ w a [3] [2] figure 25.11 example of timing in slave transmit mode (mls = 0) 25.3.6 iric setting timing and scl control the interrupt request flag (iric) is set at different times depending on the wait bit in icmr, the fs bit in sar, and the fsx bit in sarx. if the tdre or rdrf internal flag is set to 1, scl is automatically held low after one frame has been transferred; this timing is synchronized with the internal clock. figure 25.12 shows the iric set timing and scl control. section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 546 of 1038 rej09b0328-0300 scl sda iric user processing clear iric write to icdr (transmit) or read icdr (receive) 1 a 8 7 1 9 8 7 scl sda iric user processing clear iric write to icdr (transmit) or read icdr (receive) 1 a 8 1 9 8 clear iric scl sda iric user processing clear iric write to icdr (transmit) or read icdr (receive) 1 8 7 1 8 7 (a) when wait = 0, and fs = 0 or fsx = 0 (i 2 c bus format, no wait) (b) when wait = 1, and fs = 0 or fsx = 0 (i 2 c bus format, wait inserted) (c) when fs = 1 and fsx = 1 (synchronous serial format) figure 25.12 iric setting timing and scl control section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 547 of 1038 rej09b0328-0300 25.3.7 noise canceler the logic levels at the scl and sda pins are routed through noise cancelers before being latched internally. figure 25.13 shows a block diagram of the noise canceler circuit. the noise canceler consists of two cascaded la tches and a match detector. the scl (or sda) input signal is sampled on the system clock, but is not passed forward to the next circuit unless the outputs of both latches agree. if they do not agree, the previous value is held. scl or sda input signal internal scl or sda signal sampling clock sampling clock system clock period c latch q d c latch q d match detector figure 25.13 block diagram of noise canceler 25.3.8 sample flowcharts figures 25.14 to 25.17 show sample flowcharts for using the i 2 c bus interface in each mode. section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 548 of 1038 rej09b0328-0300 start initialize read bbsy in iccr no bbsy = 0? yes yes set mst = 1 and trs = 1 in iccr write bbsy = 1 and scp = 0 in iccr clear iric in iccr read iric in iccr no yes iric = 1? write transmit data in icdr read ackb in icsr ackb = 0? no yes no yes transmit mode? write transmit data in icdr read iric in iccr iric = 1? no yes clear iric in iccr read ackb in icsr end of transmission or ackb = 1? no yes write bbsy = 0 and scp = 0 in iccr end master receive mode read iric in iccr no iric = 1? clear iric in iccr [1] initialize [2] test the status of the scl and sda lines. [3] select master transmit mode. [4] start condition issuance [5] wait for a start condition generation [6] set transmit data for the first byte (slave address + r/ w ). (after writing icdr, clear iric immediately) [7] wait for 1 byte to be transmitted. [8] test the acknowledge bit, transferred from slave device. [10] wait for 1 byte to be transmitted. [11] test for end of transfer [12] stop condition issuance [9] set transmit data for the second and subsequent bytes. (after writing icdr, clear iric immediately) figure 25.14 flowchart for master transmit mode (example) section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 549 of 1038 rej09b0328-0300 master receive mode read icdr clear iric in iccr iric = 1? clear iric in iccr read iric in iccr iric = 1? last receive ? yes yes no no no yes yes yes no yes read icdr read iric in iccr read iric in iccr iric = 1? last receive ? clear iric in iccr read iric in iccr clear iric in iccr set ackb = 1 in icsr set trs = 1 in iccr clear iric in iccr set wait = 0 in icmr read icdr write bbsy = 0 and scp = 0 in iccr end no iric = 1? no set trs = 0 in iccr set wait = 1 in icmr set ackb = 0 in icsr read iric in iccr [1] select receive mode [2] start receiving. the first read is a dummy read. after reading icdr, please clear iric immediately. [3] wait for 1 byte to be received. (8th clock falling edge) [4] clear iric to trigger the 9th clock. (to end the wait insertion) [5] wait for 1 byte to be received. (9th clock risig edge) [6] read the received data. [7] clear iric [8] wait for the next data to be received. (8th clock falling edge) [9] clear iric to trigger the 9th clock. (to end the wait insertion) [10] set ackb = 1 so as to return no acknowledge, or set trs = 1 so as not to issue extra clock. [12] wait for 1 byte to be received. [14] stop condition issuance. [13] set wait = 0. read icdr. clear iric. (note: after setting wait = 0, iric should be cleared to 0) [11] clear iric to trigger the 9th clock. (to end the wait insertion) figure 25.15 flowchart for master receive mode (example) section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 550 of 1038 rej09b0328-0300 start end initialize read iric flag in iccr read aas and adz flags in icsr read trs bit in iccr read iric flag in iccr clear iric flag in iccr clear iric flag in iccr clear iric flag in iccr read icdr read icdr read icdr set ackb = 0 in icsr general call address processing * description omitted set mst = 0 and trs = 0 in iccr iric = 1? no yes read iric flag in iccr set ackb = 0 in icsr iric = 1? no yes trs = 0? iric = 1? no no yes yes yes aas = 1 and adz = 0? [2] [1] [3] [8] [5] [6] [4] [7] slave transmit mode last receive? no no yes select slave receive mode. wait for 1 byte to be received (slave address) start receiving. the first read is a dummy read. wait for the transfer to end. set acknowledge data for the last receive. start the last receive. wait for the transfer to end. read the last receive data. [1] [2] [3] [4] [5] [6] [7] [8] figure 25.16 flowchart for slave transmit mode (example) section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 551 of 1038 rej09b0328-0300 end write transmit data in icdr clear iric flag in iccr clear iric flag in iccr read ackb bit in icsr set trs = 0 in iccr read icdr read iric flag in iccr iric = 1? yes yes no no [1] [4] [5] [2] [3] slave transmit mode end of transmission (ackb = 1)? clear iric in iccr set transmit data for the second and subsequent bytes. wait for 1 byte to be transmitted. test for end of transfer. select slave receive mode. dummy read (to release the scl line). [1] [2] [3] [4] [5] figure 25.17 flowchart for slave receive mode (example) section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 552 of 1038 rej09b0328-0300 25.3.9 initialization of internal state this i 2 c is capable of forcibly initializing internal state of i 2 c if deadlock develops during communication. the initialization is done by setting iicrst b it in stcr register, or clearing ice bit. for details, see section 25.2.7, serial/time control register (stcr). (1) range of initialization the following is initialized by this function: ? internal flags of tdre and rdrf ? programmable logic controller fo r signal receiving and sending. ? internal latches used for holding outputs from scl and sda pins (wait, clock, data output, etc.). the following is not initialized by this function: ? register values (icdr, sar, sarx, icmr, iccr, icsr, and stcr). ? internal latches employed for maintaining data read from the registers which is used for setting or clearing flags on icmr, iccr, and icsr registers. ? values on the icmr register bit counters (bc2 to bc0). ? interrupt factors currently generated (interrupt factors transferred to the interrupt controller). (2) precautions on initialization ? interrupt flags and interrupt factors are not clear ed by this function. thus, you need to clear them own as needed. ? other register flags are not basi cally cleared, too. thus, you n eed to clear them as needed. ? when this i 2 c is initialized with iicrst bit, write data specified by iicrst bit is maintained. when clearing i 2 c, set iicrst bit once, then clear it using the mov instruction. the i 2 c cannot operate with the iicrst bit set to 1. don't try to use bit operation instructions such as bclr. ? if you try to clear a flag while data sending or receiving is taking place, i 2 c module stops sending or receiving at that moment and frees the scl and sda pins. when resuming the communication, initialize registers as needed so that the system communication capability may function as intended. section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 553 of 1038 rej09b0328-0300 clear function of this module does not directly rewrite value of bbsy bit. however, depending on state of scl and sda pins and the timing in whic h they are made free, bbsy bit can be cleared. other bits and flags can also be affected by status change. in order to avoid these troubles, the following proc edures must be observed in initialization of i 2 c. (1) implement initialization of internal state by setting iicrst bit or ice bit. (2) execute the stop condition issue instruction (setting bbsy = 0 and scp = 0 to write) and wait for a duration equivalent to 2 clocks of the transfer rate. (3) execute initialization of internal state again by setting iicrst bit or ice bit. (4) initialize each i 2 c register (re-setting). section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 554 of 1038 rej09b0328-0300 25.4 usage notes (1) in master mode, if an instruction to generate a start condition is immediately followed by an instruction to generate a stop condition, neither condition will be output correctly. to output consecutive start and stop conditions, after issuing the instruction that generates the start condition, read the relevant ports, check th at scl and sda are both low, then issue the instruction that generates the stop condition. note that the scl may briefly remain at a high level immediately after bbsy is cleared to 0. (2) either of the following two conditions will start the next transfer. pay attention to these conditions when reading or writing to icdr. (a) write access to icdr when ice = 1 and trs = 1 (including automatic transfer from icdrt to icdrs) (b) read access to icdr when ice = 1 and tr s = 0 (including automatic transfer from icdrs to icdrr) (3) table 25.5 shows the timing of scl and sda output in synchronization with the internal clock. timings on the bus are determined by the rise and fall times of signals affected by the bus load capacitance, series resistance, and parallel resistance. table 25.5 i 2 c bus timing (scl and sda output) item symbol output timing unit notes scl output cycle time t sclo 28 t cyc to 256 t cyc ns scl output high pulse width t sclho 0.5 t sclo ns scl output low pulse width t scllo 0.5 t sclo ns sda output bus free time t bufo 0.5 t sclo ?1 t cyc ns start condition output hold time t staho 0.5 t sclo ?1 t cyc ns retransmission start condition output setup time t staso 1 t sclo ns stop condition output setup time t stoso 0.5 t sclo +2 t cyc ns data output setup time (master) 1 t scllo ?3 t cyc ns data output setup time (slave) t sdaso 1 t scll ?(6 t cyc or 12 t cyc * ) ns data output hold time t sdaho 3 t cyc ns figure 29.10 (reference) note: * 6 t cyc when iicx is 0, 12 t cyc when 1. (4) scl and sda input is sampled in synchronization with the internal clock. the ac timing therefore depends on the system clock cycle t cyc , as shown in table 29.6. note that the i 2 c bus interface ac timing specifications will not be met with a system clock frequency of less than 5 mhz. section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 555 of 1038 rej09b0328-0300 (5) the i 2 c bus interface specification for the scl rise time tsr is under 1000 ns (300 ns for high- speed mode). in master mode, the i 2 c bus interface monitors the scl line and synchronizes one bit at a time during communication. if t sr (the time for scl to go from low to v ih ) exceeds the time determined by the input clock of the i 2 c bus interface, the high period of scl is extended. the scl rise time is determined by the pull-up resistance a nd load capacitance of the scl line. to insure proper operation at the set transfer rate, adjust the pull-up resistance and load capacitance so that th e scl rise time does not exceed the values given in table 25.6. table 25.6 permissible scl rise time (t sr ) values time indication [ns] iicx t cyc indication i 2 c bus specification (max.) = 5 mhz = 8 mhz = 10 mhz normal mode 1000 937 750 0 7.5 t cyc high-speed mode 300 normal mode 1000 1 17.5 t cyc high-speed mode 300 (6) the i 2 c bus interface specifications for the scl an d sda rise and fall times are under 1000 ns and 300 ns. the i 2 c bus interface scl and sda output timing is prescribed by t scyc and t cyc , as shown in table 25.5. however, because of the rise and fall times, the i 2 c bus interface specifications may not be satisfied at the maximum transfer rate. table 25.7 shows output timing calculations for different operating frequencies, including the worst-case influence of rise and fall times. t bufo fails to meet the i 2 c bus interface specifications at any fr equency. the solution is either (a) to provide coding to secure the n ecessary interval (approximately 1 s) between issuance of a stop condition and issuance of a start condition, or (b) to select devices whose input timing permits this output timing for use as slave devices connected to the i 2 c bus. t scllo in high-speed mode and t staso in standard mode fail to satisfy the i 2 c bus interface specifications for worst- case calculations of t sr /t sf . possible solutions that should be investigated include (a) adjusting the rise and fall times by means of a pull-up resistor and capacitive load, (b) reducing the transfer rate to meet the speci fications, or (c) selecting devices whose input timing permits this output timing for use as slave devices connected to the i 2 c bus. section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 556 of 1038 rej09b0328-0300 table 25.7 i 2 c bus timing (with maximum influence of t sr /t sf ) time indication (at maximum transfer rate) [ns] item t cyc indication t sr /t sf influence (max.) i 2 c bus specification (min.) = 5 mhz = 8 mhz = 10 mhz normal mode ? 1000 4000 4000 t sclho 0.5 t sclo (?t sr ) high-speed mode ? 300 600 950 normal mode ? 250 4700 4750 t scllo 0.5 t sclo (?t sf ) high-speed mode ? 250 1300 1000 * 1 normal mode ? 1000 4700 3800 * 1 3875 * 1 3900 * 1 t bufo 0.5 t sclo ?1 t cyc (?t sr ) high-speed mode ? 300 1300 750 * 1 825 * 1 850 * 1 normal mode ? 250 4000 4550 4625 4650 t staho 0.5 t sclo ?1 t cyc (?t sf ) high-speed mode ? 250 600 800 875 900 normal mode ? 1000 4700 9000 9000 9000 t staso 1 t sclo (?t sr ) high-speed mode ? 300 600 2200 2200 2200 normal mode ? 1000 4000 4400 4250 4200 t stoso 0.5 t sclo +2 t cyc (?t sr ) high-speed mode ? 300 600 1350 1200 1150 normal mode ? 1000 250 3100 3325 3400 t sdaso (master) 1 t scllo * 3 ?3 t cyc (?t sr ) high-speed mode ? 300 100 400 625 700 normal mode ? 1000 250 1300 2200 2500 t sdaso (slave) 1 t scll * 3 ?12 t cyc * 2 (?t sr ) high-speed mode ? 300 100 ? 1400 * 1 ? 500 * 1 ? 200 * 1 t sdaho 3 t cyc normal mode 0 0 600 375 300 high-speed mode 0 0 notes: 1. does not meet the i 2 c bus interface specification. remedial action such as the following is necessary: (a) secure a start/stop condition issuance interval; (b) adjust the rise and fall times by means of a pull-up resistor and capacitive load; (c) reduce the transfer rate; (d) select slave devices whose input timing permits this output timing. the values in the above table will vary depending on the settings of the iicx bit and bits cks2 to cks0. depending on the frequency it may not be possible to achieve the maximum transfer rate; therefore, whether or not the i 2 c bus interface specifications are met must be determined in accordance with the actual setting conditions. 2. value when the iicx bit is set to 1. when the iicx bit is cleared to 0, the value is (t scll ? 6 t cyc ). 3. calculated using the i 2 c bus specification values (standard mode: 4700 ns min.; high- speed mode: 1300 ns min.). section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 557 of 1038 rej09b0328-0300 (7) precautions on reading icdr at the end of master receive mode when terminating the master receive mode, set trs bit to 1, and select "write" for iccr bbsy = 0 and scp = 0. this forces to move sda from low to high level when scl is at high level, thereby generating the stop condition. now you can read received data from icdr. if, however, any data is remaining on the buffer, received data on icdrs is not transferred to icdr , thus you won't be able to read the second byte data. when it is required to read the second byte data, issue the stop condition from the master receive state (trs bit is 0). before reading data from icdr register, make sure that bbsy bit on iccr register is 0, stop condition is generated and bus is made free. if you try to read received data after the stop condition issue instruction (setting iccr's bbsy = 0 and scp = 0 to write) has been executed but before the actual stop condition is generated, clock may not be appropriately signaled when the next master sending mode is turned on. thus, reasonable care is needed for dete rmining when to read the received data. after the master receive is complete, if you want to re-write i 2 c control bit (such as clearing mst bit) for switching the se nding/receiving mode or modifying settings, it must be done during period (a) indicated in figure 25.18 (after making sure iccr register bbsy bit is cleared to 0). sda scl internal clock bbsy bit bit 0 a (a) 89 stop condition start condition start condition is issued generation of the stop condition is checked (bbsy = 0 is set to read) the stop condition issue instruction (bbsy = 0 and scp = 0 set to write) is executed master receive mode icdr read inhibit period figure 25.18 precautions on reading the master receive data section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 558 of 1038 rej09b0328-0300 (8) notes on start condition issuance for retransmission figure 25.19 shows the timing of start conditon issuance for retransmission, and the timing for subsequently writing data to icdr, together with the corresponding flowchart. after start condition issuance is done and determined the start condition, write the transmit data to icdr. iric = 1 ? scl = low ? iric = 1 ? write transmit data to icdr write bbsy = 1, scp = 0 (icsr) clear iric in icsr read scl pin start condition issuance? other processing no [1] [2] [3] [4] [5] no no yes yes yes yes no [1] wait for end of 1-byte transfer [2] determine wheter scl is low [3] issue restart condition instruction for transmission [4] determine whether start condition is generated or not [5] set transmit data (slave address + r/ w ) note: program so that processing instruction [3] to [5] is executed continuously. [5] icdr write (next transmit data) [4] iric determination [2] determination of scl = low [1] iric determination scl sda ack bit 7 9 iric start condition (retransmission) [3] issue restart condition instruction for retransmission figure 25.19 flowchart and timing of start condition instruction issuance for retransmission section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 559 of 1038 rej09b0328-0300 (9) notes on i 2 c bus interface stop condition instruction issuance if the rise time of the 9th scl acknowledge ex ceeds the specification because the bus load capacitance is large, or if there is a slave device of the type th at drives scl low to effect a wait, issue the stop condition instruction after reading scl and determining it to be low, as shown below. as waveform rise is late, scl is detected as low 9th clock scl sda iric high period secured stop condition [2] stop condition instruction issuance [1] determination of scl = low vih figure 25.20 timing of stop condition issuance (10) notes on wait function (a) conditions to cause this phenomenon when both of the following conditions are satisfied, the clock pulse of the 9th clock could be outputted continuously in master mode using the wait function due to the failure of the wait insertion after the 8th clock fall. (1) setting the wait bit of the icmr register to 1 and operating wait, in master mode (2) if the iric bit of interrupt flag is cleared from 1 to 0 between the fall of the 7th clock and the fall of the 8th clock. (b) error phenomenon normally, wait state will be cancelled by clearing the iric flag bit from 1 to 0 after the fall of the 8th clock in wait state. in this cas e, if the iric flag b it is cleared between the 7th clock fall and the 8th clock fall, the iric flag clear- data will be retained internally. therefore, the wait state will be cancelled right after wait insertion on 8th clock fall. (c) restrictions please clear the iric flag before the rise of the 7th clock (the counter value of bc2 through bc0 should be 2 or greater), after the iric flag is set to 1 on the rise of the 9th clock. if the iric flag-clear is delayed due to the interrupt or other processes and the value of bc counter is turned to 1 or 0, please confirm the scl pins are in l? state after the counter value of bc2 through bc0 is turned to 0, and clear the iric flag. (see figure 25.21.) section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 560 of 1038 rej09b0328-0300 scl bc2?bc0 transmit/receive data a asd 7 6 5 4 3 2 1 0 7 6 5 1 2 3 4 5 6 7 8 9 1 2 3 0 iric flag clear unavailable iric flag clear available iric flag clear available 9 a iric (operation example) scl = ?l? confirm iric clear when bc2-0 2 iric clear transmit/receive data figure 25.21 iric flag clear timing on wait operation (11) notes on icdr reads and iccr access in slave transmit mode in a transmit operation in the slave mode of the i 2 c bus interface, do not read the icdr register or read or write to the iccr register during the period indicated by the shaded portion in figure 25.22. normally, when interrupt processing is triggered in synchronization with the rising edge of the 9th clock cycle, the period in question has already elapsed when the transition to interrupt processing takes place, so there is no problem w ith reading the icdr register or reading or writing to the iccr register. to ensure that the interrupt processing is performed properly, one of the following two conditions should be applied. (1) make sure that reading received data from the icdr register, or reading or writing to the iccr register, is completed before the ne xt slave address receive operation starts. (2) monitor the bc2 to bc0 counter in the icmr register and, when the value of bc2 to bc0 is 000 (8th or 9th clock cycle), allow a waiting time of at least 2 transfer clock cycles in order to involve the problem period in question before reading from the icdr register, or reading or writing to the iccr register. section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 561 of 1038 rej09b0328-0300 sda r/w waveforms if problem occurs bit 7 icdr write data transmission period when icdr reads and iccr reads and writes are prohibited (6 system clock cycles) detection of 9th clock cycle rising edge a 89 scl trs address received figure 25.22 icdr read and iccr access timing in slave transmit mode (12) notes on trs bit setting in slave mode from the detection of the rising edge of the 9th clock cycle or of a stop condition to when the rising edge of the next scl pin signal is detected (the period indicated as (a) in figure 25.23) in the slave mode of the i 2 c bus interface, the value set in the trs bit in the iccr register is effective immediately. however, at other times (indicated as (b) in figure 25.23) the value set in the trs bit is put on hold until the next rising edge of the 9th clock cycle or stop cond ition is detected, rather than taking effect immediately. this results in the actual internal value of the trs bit remaining 1 (transmit mode) and no acknowledge bit being sent at th e 9th clock cycle address receive completion in the case of an address receive operation following a rest art condition input with no stop condition intervening. when receiving an address in the slave mode , clear the trs bit to 0 during the period indicated as (a) in figure 25.23. to cancel the holding of the sc l bit low by the wait function in the slave mode, clear the trs bit to 0 and then perform a dummy read of the icdr register. section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 562 of 1038 rej09b0328-0300 sda scl a (a) trs bit detection of rise of 9th transmit/receive clock period in which trs bit setting is retained a ddress rece p t i on data transmission 8 9 12345678 9 (a) ( b) trs bit setting value trs bit effective value resumption condition (b) trs bit detection of rise of 9th transmit/receive clock figure 25.23 trs bit setting timing in slave mode (13) notes on arbitration lost in master mode the i 2 c bus interface recognizes the data in tr ansmit/receive frame as an address when arbitration is lost in master mode and a transition to slave receive mode is automatically carried out. when arbitration is lost not in the first frame but in the second frame or subsequent frame, transmit/receive data that is not an address is co mpared with the value set in the sar or sarx register as an address. if the receive data matches with the address in the sar or sarx register, the i 2 c bus interface erroneously recognizes that the address call has occurred. (see figure 25.24.) in multi-master mode, a bus conflict could happen. when the i 2 c bus interface is operated in master mode, check the state of the al bit in the icsr register every time after one frame of data has been transmitted or received. when arbitration is lost during transmitting the second frame or subsequent frame, take avoidance measures. section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 563 of 1038 rej09b0328-0300 ssla r/ w ssla r/ w a data2 ssla r/ w a sla r/ w a data3 a data4 data1 i 2 c bus interface (master transmit mode) transmit data match transmit timing match ? receive address is ignored ? automatically transferred to slave receive mode ? receive data is recognized as an address ? when the receive data matches to the address set in the sar or sarx register, the i 2 c bus interface operates as a slave device ? arbitration is lost ? the al flag in icsr is set to 1 transmit data does not match other device (master transmit mode) i 2 c bus interface (slave receive mode) data contention a a a figure 25.24 diagram of erroneous operation when arbitration is lost though it is prohibited in the normal i 2 c protocol, the same problem may occur when the mst bit is erroneously set to 1 and a transition to master mode is occurred during data transmission or reception in slave mode. in multi-master mode, pay attention to the setting of the mst bit when a bus conflict may occur. in this case, the mst bit in the iccr register should be set to 1 according to the order below. (a) make sure that the bbsy flag in the iccr register is 0 and the bus is free before setting the mst bit. (b) set the mst bit to 1. (c) to confirm that the bus was not entered to the busy state while the mst bit is being set, check that the bbsy flag in the iccr register is 0 imme diately after the mst bit has been set. (14) notes on interrupt occurrence after ackb reception ? conditions to cause this failure the iric flag is set to 1 when both of the following conditions are satisfied. ? 1 is received as the acknowledge bit for transm it data and the ackb bit in icsr is set to 1 ? rising edge of the 9th transmit/recei ve clock is input to the scl pin when the above two conditions are satisfied in slave receive mode, an unnecessary interrupt occurs. figure 25.25 shows the note on interrupt occurren ce in slave mode after receiving 1 as the acknowledge bit (ackb = 1). section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 564 of 1038 rej09b0328-0300 (1) for the last transmit data in master transmit mode or sl ave transmit mode, 1 is received as the acknowledge bit. if the acke bit in iccr is set to 1 at this time, the ackb bit in icsr is set to 1. (2) after switching to slave receive mode , the start condition is input, and address reception is performed next. (3) even if the received address does not ma tch the address set in sar or sarx, the iric flag is set to 1 at the rise of the 9th transmit/receive clock, thus causing an interrupt to occur. note that if the slave address matches, an interrupt is to be generated at the rise of the 9th transmit/receive clock as normal operation, so this is not erroneous operation. ? restriction in a transmit operation of the i 2 c bus interface module, carry out the following countermeasures. (1) after 1 is received as the acknowledge b it for transmit data, cl ear the acke bit in iccr to 0 to clear the ackb bit to 0. (2) to enable acknowledge bit reception afterwards, set the acke bit to 1 again. sda scl a ackb bit (1) acknowledge bit is received and the ackb bit is set to 1. 89 123456789 iric flag start condition 12 n stop condition stop condition detection data (2) address that does not match is received. master transmit mode or slave transmit mode countermeasure: clear the acke bit to 0 to clear the ackb bit. slave reception mode address (3) unnecessary interrupt occurs (received address is invalid). figure 25.25 note on interrupt occurren ce in slave mode after ackb = 1 reception section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 565 of 1038 rej09b0328-0300 (15) notes on trs bit setting and icdr register access conditions to cause this failure low-fixation of the scl pins is cancelled incorrectly when the following conditions are satisfied. ? master mode figure 25.26 shows the notes on icdr reading (trs = 1) in master mode. (1) when previously received 2-bytes data remains in icdr unread (icdrs are full). (2) reads icdr register after switching to transmit mode (trs = 1). (rdrf = 0 state) (3) sets to receive mode (trs = 0), after transmitting rev.1 frame of issued start condition by master mode. ? slave mode figure 25.27 shows the notes on icdr writing (trs = 0) in slave mode. (1) writes icdr register in receive mode (t rs = 0), after entering the start condition by slave mode (tdre = 0 state). address match with rev.1 frame, receive 1 by r/w bit, and switches to transmit mode (trs = 1). when these conditions are satisfied, the low fixation of the scl pins is cancelled without icdr register access after rev.1 frame is transferred. ? restriction please carry out the following countermeasures when transmitting/receiving via the iic bus interface module. (1) please read the icdr registers in recei ve mode, and write them in transmit mode. (2) in receiving operation with master mode, please issue the start condition after clearing the internal flag of the ii c bus interface module, using clr3 to clr0 bit of the ddcswr register on bus-free state (bbsy = 0). section 25 i 2 c bus interface (iic) rev.3.00 jan. 10, 2007 page 566 of 1038 rej09b0328-0300 sda scl a trs bit detection of 9th clock rise (trs = 1) address 8 rdrf bit start condition 12 a 3 stop condition icdr read trs = 0 setting data icdrs data full along with icdrs: icdrr transfer cancel condition of scl = low fixation is set. (3) trs = 0 (2) rdrf = 0 (1) icdrs data full 9 12345678 9 figure 25.26 notes on icdr reading with trs = 1 setting in master mode sda scl a trs bit trs = 0 setting address 89 8 9 tdre bit start condition 12 a 3 stop condition icdr write data (2) trs = 1 (1) tdre = 0 4 automatic trs = 1 setting by receiving r/w = 1 along with icdrs: icdrr transfer cancel condition of scl = low fixation 1234567 figure 25.27 notes on icdr writing with trs = 0 setting in slave mode section 26 a/d converter rev.3.00 jan. 10, 2007 page 567 of 1038 rej09b0328-0300 section 26 a/d converter 26.1 overview this lsi incorporates a 10-bit successive-approximations a/d converter that allows up to 12 analog input channels to be selected. 26.1.1 features a/d converter features are listed below. ? 10-bit resolution ? 12 input channels ? sample and hold function ? choice of software, hardware (internal signal) triggering, or external triggering for a/d conversion start. ? a/d conversion end interrupt request generation section 26 a/d converter rev.3.00 jan. 10, 2007 page 568 of 1038 rej09b0328-0300 26.1.2 block diagram figure 26.1 shows a block diagram of the a/d converter. /2 /4 adtrg interrupt request an0 vref av cc av ss reference voltage sample-and- hold circuit chopper type comparator an1 an2 an3 an4 an5 an6 an7 an8 an9 ana anb dfg adtrg (hsw timing generator) internal data bus legend: adr ahr : software trigger a/d result register : hardware trigger a/d result register adtrg, dfg adtrg : hardware trigger : a/d external trigger input adcr adcsr : a/d control register : a/d control/status register adtsr : a/d trigger selection register - + 10-bit d/a hardware control circuit control circuit analog multiplexer successive approximation register a d r a h r a d c s r a d c r a d t s r figure 26.1 block diagram of a/d converter section 26 a/d converter rev.3.00 jan. 10, 2007 page 569 of 1038 rej09b0328-0300 26.1.3 pin configuration table 26.1 summarizes the input pins used by the a/d converter. table 26.1 a/d converter pins name abbrev. i/o function analog power supply pin av cc input analog block power supply analog ground pin av ss input analog block ground and a/d conversion reference voltage analog input pin 0 an0 input analog input channel 0 analog input pin 1 an1 input analog input channel 1 analog input pin 2 an2 input analog input channel 2 analog input pin 3 an3 input analog input channel 3 analog input pin 4 an4 input analog input channel 4 analog input pin 5 an5 input analog input channel 5 analog input pin 6 an6 input analog input channel 6 analog input pin 7 an7 input analog input channel 7 analog input pin 8 an8 input analog input channel 8 analog input pin 9 an9 input analog input channel 9 analog input pin a ana input analog input channel a analog input pin b anb input analog input channel b a/d external trigger input pin adtrg input external trigger input for starting a/d conversion section 26 a/d converter rev.3.00 jan. 10, 2007 page 570 of 1038 rej09b0328-0300 26.1.4 register configuration table 26.2 summarizes the registers of the a/d converter. table 26.2 a/d converter registers name abbrev. r/w size initial value address * 2 software trigger a/d result register h adrh r byte h'00 h'd130 software trigger a/d result register l adrl r byte h'00 h'd131 hardware trigger a/d result register h ahrh r byte h'00 h'd132 hardware trigger a/d result register l ahrl r byte h'00 h'd133 a/d control register adcr r/w byte h'40 h'd134 a/d control/status register adcsr r (w) * 1 byte h'01 h'd135 a/d trigger selection register adtsr r/w byte h'fc h'd136 port mode register 0 pmr0 r/w byte h'00 h'ffcd notes: 1. only 0 can be written in bits 7 and 6, to clear the flag. bits 3 to 1 are read-only. 2. lower 16 bits of the address. section 26 a/d converter rev.3.00 jan. 10, 2007 page 571 of 1038 rej09b0328-0300 26.2 register descriptions 26.2.1 software-triggered a/ d result register (adr) adrh adrl 1 0 32 54 ?? ?? ?? ?? ?? ?? 7 0 r 6 0 r 9 0 r 8 0 r 11 0 r 10 0 r 0 r 0 r 0 r adr9 adr8 adr7 adr6 adr5 adr4 adr3 adr2 adr1 adr0 0 r 12 13 14 15 0 0 0 0 0 0 bit : initial value : r/w : the software-triggered a/d result register (adr) is a register that stores the result of an a/d conversion started by software. the a/d-converted data is 10-bit data. upon completion of software-triggered a/d conversion, the 10-bit result data is transferred to adr and the data is retained until the next software- triggered a/d conversion completion. the upper 8 bits of the data are stored in the upper bytes (bits 15 to 8) of adr, and the lower 2 bits are stored in the lower bytes (bits 7 and 6). bits 5 to 0 are always read as 0. adr can be read by the cpu at any time, but the adr value during a/d conversion is not fixed. the upper bytes can always be read directly, but the data in the lower bytes is transferred via a temporary register (temp). for details, see section 26.3, interface to bus master. adr is a 16-bit read-only register which is initia lized to h'0000 at a reset, and in module stop mode, standby mode, watch mode, subactive mode and subsleep mode. 26.2.2 hardware-triggered a/ d result register (ahr) ahrh ahrl 1 0 32 54 ?? ?? ?? ?? ?? ?? 7 0 r 6 0 r 9 0 r 8 0 r 11 0 r 10 0 r 0 r 0 r 0 r ahr9 ahr8 ahr7 ahr6 ahr5 ahr4 ahr3 ahr2 ahr1 ahr0 0 r 12 13 14 15 0 0 0 0 0 0 bit : initial value : r/w : the hardware-triggered a/d result register (ahr) is a register that stores the result of an a/d conversion started by hardware (internal signal: adtrg and dfg) or by external trigger input ( adtrg ). the a/d-converted data is 10-bit data. upon completion of hardware- or external-triggered a/d conversion, the 10-bit result data is transferred to ahr and the data is retained until the next hardware- or external- triggered a/d conversion completion. the upper 8 bits of the data are stored in the upper bytes (bits 15 to 8) of ahr, and the lower 2 bits are stored in the lower bytes (bits 7 and 6). bits 5 to 0 are always read as 0. section 26 a/d converter rev.3.00 jan. 10, 2007 page 572 of 1038 rej09b0328-0300 ahr can be read by the cpu at any time, but the ahr value during a/d conversion is not fixed. the upper bytes can always be read directly, but the data in the lower bytes is transferred via a temporary register (temp). for details, see section 26.3, interface to bus master. ahr is a 16-bit read-only register which is initia lized to h'0000 at a reset, and in module stop mode, standby mode, watch mode, subactive mode and subsleep mode. 26.2.3 a/d control register (adcr) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 0 6 ? ? 1 7 r/w r/w r/w hch1 0 r/w ck hch0 sch3 sch2 sch1 sch0 bit : initial value : r/w : adcr is a register that sets a/d conversion speed and selects analog input channel. when executing adcr setting, make sure that the sst and hst flags in adcsr is set to 0. adcr is an 8-bit readable/writable register that is initialized to h'40 by a reset, and in module stop mode, standby mode, watch mode, subactive mode and subsleep mode. bit 7 ? clock select (ck): sets a/d conversion speed. bit 7 ck description 0 conversion frequency is 266 states (initial value) 1 conversion frequency is 134 states note: a/d conversion starts when 1 is written in sst, or when hst is set to 1. the conversion period is the time from when this start flag is set until the flag is cleared at the end of conversion. actual sample-and-hold takes place (repeatedly) during the conversion frequency shown in figure 26.2. section 26 a/d converter rev.3.00 jan. 10, 2007 page 573 of 1038 rej09b0328-0300 conversion frequency note: irq sampling; conversion period (134 or 266 states) interrupt request flag irq sampling (cpu) states instruction execution mov.b write start flag when conversion ends, the start flag is cleared and the interrupt request flag is set. the cpu recognizes the interrupt in the last execution state of an instruction, and executes interrupt exception handling after completing the instruction. figure 26.2 internal op eration of a/d converter bit 6 ? reserved: this bit cannot be modified and always reads 1. writes are disabled. bits 5 and 4 ? hardware channel sel ect (hch1, hch0): these bits select the analog input channel that is converted by hardware triggering or triggering by an external input. only channels an8 to anb are available for hardware- or external-triggered conversion. bit 5 bit 4 hch1 hch0 analog input channel 0 an8 (initial value) 0 1 an9 1 0 ana 1 anb section 26 a/d converter rev.3.00 jan. 10, 2007 page 574 of 1038 rej09b0328-0300 bits 3 to 0 ? software channel select (sch3 to sch0) these bits select the analog input channel that is converted by software triggering. when channels an0 to an7 are used, appropriate pin settings must be made in port mode register 0 (pmr0). for pin settings, see section 26.2.6, port mode register 0 (pmr0). bit 3 bit 2 bit 1 bit 0 sch3 sch2 sch1 sch0 analog input channel 0 an0 (initial value) 0 1 an1 0 an2 0 1 1 an3 0 an4 0 1 an5 0 an6 0 1 1 1 an7 1 0 an8 0 1 an9 0 ana 0 1 1 anb 1 * * no channel selected for software-triggered conversion legend: * don't care. note: if conversion is started by software when sch3 to sch0 are set to 11 ** , the conversion result is undetermined. hardware- or external-triggered conversion, however, will be performed on the channel selected by hch1 and hch0. section 26 a/d converter rev.3.00 jan. 10, 2007 page 575 of 1038 rej09b0328-0300 26.2.4 a/d control/status register (adcsr) 0 ? ? 0 1 0 r 2 0 r 3 0 4 0 r/w 5 0 6 7 r/(w) * r r/w adie 0 r/(w) * send sst hst busy scnl hend 1 bit : initial value : r/w : note: * only 0 can be written to bits 7 and 6, to clear the flag. the a/d status register (adcsr) is an 8-bit register that can be used to start or stop a/d conversion, or check the status of the a/d converter. a/d conversion starts when 1 is written in sst flag. a/d conversion can also start by setting hst flag to 1 by hardware- or external-triggering. for adtrg start by hsw timing generator in hardware triggering, see section 28.4, hsw (head- switch) timing generator. when conversion ends, the converted data is stored in the software-triggered a/d result register (adr) or hardware-triggered a/d result register (ahr), and the sst or hst bit is cleared to 0. if software-triggering and hardware- or external-triggering are generated at the same time, priority is given to hardware- or external-triggering. adcsr is an 8-bit register whic h is initialized to h'01 by a reset, and in module stop mode, standby mode, watch mode, subactive mode and subsleep mode. bit 7 ? software a/d end flag (send): indicates the end of a/d conversion. bit 7 send description 0 [clearing condition] (initial value) 0 is written after reading 1 1 [setting condition] software-triggered a/d conversion has ended section 26 a/d converter rev.3.00 jan. 10, 2007 page 576 of 1038 rej09b0328-0300 bit 6 ? hardware a/d end flag (hend): indicates that hardware- or external-triggered a/d conversion has ended. bit 6 hend description 0 [clearing condition] (initial value) 0 is written after reading 1 [setting condition] hardware- or external-triggered a/d conversion has ended bit 5 ? a/d interrupt enable (adie): selects enable or disable of interrupt (adi) generation upon a/d conversion end. bit 5 adie description 0 interrupt (adi) upon a/d conversion end is disabled (initial value) 1 interrupt (adi) upon a/d conversion end is enabled bit 4 ? software a/d start flag (sst): starts software-triggered a/d conversion and indicates or controls the end of conversion. this bit remains 1 during software-triggered a/d conversion. when 0 is written in this bit, software-triggered a/d conversion operation can forcibly be aborted. bit 4 sst description read: indicates that software-triggered a/d conversion has ended or been stopped (initial value) 0 write: software-triggered a/d conversion is aborted 1 read: indicates that software-triggered a/d conversion is in progress write: starts software-triggered a/d conversion section 26 a/d converter rev.3.00 jan. 10, 2007 page 577 of 1038 rej09b0328-0300 bit 3 ? hardware a/d status flag (hst): indicates the status of hard ware- or external-triggered a/d conversion. when 0 is written in this bit, a/d conversion is aborted regardless of whether it was hardware-triggered or external-triggered. bit 3 hst description read: hardware- or external-triggered a/d conversion is not in progress(initial value) 0 write: hardware- or external-triggered a/d conversion is aborted. 1 hardware- or external-triggered a/d conversion is in progress. bit 2 ? busy flag (busy): during hardware- or external-triggered a/d conversion, if software attempts to start a/d conversion by writing to the sst bit, the sst bit is not modified and instead the busy flag is set to 1. this flag is cleared when the hardware-triggered a/d result register (ahr) is read. bit 2 busy description 0 no contention for a/d conversion (initial value) 1 indicates an attempt to execute software-triggered a/d conversion while hardware- or external-triggered a/d conversion was in progress bit 1 ? software-triggered convers ion cancel flag (scnl): indicates that software-triggered a/d conversion was canceled by the start of hardware-triggered a/d conversion. this flag is cleared when a/d conversion is started by software. bit 1 scnl description 0 no contention for a/d conversion (initial value) 1 indicates that software-triggered a/d conversion was canceled by the start of hardware-triggered a/d conversion bit 0 ? reserved: this bit cannot be modified and always reads 1. writes are disabled. section 26 a/d converter rev.3.00 jan. 10, 2007 page 578 of 1038 rej09b0328-0300 26.2.5 trigger select register (adtsr) 0 1 2 3 0 4 r/w 5 6 7 ? ? ? ? ? ? ? ? ? ? ? ? trgs1 0 r/w trgs0 111111 bit : initial value : r/w : the trigger select register (adtsr) selects hard ware- or external-triggered a/d conversion start factor. adtsr is an 8-bit readable/writabl e register that is initialized to h'fc by a reset, and in module stop mode, standby mode, watch mode, subactive mode and subsleep mode. bits 7 to 2 ? reserved: these bits are reserved and are alwa ys read as 1. writes are disabled. bits 1 and 0 ? trigger select: these bits select hardware- or external-triggered a/d conversion start factor. set these bits when a/d conversion is not in progress. bit 1 bit 0 trgs1 trgs0 description 0 hardware- or external-triggered a/d conversion is disabled (initial value) 0 1 hardware-triggered (adtrg) a/d conversion is selected 1 0 hardware-triggered (dfg) a/d conversion is selected 1 external-triggered ( adtrg ) a/d conversion is selected 26.2.6 port mode register 0 (pmr0) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 6 0 7 pmr04 pmr03 pmr02 pmr01 pmr00 0 r/w pmr07 r/w r/w r/w pmr06 pmr05 bit : initial value : r/w : port mode register 0 (pmr0) controls switching of each pin function of port 0. switching is specified for each bit. pmr0 is an 8-bit readable/writable register and is initialized to h'00 by a reset. section 26 a/d converter rev.3.00 jan. 10, 2007 page 579 of 1038 rej09b0328-0300 bits 7 to 0 ? p07/an7 to p00/an0 pin switching (pmr07 to pmr00): these bits set the p0n/ann pin as the input pin for p0n or as the ann pin for a/d conversion analog input channel. bit n pmr0n description 0 p0n/ann functions as a general-purpose input port (initial value) 1 p0n/ann functions as an analog input channel note: n = 7 to 0 26.2.7 module stop control register (mstpcr) 7 1 mstp15 r/w mstpcrh 6 1 mstp14 r/w 5 1 mstp13 r/w 4 1 mstp12 r/w 3 1 mstp11 r/w 2 1 mstp10 r/w 1 1 mstp9 r/w 0 1 mstp8 r/w 7 1 mstp7 r/w 6 1 mstp6 r/w 5 1 mstp5 r/w 4 1 mstp4 r/w 3 1 mstp3 r/w 2 1 mstp2 r/w 1 1 mstp1 r/w 0 1 mstp0 r/w mstpcrl bit : initial value : r/w : mstpcr consists of 8-bit readable/writable registers and performs module stop mode control. when the mstp2 bit in mstpcr is set to 1, a/d converter operation stops at the end of the bus cycle and a transition is made to module stop mode. for details, see section 4.5, module stop mode. mstpcr is initialized to h'ffff by a reset bit 2 ? module stop (mstp2): specifies the a/d converter module stop mode. mstpcrl bit 2 mstp2 description 0 a/d converter module stop mode is cleared 1 a/d converter module stop mode is set (initial value) section 26 a/d converter rev.3.00 jan. 10, 2007 page 580 of 1038 rej09b0328-0300 26.3 interface to bus master adr and ahr are 16-bit registers, but the data bus to the bus master is only 8 bits wide. therefore, in accesses by the bus master, the upper byte is accessed directly, but the lower byte is accessed via a temporary register (temp). a data reading from adr and ahr is performed as follows. when the upper byte is read, the upper byte value is transferred to the cpu and the lower byte value is transferred to temp. next, when the lower byte is r ead, the temp contents are transferred to the cpu. when reading adr and ahr, always read the upper byte before the lower byte. it is possible to read only the upper byte, but if only the lower byte is read, incorrect data may be obtained. figure 26.3 shows the data flow for adr access. the data flow for ahr access is the same. bus master (h'aa) adrh (h'aa) adrl (h'40) lower byte read bus master (h'40) adrh (h'aa) adrl (h'40) temp (h'40) temp (h'40) module data bus module data bus bus interface bus interface upper byte read figure 26.3 adr access opera tion (reading h'aa40) section 26 a/d converter rev.3.00 jan. 10, 2007 page 581 of 1038 rej09b0328-0300 26.4 operation the a/d converter operates by successive approximations with 10-bit resolution. 26.4.1 software-trigg ered a/d conversion a/d conversion starts when software sets the software a/d start flag (sst bit) to 1. the sst bit remains set to 1 during a/d conversion, and is automatically cleared to 0 when conversion ends. conversion can be software-triggered on any of the 12 channels provided by analog input pins an0 to anb. bits sch3 to sch0 in adcr select the analog input pin used for software- triggered a/d conversion. pins an8 to anb are also available for hardware- or external-triggered conversion. when conversion ends, send flag in adcsr bit is set to 1. if adie bit in adcsr is also set to 1, an a/d conversion end interrupt occurs. if the conversion time or input channel selection in adcr needs to be changed during a/d conversion, to avoid malfunctions, first clear the sst bit to 0 to halt a/d conversion. if software writes 1 in the sst bit to start software-triggered conversion while hardware- or external-triggered conversion is in progress, the hardware- or external-triggered conversion has priority and the software-triggered conversion is not executed. at this time, busy flag in adcsr is set to 1. the busy flag is cleared to 0 when the hardware-t riggered a/d result register (ahr) is read. if conversion is triggered by hardware while software-triggered conversion is in progress, the software-triggered conversion is immediately can celed and the sst flag is cleared to 0, and scnl flag in adcsr is set to 1. the scnl flag is cl eared when software writes 1 in the sst bit to start conversion after the hardware-triggered conversion ends. section 26 a/d converter rev.3.00 jan. 10, 2007 page 582 of 1038 rej09b0328-0300 26.4.2 hardware- or extern al-triggered a/d conversion the system contains the hardware trigger function that allows to turn on a/d conversion at a specified timing by use of the hardware trigger (internal signals: adtrg and dfg) and the incoming external trigger ( adtrg ). this function can be used to measure an analog signal that varies in synchronization with an external signal at a fixed timing. to execute hardware- or external-triggered a/d conversion, select appropriate start factor in trgs1 and trgs0 bits in adtsr. when the selected triggering occurs, hst flag in adcsr is set to 1 and a/d conversion starts. the hst flag remains 1 during a/d conversion, and is automatically cleared to 0 when conversion ends. for adtrg start by hsw timing generator in hardware triggering, see section 28.4, hsw (head-switch) timing generator. setting of the analog input pins on four channels from an8 to anb can be modified with the hardware trigger or the incoming external trigger. setting is done from hch1 and hch0 bits on adcr. pins an8 to anb are also available for software-triggered conversion. when conversion ends, hend flag in adcsr is set to 1. if adie bit in adcsr is also set to 1, an a/d conversion end interrupt occurs. if the conversion time or input channel selection in adcr needs to be changed during a/d conversion, to avoid malfunctions, first clear the hst flag to 0 to halt a/d conversion. if software writes 1 in the sst bit to start software-triggered conversion while hardware- or external-triggered conversion is in progress, the hardware- or external-triggered conversion has priority and the software-triggered conversion is not executed. at this time, busy flag in adcsr is set to 1. the busy flag is cleared to 0 when the hardware-t riggered a/d result register (ahr) is read. if conversion is triggered by hardware while software-triggered conversion is in progress, the software-triggered conversion is i mmediately canceled and the sst flag is cleared to 0, and scnl flag in adcsr is set to 1 (the sc nl flag is cleared when software writes 1 in the sst bit to start conversion after the hardware-triggered conversion ends). the analog input channel changes automatically from the channel that was undergoing software-triggered conversion (selected by bits sch3 to sch0 in adcr) to the channel selected by bits hch1 and hch0 in adcr for hardware- or external-triggered conversion. after the hardware- or external-triggered conversion ends, the channel reverts to the channel select ed by the software-triggered conversion channel select bits in adcr. hardware- or external-triggered conversion has priority over software-triggered conversion, so the a/d interrupt-handling routine should check the scnl and busy flags when it processes the converted data. section 26 a/d converter rev.3.00 jan. 10, 2007 page 583 of 1038 rej09b0328-0300 26.5 interrupt sources when a/d conversion ends, send or hend flag in adcsr is set to 1. the a/d conversion end interrupt can be enabled or disabled by adie bit in adcsr. figure 26.4 shows the block diagram of a/d conversion end interrupt. a/d conversion end interrupt (adi) to interrupt controller a/d control/status register (adcsr) send hend adie figure 26.4 block diagram of a/d conversion end interrupt section 26 a/d converter rev.3.00 jan. 10, 2007 page 584 of 1038 rej09b0328-0300 section 27 address trap controller (atc) rev.3.00 jan. 10, 2007 page 585 of 1038 rej09b0328-0300 section 27 address trap controller (atc) 27.1 overview the address trap controller (atc) is capable of generating interrupt by setting an address to trap, when the address set a ppears during bus cycle. 27.1.1 features address to trap can be set independently at three points. 27.1.2 block diagram figure 27.1 shows a block diagram of the address trap controller. trcr tar0 to 2 interrupt request modules bus internal bus trcr tar0 tar1 tar2 trap condition comparator bus interface : trap control register : trap address register 0 to 2 legend: figure 27.1 block diagram of atc section 27 address trap controller (atc) rev.3.00 jan. 10, 2007 page 586 of 1038 rej09b0328-0300 27.1.3 register configuration table 27.1 register list name abbrev. r/w initial value address * address trap control register atcr r/w h'f8 h'ffb9 trap address register 0 tar0 r/w h'f00000 h'ffb0 to h'ffb2 trap address register 1 tar1 r/w h'f00000 h'ffb3 to h'ffb5 trap address register 2 tar2 r/w h'f00000 h'ffb6 to h'ffb8 note: * lower 16 bits of the address. 27.2 register descriptions 27.2.1 address trap control register (atcr) 0 0 1 0 r/w 2 0 r/w 3 1 4 1 5 1 6 1 7 ? ? ? ? ? ? ? ? ? ? r/w trc2 trc1 trc0 1 bit : initial value : r/w : bits 7 to 3 ? reserved: when read, 1 is read at a ll times. writes are disabled. bit 2 ? trap control 2 (trc2): sets on/off operation of the address trap function 2. bit 2 trc2 description 0 address trap function 2 disabled (initial value) 1 address trap function 2 enabled bit 1 ? trap control 1 (trc1): sets on/off operation of the address trap function 1. bit 1 trc1 description 0 address trap function 1 disabled (initial value) 1 address trap function 1 enabled section 27 address trap controller (atc) rev.3.00 jan. 10, 2007 page 587 of 1038 rej09b0328-0300 bit 0 ? trap control 0 (trc0): sets on/off operation of the address trap function 0. bit 0 trc0 description 0 address trap function 0 disabled (initial value) 1 address trap function 0 enabled 27.2.2 trap address register 2 to 0 (tar2 to tar0) 0 0 1 0 r/w 2 0 r/w 3 4 5 6 7 r/w a18 a17 a16 0 0 r/w 0 r/w r/w a23 a22 a21 0 0 r/w r/w a20 a19 0 0 1 0 r/w 2 0 r/w 3 4 5 6 7 r/w a10 a9 a8 0 0 r/w 0 r/w r/w a15 a14 a13 0 0 r/w r/w a12 a11 0 ? ? 1 0 r/w 2 0 r/w 3 4 5 6 7 a2 a1 0 0 r/w 0 r/w r/w a7 a6 a5 0 0 r/w r/w a4 a3 0 bit : initial value : r/w : bit : initial value : r/w : bit : initial value : r/w : the tar is composed of three 8-bit readable/writable registers (tarna, b, and c)(n = 2 to 0) the tar sets the address to trap. the function of the tar2 to tar0 is the same. the tar is initialized to h'00 by a reset. tara bits 7 to 0: addresses 23 to 16 (a23 to a16) tarb bits 7 to 0: addresses 15 to 8 (a15 to a8) tarc bits 7 to 0: addresses 7 to 1 (a7 to a1) if the value installed in this register and internal address buses a23 to a1 match as a result of comparison, an interruption occurs. for the address to trap, set to th e address where the first byte of an instruction exists. in the case of other addresses, it may not be considered that the condition has been satisfied. bit 0 of this register is fixed at 0. the address to trap becomes an even address. the range where comparison is made is h' 000000 to h'fffffe. section 27 address trap controller (atc) rev.3.00 jan. 10, 2007 page 588 of 1038 rej09b0328-0300 27.3 precautions in usage address trap interrupt arises 2 states after prefet ching the trap address. trap interrupt may occur after the trap instruction has been executed, depending on a combination of instructions immediately preceding the set ting up of the address trap. if the instruction to trap immediately follows the branch instruction or the conditional branch instruction, operation may differ, depending on whether the condition was satisfied or not, or the address to be stacked may be located at th e branch. figures 27.2 to 27.22 show specific operations. for information as to where the next instruction prefetch occurs during the execution cycle of the instruction, see appendix a.5, bus status during instruction execution, of this manual or section 2.7, bus state during execution of instruction, h8s/2600 series, h8s/2000 series software manual. (r:w next is the next instruction prefetch.) 27.3.1 basic operations after terminating the execution of the instruction being executed in the second state from the trap address prefetch, the address trap interrupt exception handling is started. (1) figure 27.2 shows the operation when the instru ction immediately preceding the trap address is that of 3 states or more of the execution cycle and the next instruction prefetch occurs in the state before the last 2 states. the address to be stacked is 0260. address bus interrupt request signal mov execution mov instruc- tion pre-fetch nop instruc- tion pre-fetch internal opera- tion data read start of exception handling immediately preceding instruction address 025e mov.b @er3+,r2l 0260 nop (er3 = h'0000) 0262 nop 0264 nop 025e 0260 0000 0262 * * trap setting address the underlines address is the one to be actually stacked. note: figure 27.2 basic operations (1) note: in the figure above, the nop instruction is used as the typical example of instruction with execution cycle of 1 state. othe r instructions with the executi on cycle of 1 state also apply (ex. mov.b, rs, rd). section 27 address trap controller (atc) rev.3.00 jan. 10, 2007 page 589 of 1038 rej09b0328-0300 (2) figure 27.3 shows the operation when the instru ction immediately preceding the trap address is that of 2 states or more of the execution cycle and the next instruction prefetch occurs in the second state from the last. the address to be stacked is 0268. address bus interrupt request signal mov execution nop execution start of exception handling immediately preceding instruction address 0266 mov.b r2l, @0000 0268 nop 026a nop 026c nop * 0266 026a 0268 0000 026c data read mov instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch * trap setting address the underlines address is the one to be actually stacked. note: figure 27.3 basic operations (2) (3) figure 27.4 shows the operation when the instru ction immediately preceding the trap address is that of 1 state or 2 states or more and the prefet ch occurs in the last state. the address to be stacked is 025c. address bus interrupt request signal nop execu- tion nop execu- tion nop execu- tion start of exception handling immediately preceding instruction address 0256 nop 0258 nop 025a nop 025c nop 025e nop * 0256 025c 0258 025a 025e nop instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch * trap setting address the underlines address is the one to be actually stacked. note: figure 27.4 basic operations (3) section 27 address trap controller (atc) rev.3.00 jan. 10, 2007 page 590 of 1038 rej09b0328-0300 27.3.2 enable the address trap function becomes valid after executing one instruction following the setting of the enable bit of the address trap control register (trcr) to 1. 029c bset #0, @trcr * 029e mov.w r0, r1 02a0 mov.b r1l, r3h 02a2 nop 02a4 cmp.w r0, r1 02a6 nop after executing the mov instruction, the address trap interrupt does not arise, and the next instruction is executed. note: * trap setting address figure 27.5 enable 27.3.3 bcc instruction (1) when the condition is satisfied by bcc instruction (8-bit displacement) if the trap address is the next instruction to the bcc instruction and the condition is satisfied by the bcc instruction and then branched, transition is made to the address trap interrupt after executing the instruction at the branch. the address to be stacked is 02a8. address bus interrupt request signal beq execu- tion cmp execu- tion 029c 02a8 029e 02a6 02aa 029c beq next:8 029e nop 02a0 nop 02a2 nop 02a4 nop 02a6 cmp.w r0, r1 02a8 nop (next = h'02a6) * start of exception handling beq instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch cmp instruc- tion pre-fetch * trap setting address the underlines address is the one to be actually stacked. note: figure 27.6 when the condition is satisfie d by bcc instruction (8-bit displacement) section 27 address trap controller (atc) rev.3.00 jan. 10, 2007 page 591 of 1038 rej09b0328-0300 (2) when the condition is not satisfied by bcc instruction (8-bit displacement) if the trap address is the next instruction to the bcc instruction and the condition is not satisfied by the bcc instruction and thus it fails to branch, transition is made to the address trap interrupt after executing the trap a ddress instruction and prefetching the next instruction. the address to be stacked is 02a2. address bus interrupt request signal 029e 02a2 02a0 02a8 02a4 029e beq next:8 02a0 nop 02a2 nop 02a4 nop 02a6 nop 02a8 cmp.w r0, r1 02aa nop (next = h'02a8) * beq execu- tion nop execu- tion start of exception handling beq instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch cmp instruc- tion pre-fetch * trap setting address the underlines address is the one to be actually stacked. next: note: figure 27.7 when the condition is not satisf ied by bcc instructio n (8-bit displacement) section 27 address trap controller (atc) rev.3.00 jan. 10, 2007 page 592 of 1038 rej09b0328-0300 (3) when condition is not satisfied by bcc instruction (16- bit displacement) if the trap address is the next instruction to the bcc instruction and the condition is not satisfied by the bcc instruction and thus it fails to branch, transition is made to the address trap interrupt after executing the trap addr ess instruction (if the trap address instruction is that of 2 states or more. if the instruction is that of 1 state, after executing two instructions). the address to be stacked is 02c0. address bus interrupt request signal start of exception handling 02b8 02c0 02bc 02be 02c2 02ba 02b8 beq next:16 02bc nop 02be nop 02c0 nop 02c2 nop 02c4 nop (next = h'02c4) * beq execution nop execu- tion nop execu- tion data fetch internal opera- tion * trap setting address the underlines address is the one to be actually stacked. beq instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch next: note: figure 27.8 when the condition is not satisf ied by bcc instruction (16-bit displacement) section 27 address trap controller (atc) rev.3.00 jan. 10, 2007 page 593 of 1038 rej09b0328-0300 (4) when the condition is not satisfied by bcc instruction (trap address at branch) when the trap address is at th e branch of the bcc instruction and the condition is not satisfied by the bcc instruction and thus it fails to branch, transition is made into the address trap interrupt after executing the next instruction (if the next instruction is that of 2 states or more. if the next instruction is that of 1 state, after executing two instructions). the address to be stacked is 0262. address bus interrupt request signal start of exception handling 025c 0262 0266 025e 0260 0264 025c beq next:8 025e nop 0260 nop 0262 nop 0264 nop 0266 cmp.w r0, r1 0268 nop (next = h'0266) beq execution nop execu- tion nop execu- tion * beq instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch cmp instruc- tion pre-fetch * trap setting address the underlines address is the one to be actually stacked. next: note: figure 27.9 when the condition is not satisfied by bcc instruction (trap address at branch) section 27 address trap controller (atc) rev.3.00 jan. 10, 2007 page 594 of 1038 rej09b0328-0300 27.3.4 bsr instruction (1) bsr instruction (8-bit displacement) when the trap address is the next instruction to the bsr instruction and the addressing mode is an 8-bit displacement, transition is made to th e address trap interrupt after prefetching the instruction at the branch. the address to be stacked is 02c2. address bus interrupt request signal bsr execution stack saving 0294 sp-4 02c2 0296 sp-2 02c4 0294 bsr @er0 0296 nop 0298 nop 02c2 mov.w r4, @out 02c4 nop : : (@er0 = h'02c2) * start of exception handling bsr instruc- tion pre-fetch nop instruc- tion pre-fetch mov instruc- tion pre-fetch * trap setting address the underlines address is the one to be actually stacked. note: figure 27.10 bsr instru ction (8-bit displacement) section 27 address trap controller (atc) rev.3.00 jan. 10, 2007 page 595 of 1038 rej09b0328-0300 27.3.5 jsr instruction (1) jsr instruction (register indirect) when the trap address is the next instruction to the jsr instruction and the addressing mode is a register indirect, transition is made to the address trap interrupt after prefetching the instruction at the branch. the address to be stacked is 02c8. address bus interrupt request signal jsrexecution stack saving start of exception handling 029a sp - 4 02c8 029c sp - 202ca 029a jsr @er0 029c nop 029e nop 02c8 mov.w r4, @out 02ce nop : : (@er0 = h'02c8) * jsr instruc- tion pre-fetch nop instruc- tion pre-fetch mov instruc- tion pre-fetch * trap setting address the underlines address is the one to be actually stacked. note: figure 27.11 jsr instruction (register indirect) (2) jsr instruction (memory indirect) when the trap address is the next instruction to the jsr instruction and the addressing mode is memory indirect, transition is made to the address trap interrupt after prefetching the instruction at the branch. the address to be stacked is 02ea. address bus interrupt request signal jsr execution stack saving start of exception handling 0294 sp-2 sp-4 02ea 006c 0296 006e 02ec 0294 jsr @@h'6c:8 0296 nop 0298 nop 02ea nop 02ec nop : : 006c h'02ea : : * data fetch jsr instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch * trap setting address the underlines address is the one to be actually stacked. note: figure 27.12 jsr inst ruction (memory indirect) section 27 address trap controller (atc) rev.3.00 jan. 10, 2007 page 596 of 1038 rej09b0328-0300 27.3.6 jmp instruction (1) jmp instruction (register indirect) when the trap address is the next instruction to the jmp instruction and the addressing mode is a register indirect, transition is made to the address trap interrupt after prefetching the instruction at the branch. the address to be stacked is 02aa. address bus interrupt request signal jmp execution mov.l execution data fetch start of exception handling 029a 02a8 02aa 02a4 029c 02a6 02ac 029a jmp @er0 029c nop 029e nop 02a0 nop 02a2 nop 02a4 mov.l #data, er1 02aa nop (@er0 = h'02a4) * jmp instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch mov instruc- tion pre-fetch * trap setting address the underlines address is the one to be actually stacked. note: figure 27.13 jmp instruction (register indirect) (2) jmp instruction (memory indirect) when the trap address is the next instruction to the jmp instruction and the addressing mode is memory indirect, transition is made to the address trap interrupt after prefetching the instruction at the branch. the address to be stacked is 02e4. address bus interrupt request signal jmp execution start of exception handling 0294 006c 02e4 006c 0296 006e 02e6 0294 jmp @@h'6c:8 0296 nop 0298 nop 02e4 nop 02e6 nop : : 006c h'02e4 : : * data fetch internal opera- tion jmp instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch * trap setting address the underlines address is the one to be actually stacked. note: figure 27.14 jmp inst ruction (memory indirect) section 27 address trap controller (atc) rev.3.00 jan. 10, 2007 page 597 of 1038 rej09b0328-0300 27.3.7 rts instruction when the trap address is the next instruction to the rts instruction, transition is made to the address trap interrupt after reading the ccr and pc from the stack and pref etching the instruction at the return location. the ad dress to be stacked is 0298. address bus break interrupt request signal rts execution start of exception handling 02ac sp 0298 sp 02ae sp+2 029a stack storing 0296 bsr sub 0298 nop 029a nop 02ac rts 02ae nop * : : internal opera- tion rts instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch * trap setting address the underlines address is the one to be actually stacked. note: figure 27.15 rts instruction 27.3.8 sleep instruction (1) sleep instruction 1 when the trap address is the sleep instruction and th e instruction execution cycle immediately preceding the sleep inst ruction is that of 2 states or more and prefetch does not occur in the last state, the s leep instruction is not executed and transition is made to the address trap interrupt without going into sleep mode. the address to be stacked is 0274. address bus interrupt request signal start of exception handling 0272 fff9 0274 sp-4 sp-2 0276 0272 mov.b r2l, @fff8 0274 sleep 0276 nop 0278 nop : : * data write mov execution sleep cancel mov instruc- tion pre-fetch nop instruc- tion pre-fetch sleep instruc- tion pre-fetch * trap setting address the underlines address is the one to be actually stacked. note: figure 27.16 sleep instruction (1) section 27 address trap controller (atc) rev.3.00 jan. 10, 2007 page 598 of 1038 rej09b0328-0300 (2) sleep instruction 2 when the trap address is the sleep instruction and th e instruction execution cycle immediately preceding the sleep inst ruction is that of 1 state 2 states or more and prefetch occurs in the last state, this puts in the sleep mode after ex ecution of the sleep instruction, and the sleep mode is cancelled by the address tr ap interrupt and transition is made to the exception handling. the address to be stacked is 0264. address bus interrupt request signal start of exception handling 0260 0262 sp-2 sp-4 0264 0260 nop 0262 sleep 0264 nop 0266 nop : : * nop execution sleep execution sleep mode nop instruc- tion pre-fetch sleep instruc- tion pre-fetch nop instruc- tion pre-fetch * trap setting address the underlines address is the one to be actually stacked. note: figure 27.17 sleep instruction (2) (3) sleep instruction 3 when the trap address is the ne xt instruction to the sleep inst ruction, this puts in the sleep mode after execution of the sleep instructi on, and the sleep mode is cancelled by the address trap interrupt and transition is made to the exception handling. the address to be stacked is 0282. address bus interrupt request signal start of exception h andling 0280 sp-2 sp-4 0282 027e nop 0280 sleep 0282 nop 0284 nop : : * sleep execution sleep mode sleep instruc- tion pre-fetch nop instruc- tion pre-fetch * trap setting address the underlines address is the one to be actually stacked. note: figure 27.18 sleep instruction (3) section 27 address trap controller (atc) rev.3.00 jan. 10, 2007 page 599 of 1038 rej09b0328-0300 (4) sleep instruction 4 (sta ndby or watch mode setting) when the trap address is the sleep instruction and the instru ction immediatel y preceding the sleep instruction is that of 1 state or 2 states or more and prefetch occurs in the last state, this puts in the standby (watch) mode after execution of the sleep inst ruction. after that, if the standby (watch) mode is cancelled by the nmi inte rrupt, transition is made to nmi interrupt following the ccr and pc (at the address of 0266) stack saving and vector reading. however, if the address trap interrupt arises before starting execution of the nmi interrupt processing, transition is made to the address trap exception handling. the address to be stacked is the starting address of the nmi interrupt processing. address bus interrupt request signal address trap interruption 0262 0264 0266 sp-2 sp-2 0262 nop 0264 sleep 0266 nop * trap setting address * sleep execution nmi interrupt standby mode nop instruc- tion pre-fetch nop instruc- tion pre-fetch sleep instruc- tion pre-fetch note: figure 27.19 sleep instruction (4) (standby or watch mode setting) section 27 address trap controller (atc) rev.3.00 jan. 10, 2007 page 600 of 1038 rej09b0328-0300 (5) sleep instruction 5 (sta ndby or watch mode setting) when the trap address is the next instruction to the sleep instruction, this puts in the standby (watch) mode after execution of the sleep inst ruction. after that, if the standby (watch) mode is cancelled by the nmi interruption, transition is made to the nmi interrupt following the ccr and pc (at the address of 0266) stack saving and vector reading. however, if the address trap interrupt arises before starting execution of the nmi interrupt processing, transition is made to the address trap exception handling. the address to be stacked is the starting address of the nmi interrupt processing. address bus interrupt request signal address trap interrupt 0280 0282 0284 sp - 2 sp - 2 0280 nop 0282 sleep 0284 nop * trap setting address * sleep execution nmi interruption standby mode nop instruc- tion pre-fetch sleep instruc- tion pre-fetch note: figure 27.20 sleep instruction (5) (standby or watch mode setting) 27.3.9 competing interrupt (1) general interrupt (interrupt other than nmi) when the atc interrupt request is made at the timing in (1) (a) against the general interrupt request, the interruption appears to take place in the atc at the timing earlier than usual, because higher priority is assigned to the at c interrupt processing (simultaneous interrupt with the general interrupt has no effect on processing). the address to be stacked is 029e. for comparison, the case wh ere the trap address is set at 02a0 if no general interrupt request was made is shown in (2). the address to be stacked is 02a4. section 27 address trap controller (atc) rev.3.00 jan. 10, 2007 page 601 of 1038 rej09b0328-0300 address bus general interrupt request signal interrupt request signal mov execution data write data write start of general interrupt processing range of start of atc interrupt processing (1) 029c nop 0296 mov.b r2l, @port 029a nop 029e nop 02a0 nop 02a2 nop 02a4 nop 0296 port 029e sp-2 sp-4 vector vector 0298 nop execu- tion nop execu- tion mov execution nop execu- tion nop execu- tion nop execu- tion nop execu- tion nop execu- tion 029a 029c 02a0 address bus interrupt request signal data read data read start of atc interrupt processing set one of these to the trap address (2) 029c nop 0296 mov.b r2l, @port 029a nop 029e nop 02a0 nop trap address 02a2 nop 02a4 nop 0296 port 029e 0298 02a0 02a2 02a4 sp-2 029a 029c 02a6 (a) mov instruc- tion pre-fetch mov instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch address to be stacked figure 27.21 competing in terrupt (general interrupt) section 27 address trap controller (atc) rev.3.00 jan. 10, 2007 page 602 of 1038 rej09b0328-0300 (2) in case of nmi when the nmi interruption request is made at the timing in (1) (a) against the atc interrupt request, the interrupt appears to take place in nmi at the timing earlier than usual, because higher priority is assigned to the nmi interrupt processing. the atc interrupt processing starts after fetching the instruction at the starting address of the nmi interrupt processing. the address to be stacked is 02e0 for the nmi and 340 for the atc. when the atc interrupt request is made at the timing in (2) (b) against the nmi interrupt request, the atc interrupt processing starts after fetching the instruction at the starting address of the nmi interrupt processing. the address to be stacked is 02e6 for the nmi and 0340 for the atc. section 27 address trap controller (atc) rev.3.00 jan. 10, 2007 page 603 of 1038 rej09b0328-0300 address bus nmi interrupt request signal atc interrupt request signal start of atc inter- rupt processing (1) 02e0 nop 02dc nop 02de nop 02e2 nop 02e4 nop 02e6 nop 02e8 nop 02dc sp-4 0340 sp-6 sp-8 vector vector vector vector 02de nmi vector read 02e0 0342 sp-2 02e2 (2) set one of these to the trap address (1) set to the trap address nmi interrupt processing start of atc interrupt processing address bus nmi interrupt request signal atc interrupt request signal start of atc interrupt processing (2) 02dc 02e2 02e4 sp-4 sp-2 0340 vector vector vector 02de 02e0 0342 02e6 02e8 (b) (a) nmi interrupt processing : : 0340 the starting address of nmi interrupt : : nop execu- tion nop execu- tion nop instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch nop instruc- tion pre-fetch figure 27.22 competing interrupt (in case of nmi) section 27 address trap controller (atc) rev.3.00 jan. 10, 2007 page 604 of 1038 rej09b0328-0300 section 28 servo circuits rev.3.00 jan. 10, 2007 page 605 of 1038 rej09b0328-0300 section 28 servo circuits 28.1 overview 28.1.1 functions servo circuits for a video cassette recorder are included on-chip. the functions of the servo circuits can be divided into four groups, as listed in table 28.1. section 28 servo circuits rev.3.00 jan. 10, 2007 page 606 of 1038 rej09b0328-0300 table 28.1 servo circuit functions group function description ctl i/o amplifier gain variable input amplifier output amplifier with rewrite mode cfgduty compensation input duty accuracy: 50 2% (zero cross type comparator) dfg, dpg separation/overlap input overlap input available: three-level input method, dfg noise mask function reference signal generators v compensation, field detection, external signal sync, v sync when in rec mode, ref30 signal output to outside hsw timing generator head-switching signals, fifo 20 stages compatible with dfg counter soft-reset four-head high-speed switching circuit for special playback chroma-rotary/head-amplifier switching output 12-bit pwm improved speed of carrier frequency frequency division circuit with cfg mask, no cfg for phase or ctl mask (1) input and output circuits sync detection circuit noise count, field discrimination, hsync compensation, hsync detection noise mask drum speed error detector lock detector function, pause at the counter overflow, r/w error latch register, limiter function drum phase error detector latch signal selectable, r/w error latch register capstan speed error detector lock detector function, pause at the counter overflow, r/w error latch register, limiter function capstan phase error detector r/w error latch register (2) error detectors x-value adjustment and tracking adjustment circuit (separate setting available) (3) phase and gain compensation digital filter computation circuit computations performed automatically by hardware output gain variable: 2 to 64 (exponents of 2) (partial write in z -1 (high-order 8 bits) available) (4) other circuits additional v signal circuit valid when in special playback ctl circuit duty discrimination circuit, ctl head r/w control, compatible with wide aspect section 28 servo circuits rev.3.00 jan. 10, 2007 page 607 of 1038 rej09b0328-0300 28.1.2 block diagram figure 28.1 shows a block diagram of the servo circuits. 4-head special playback controller - + sv1(p82) excap(p81) ( ) sv2(p83) ( ) exctl(ps4) ) + + + + + - + + - - ctl head ctl amp ctl head cfg ca p pwm drm pwm dfg dpg(ps3) videoff audioff vpulse h.amp sw(ps1) c.rotary(ps0) comp(ps2) csync exttrg/(p80) osch rec:on adtrig (hsw) ep pwm es es ep rec rec pb.asm ctlfb pb.ctl pb. asm (ntsc) dvctl gain control by register setting ref30,ref30x,cref, ctlmoni,dvcfg, dfg,dpg,dfg,etc internal signal monitor controller (pal) ref30x rec-ctl dutyi/o (duty deter- minator) (assemble recording) dvcfg dvcfg2 gain up. xe:on vd pr0 to 7/ (p60 to 67) sync detector rec-ctl generator viss circuit noise det. a/d converter timer x1 timer l timer r an pins pwm x-value adjustment gain up. pr0 to 7/ (p60 to 67) ppg0 to 7/ (p70 to 77) ppg0 to 7/ (p70 to 77) ref30p(pb:30 hz, rec:1/2vd) cref res system clock additional v pulse generator head-switch timing generator drum system reference signal capstan system reference signal phase error detector phase error detector digital filter digital filter digital filter digital filter frequency divider frequency divider speed error detector speed error detector figure 28.1 block diagram of servo circuits section 28 servo circuits rev.3.00 jan. 10, 2007 page 608 of 1038 rej09b0328-0300 28.2 servo port 28.2.1 overview this lsi is equipped with seventeen pins dedicated to servo module and twenty-five dual-purpose pins used also for general-purpose port. it has also built-in input amplifier to amplify ctl signals, ctl output amplifier, ctl schmitt comparator, and cfg zero cross type comparator. the ctl input amplifier allows gain adjustment by software. dfg and dpg signals, which are the signals to control the drum, allow selection between separate or overlap input. sv1 and sv2 pins allow to output to monitor the inside signals of the servo section. the signals to be output can be selected out of eight kinds of signals. see section 28.2.5 (4), servo monitor control register (svmcr). 28.2.2 block diagram (1) dfg and dpg input circuits the dfg and dpg input pi ns have on-chip schmitt circuits. fi gure 28.2 shows the input circuits of dfg and dpg. dpg sw dfg dpg dfg dpg dpg sw res+lpm figure 28.2 input circuits of dfg and dpg (2) cfg input circuit the cfg input pin has built-in an amplifier and a zero cross type comparator. figure 28.3 shows the input circuit of cfg. section 28 servo circuits rev.3.00 jan. 10, 2007 page 609 of 1038 rej09b0328-0300 + - + - + - cfgcomp cfgcomp p250 ref m250 s r f/f o stp vref vref cfg bias cfg res+modulestop figure 28.3 cfg input circuit (3) ctl input circuit the ctl input pin has built-in an amplifier. figure 28.4 shows the input circuit of ctl. - + + - ctlfb ctlsmt(i) ctlfb ctlref ctlbias ctlgr0 ctlgr3 to 1 ampshort (rec-ctl) pb-ctl(+) note: be sure to set a capacitor between ctlamp (o) and ctlsmt (i) note pb-ctl(-) ampon (pb-ctl) - + ctlamp(o) ctl(+) ctl( - ) figure 28.4 ctl input circuit section 28 servo circuits rev.3.00 jan. 10, 2007 page 610 of 1038 rej09b0328-0300 28.2.3 pin configuration table 28.2 shows the pin configuration of the servo section. p6n, p7n, p80 to p83, and ps1 to ps4 are general-purpose ports. as for p6, p7, and p8, see section 11, i/o port. table 28.2 pin configuration name abbrev. i/o function servo v cc pin sv cc input power source pin for servo section servo v ss pin sv ss input power source pin for servo section audio head switching pin audio ff output audio head switching signal output video head switching pin video ff output video head switching signal output capstan mix pin cappwm output 12-bit pwm square wave output drum mix pin drmpwm output 12-bit pwm square wave output additional v pulse pin vpulse output additional v signal output color rotary signal output pin c.rotary/ps0 output, i/o control signal output port for processing color signals/general- purpose port head amplifier switching pin h.amp. sw/ ps1 output, i/o pre-amplifier output selection signal output/general-purpose port compare signal input pin comp/ps2 input, i/o pre-amplifier output result signal input/general-purpose port ctl (+) i/o pin ctl (+) i/o ctl signal input/output ctl ( ? ) i/o pin ctl (-) i/o ctl signal input/output ctl bias input pin ctlbias input ctl primary amplifier bias supply ctl amp (o) output pin ctlamp (o) output ctl amplifier output ctl smt (i) input pin ctlsmt (i) input ctl schmitt amplifier input ctl fb input pin ctlfb input ctl amplifier high-range characteristics control ctl ref output pin ctlref output ctl amplifier reference voltage output capstan fg amplifier input pin cfg input cfg signal amplifier input drum fg input pin dfg input dfg signal input drum pg input pin dpg/ps3 input, i/o dpg signal input/general-purpose port external ctl signal input pin exctl/ps4 input, i/o external ctl signal input/general- purpose port complex sync signal input pin csync input complex sync signal input section 28 servo circuits rev.3.00 jan. 10, 2007 page 611 of 1038 rej09b0328-0300 name abbrev. i/o function external reference signal input pin p80/exttrg i/o, input general-purpose port/external reference signal input external capstan signal input pin p81/excap i/o, input general-purpose port/external capstan signal input servo monitor signal output pin 1 p82/sv1 i/o, output general-purpose port/servo monitor signal output servo monitor signal output pin 2 p83/sv2 i/o, output general-purpose port/servo monitor signal output ppg output pin p7n/ppgn i/o, output general-purpose port/ppg output rtp output pin p6n/rpn i/o, output general-purpose port/rtp output 28.2.4 register configuration table 28.3 shows the register configuration of the servo port section. table 28.3 register configuration name abbrev. r/w size initial value address servo port mode register spmr r/w byte h'40 h'fd0a0 servo control register spcr w byte h'e0 h'fd0a1 servo data register spdr r/w byte h'e0 h'fd0a2 servo monitor control register svmcr r/w byte h'c0 h'fd0a3 ctl gain control register ctlgr r/w byte h'c0 h'fd0a4 section 28 servo circuits rev.3.00 jan. 10, 2007 page 612 of 1038 rej09b0328-0300 28.2.5 register descriptions (1) servo port mode register (spmr) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 6 ? ? 7 exctlon dpgsw comp h.amp.sw c.rot 0 r/w ctlstop r/w r/w cfgcomp 1 bit : initial value : r/w : a register to switch the servo port/general-purpose port, and the cfg input system. spmr is an 8-bit read/write register. bit 6 is reserved; writing in it is invalid. if read is attempted, an undetermined value is read out. it is initialized to h'40 by a reset or stand-by. bit 7 ? ctlstop bit (ctlstop): controls whether the ctl circuits are operated or stopped. bit 7 ctlstop description 0 ctl circuits operate (initial value) 1 ctl circuits stop operation bit 6 ? reserved: this bit is reserved. it cannot be written or read. if read is attempted, an undetermined value is read out. bit 5 ? cfg input system switching bit (cfgcomp): selects whether the cfg input signal system is set to the zero cross type comparator system or digital signal input system. bit 5 cfgcomp description 0 cfg signal input system is set to the zero cross type comparator system (initial value) 1 cfg signal input system is set to the digital signal input system bit 4 ? exctl pin switching bit (exctlon): selects whether the exctl/ps4 pin is used as the exctl input pin or ps4 (general-purpose i/o pin). bit 4 exctlon description 0 exctl/ps4 pin functions as exctl input pin (initial value) 1 exctl/ps4 pin functions as ps4 i/o section 28 servo circuits rev.3.00 jan. 10, 2007 page 613 of 1038 rej09b0328-0300 bit 3 ? dpg pin switching bit (dpgsw): selects the drum control system input signals (dfg, dpg) as separate or overlapped inputs. bit 3 dpgsw description 0 drum control system inputs are separate inputs (initial value) (dpg/ps3 pin functions as dpg input pin) 1 drum control system inputs are overlapped inputs (dpg/ps3 pin functions as ps3 i/o pin) bit 2 ? comp pin switching pin (comp): selects whether the comp/ ps2 pin is used as the comp input pin or ps2 (general-purpose i/o pin). bit 2 comp description 0 comp/ps2 pin functions as comp input pin (initial value) 1 comp/ps2 pin functions as ps2 i/o pin bit 1 ? h.amp sw pin switching bit (h.amp.sw): selects whether the h.amp sw/ps1 pin is used as the h.amp sw output pin or ps1 (general-purpose i/o pin). bit 1 h.amp.sw description 0 h.amp sw/ps1 pin functions as h.amp sw output pin (initial value) 1 h.amp sw/ps1 pin functions as ps1 i/o pin bit 0 ? c.rotary pin switching bit (c.rot): selects whether the c.rotary /ps0 pin is used as the c.rotary output pin or ps0 (general-purpose i/o pin). bit 0 c.rot description 0 c.rotary/ps0 pin functions as c.rotary output pin (initial value) 1 c.rotary/ps0 pin functions as ps0 i/o pin section 28 servo circuits rev.3.00 jan. 10, 2007 page 614 of 1038 rej09b0328-0300 (2) servo control register (spcr) 0 0 1 0 w 2 0 w 3 0 4 0 w 5 6 7 ? ? ? ? ? ? spcr4 spcr3 spcr2 spcr1 spcr0 w w 11 1 bit : initial value : r/w : controls input and output of e ach pin (ps4 to ps0) for each b it when the servo port/general- purpose port dual-purpose pin is used as the general-purpose port. if spcr is set to 1, the corresponding ps4 to ps0 pins function as output pins; if cleared to 0, they function as input pins. settings of spcr and spdr are valid if the corresponding pins are set to general-purpose i/o by spmr. spcr is an 8-bit write-only register. if read is attempted, an undetermined value is read out. bits 7 to 5 are reserved bits. writes are disabled. spcr is initialized to h'e0 by a reset or stand-by. bit n spcrn description 0 psn pin functions as input (initial value) 1 psn pin functions as output (3) servo data register (spdr) 0 0 1 0 2 0 3 0 4 0 5 6 7 ? ? ? ? ? ? spdr4 spdr3 spdr2 spdr1 spdr0 11 1 r/w r/w r/w r/w r/w bit : initial value : r/w : stores the data of each pin (ps4 to ps0) when the servo port/general-purpose dual-purpose pin is used as general-purpose port. if the port is acce ssed for read when spcr is 1 (output), the spdrn value is read directly. accordingly, this register is not affected by the state of the pin. if the port is accessed for read when spcr is 0 (input), the state of the pin is read out. spdr is an 8-bit read/write register. bits 7 to 5 are reserved. no write in it is valid. if read is attempted, an undetermined value is read out. spcr is initialized to h'e0 by reset or stand-by. section 28 servo circuits rev.3.00 jan. 10, 2007 page 615 of 1038 rej09b0328-0300 (4) servo monitor co ntrol register (svmcr) 0 0 1 0 2 0 3 0 4 0 5 6 7 ? ? ? ? svmcr4 svmcr3 svmcr2 svmcr1 svmcr0 1 1 r/w r/w r/w 0 svmcr5 r/w r/w r/w bit : initial value : r/w : selects the monitor signal output to the sv1 and sv2 pins when the p82/sv1 pin is used as the sv1 monitor output pin or when the p83/sv2 pin is used as the sv2 monitor output pin. svmcr is an 8-bit read/write register. bits 7 a nd 6 are reserved. writes are disabled. if read is attempted, an undetermined value is read out. it is initialized to h'c0 by a reset or stand-by. bit 5 bit 4 bit 3 svmcr5 svmcr4 svmcr3 description 0 outputs ref30 signal to sv2 output pin (initial value) 0 1 outputs capref30 signal to sv2 output pin 0 outputs cref signal to sv2 output pin 0 1 1 outputs ctlmoni signal to sv2 output pin 0 outputs dvcfg signal to sv2 output pin 0 1 outputs cfg signal to sv2 output pin 0 outputs dfg signal to sv2 output pin 1 1 1 outputs dpg signal to sv2 output pin bit 2 bit 1 bit 0 svmcr2 svmcr1 svmcr0 description 0 outputs ref30 signal to sv1 output pin (initial value) 0 1 outputs capref30 signal to sv1 output pin 0 outputs cref signal to sv1 output pin 0 1 1 outputs ctlmoni signal to sv1 output pin 0 outputs dvcfg signal to sv1 output pin 0 1 outputs cfg signal to sv1 output pin 0 outputs dfg signal to sv1 output pin 1 1 1 outputs dpg signal to sv1 output pin section 28 servo circuits rev.3.00 jan. 10, 2007 page 616 of 1038 rej09b0328-0300 (5) ctl gain control register (ctlgr) 0 0 1 0 2 0 3 0 4 0 5 6 7 ? ? ? ? ctlfb ctlgr3 ctlgr2 ctlgr1 ctlgr0 1 1 r/w r/w r/w 0 ctle/ a r/w r/w r/w bit : initial value : r/w : sets the ctlfb switch in the ctl amplifier circuit to on/off and ctl amplifier gain. ctlgr is an 8-bit read/write register. bits 7 and 6 are reserved. no write in it is valid. if read is attempted, an undetermined value is read out. it is initialized to h'c0 by a reset or stand-by. bits 7 and 6 ? reserved: reserved bits; writes are disabled . if read was attempted, an undetermined value is read out. bit 5 ? ctl selection bit (ctle/ a ): controls whether the amplifier output or exctl is used as the ctlp signal supplie d to the ctl circuit. bit 5 ctle/ a description 0 amp output (initial value) 1 exctl bit 4 ? sw bit of the feedback sectio n of ctl amplifier (ctlfb): turning on/off the sw of the feedback section allows adjustment of gain. see figure 28.4, ctl input circuit. bit 4 ctlfb description 0 turns off ctlfb sw (initial value) 1 turns on ctlfb sw section 28 servo circuits rev.3.00 jan. 10, 2007 page 617 of 1038 rej09b0328-0300 bits 3 to 0 ? ctl amplifier gain setting bits (ctlgr3 to 0): set the output gain of the ctl amplifier. bit 3 bit 2 bit 1 bit 0 ctlgr3 ctlgr2 ctlgr1 ctlgr0 ctl output gain 0 34.0 db (initial value) 0 1 36.5 db 0 39.0 db 0 1 1 41.5 db 0 44.0 db 0 1 46.5 db 0 49.0 db 0 1 1 1 51.5 db 0 54.0 db 0 1 56.5 db 0 59.0 db 0 1 1 61.5 db 0 64.0 db * 0 1 66.5 db * 0 69.0 db * 1 1 1 1 71.5 db * note: * with a setting of 64.0 db or more, the ctlamp is in a very sensitive status. when configuring the set board, be concerned about countermeasure against noise around the control head signal input port. also, thoroughly set the filter between the ctlamp and ctlsmt. section 28 servo circuits rev.3.00 jan. 10, 2007 page 618 of 1038 rej09b0328-0300 28.2.6 dfg/dpg input signals dfg and dpg signals allow either separate or overlapped input. if the latter was selected (dpgsw = 1), take care in the input levels of dfg and dpg. figure 28.5 shows dfg/dpg input signals. dpg dpg schmitt level 3.45/3.55 v il /v ih dfg schmitt level 1.85/1.95 v il /v ih dfg (1) dpg/dfg separate input (dpgsw = 0) dpg schmitt level dfg/dpg (2) dpg/dfg overlapped input (dpgsw = 1) dfg schmitt level figure 28.5 dfg/dpg input signals section 28 servo circuits rev.3.00 jan. 10, 2007 page 619 of 1038 rej09b0328-0300 28.3 reference sign al generators 28.3.1 overview the reference signal generators consist of ref 30 signal generator and cref signal generator, and they create the reference signals (ref30 and cref signals) used in phase comparison, etc. the ref30 signal is used to control the phase of the drum and capstan. the cref signal is used if the reference signal to control the phase of the capstan cannot be shared with the ref30 signal in rec mode. each signal generator consists of a 16-bit counter which has the servo clock s/2 (or s/4) as its clock source, a referen ce period register and a comparator. the value set in the reference period register shoul d be 1/2 of the desired reference signal period. 28.3.2 block diagram figure 28.6 shows the block diagram of the ref30 signal generator. figure 28.7 shows that of the cref signal generator. section 28 servo circuits rev.3.00 jan. 10, 2007 page 620 of 1038 rej09b0328-0300 s = fosc/2 s/2 s/4 dummy read external frequency signal (exttrg) field detection signal ww ww ww pb rec pb , asm rec/ pb v noise detection signal ref30 ref30p video ff vd match mask clear w r/w w internal bus r/w internal bus toggle rcs ref30 counter register (16 bit) od/ev vst fds veg edge detec- tion edge detec- tion vna r/w * tbc cvs rex reference period buffer 1 (16 bit) reference period register 1 (16 bit) comparator (16 bit) counter (16 bit) note: * the tbc bit is available only in the h8s/2194c group. figure 28.6 ref30 signal generator section 28 servo circuits rev.3.00 jan. 10, 2007 page 621 of 1038 rej09b0328-0300 s/2 s/4 ww cref dvcfg2 pb(asm) rec match clear counter clear toggle edge detection crd w rcs reference period register 2 (16 bit) reference period buffer 2 (16 bit) comparator (16 bit) counter (16 bit) internal bus s r q dummy read s = fosc/2 figure 28.7 block diagram of cref signal generator 28.3.3 register configuration table 28.4 shows the register configura tion of the reference signal generators. table 28.4 register configuration name abbrev. r/w size initial value address reference period mode register rfm w byte h'00 h'fd096 reference period register 1 rfd w word h'ffff h'fd090 reference period register 2 crf w word h'ffff h'fd092 ref30 counter register rfc r/w word h'0000 h'fd094 reference period mode register 2 rfm2 r/w byte h'fe h'fd097 section 28 servo circuits rev.3.00 jan. 10, 2007 page 622 of 1038 rej09b0328-0300 28.3.4 register descriptions (1) reference period mode register (rfm) 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 6 0 7 rex crd od/ev vst veg 0 w rcs w w w vna cvs bit : initial value : r/w : rfm is an 8-bit write-only register which determines the operational state of the reference signal generators. if a read is attempted, an undetermined value is read out. it is initialized to h'00 by a reset, stand-by or module stop. rfm is accessible by byte access only. if accessed by a word, its operation is not assured. bit 7 ? clock source selection bit (rcs): selects the clock source supplied to the counter. ( s = fosc/2) bit 7 rcs description 0 s/2 (initial value) 1 s/4 bit 6 ? mode selection bit (vna): selects whether the transition to free-run operation when the ref30 signals are being generated in sync with the vd signals in rec mode is controlled automatically by the v noise detection signal, which has been detected by the sync signal detection circuit, or is controlled manually by software. bit 6 vna description 0 manual mode (initial value) 1 auto mode section 28 servo circuits rev.3.00 jan. 10, 2007 page 623 of 1038 rej09b0328-0300 bit 5 ? manual selection bit (cvs): selects whether the ref30 signals are generated in sync with vd or operated free-run in manual mode (vna = 0). (no selection is reflected in pb mode, except in tbc mode.) bit 5 cvs description 0 sync with vd (initial value) 1 free-run operation bit 4 ? external signals sync selection bit (rex): selects whether the ref30 signals are generated in sync with vd or in free-run or in sync with the external signals. (valid in both pb and rec modes.) bit 4 rex description 0 vd signals or free-run (initial value) 1 sync with external signals bit 3 ? dvcfg2 sync selection bit (crd): selects whether the reset timing in the cref signals generation is immediately after switching from pb (asm) mode to rec mode or is in sync with the dvcfg2 signals immediately after the switching. bit 3 crd description 0 on switching modes (initial value) 1 in sync with dvcfg2 signals bit 2 ? odd/even edge switching selection bit (od/ev): selects whether ref30p signals are generated by odd of the field signals or even when in rec mode. bit 2 od/ev description 0 generated at the rising edge (even) of the field signals (initial value) 1 generated at the falling edge (odd) of the field signals section 28 servo circuits rev.3.00 jan. 10, 2007 page 624 of 1038 rej09b0328-0300 bit 1 ? video ff counter set (vst): selects whether the ref30 counter register value is set on or off by the video ff signal when the drum phase is in fix on in pb mode. bit 1 vst description 0 counter set off by video ff signal (initial value) 1 counter set on by video ff signal bit 0 ? video ff edge selection bit (veg): selects the edge at which the ref30 counter is set (vst = 1) by the video ff signal. bit 0 veg description 0 set at the rising edge of video ff signal (initial value) 1 set at the falling edge of video ff signal (2) reference period register 1 (rfd) 15 1 ref15 w 14 1 ref14 w 13 1 ref13 w 12 1 ref12 w 11 1 ref11 w 10 1 ref10 w 9 1 ref9 w 8 1 ref8 w 7 1 ref7 w 6 1 ref6 w 5 1 ref5 w 4 1 ref4 w 3 1 ref3 w 2 1 ref2 w 1 1 ref1 w 0 1 ref0 w bit : initial value : r/w : the reference period register 1 (rfd) is a buffer re gister which generates the reference signals for playback (ref30), vd compensation for recording and the reference signals for free-running. it is a 16-bit write-only register accessible by a word onl y. if a read is attempted, an undetermined value is read out. the value set in rfd should be 1/2 of the desire d reference signal period. care is required when vd is unstable, such as when the field is weak (synchronization with vd cannot be acquired if a value less than 1/2 is set when in rec). when data is written in rfd, it is stored in the buffer once, and then fetched into rfd by a match signal of the comparator. (the data which generates the reference signal is updated from time to time by the match signal.) an enforced write, such as initial setting, etc., should be done by a dummy read of rfd. if a byte-write in rfd is attempted, no operation is assured. rfd is initialized to h'ffff by a reset, stand-by, or module stop. use bit 7 (asm) and bit 6 (rec/pb) in the ctl mode register (ctlm) in the ctl circuit to switch between record and playback modes. use bit 4 (cr/rf bit) in the capstan phase error detection control register (cpgcr) to switch between ref30 and cref for capstan phase control. section 28 servo circuits rev.3.00 jan. 10, 2007 page 625 of 1038 rej09b0328-0300 (3) reference period register 2 (crf) 15 1 crf15 w 14 1 crf14 w 13 1 crf13 w 12 1 crf12 w 11 1 crf11 w 10 1 crf10 w 9 1 crf9 w 8 1 crf8 w 7 1 crf7 w 6 1 crf6 w 5 1 crf5 w 4 1 crf4 w 3 1 crf3 w 2 1 crf2 w 1 1 crf1 w 0 1 crf0 w bit : initial value : r/w : the reference period register 2 (crf) is a 16-bit write-only buffer register which generates the reference signals to control the capstan phase ( cref). crf is accessibly by a word only. if a read is attempted, an undetermined value is read out. the value set in crf should be 1/2 of the desired reference signal period. when data is written in crf, it is stored in the buffer once, and then fetched into crf by a match signal of the comparator. (the data which generates the reference signal is updated from time to time by the match signal.) an enforced write, such as initial setting, etc., should be done by a dummy read of crf. if a byte-write in crf is attempted, no operation is assured. crf is initialized to h'ffff by a reset, stand-by, or module stop. use bit 4 (cr/rf bit) in the capstan phase error detection control register (cpgcr) to switch between ref30 and cref for capstan phase control. (see section 28.9, capstan phase error detector) (4) ref30 counter register (rfc) 15 0 rfc15 14 0 rfc14 13 0 rfc13 12 0 rfc12 11 0 rfc11 10 0 rfc10 9 0 rfc9 8 0 rfc8 7 0 rfc7 6 0 rfc6 5 0 rfc5 4 0 rfc4 3 0 rfc3 2 0 rfc2 1 0 rfc1 0 0 rfc0 r/w r/w r/w r/w 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 : the ref30 counter register (rfc) is a register which determines the initial value of the free-run counter when it generates ref30 signals when in pl ayback. when data is wr itten in rfc, its value is written in the counter by a match signal of the comp arator. if bit 1 (vst) in rfm is set to 1, the counter is set by the video ff signal when the dr um phase is in fix on. the counter setting by the video ff signal should be done by setting rfm' s bit 1 (vst) and bit 0 (veg). don't set the rfc value at a value greater than 1/2 of the reference period register 1 (rfd). rfc is a read/write register. if a read is attempte d, the value of the counter is read out. if a byte- access is attempted, no operation is assured. rfc is initialized to h'0000 by a reset, stand-by, or module stop. section 28 servo circuits rev.3.00 jan. 10, 2007 page 626 of 1038 rej09b0328-0300 (5) reference period mode register 2 (rfm2) 0 0 1 1 2 1 3 1 4 1 5 6 7 ? ? ? ? ? ? (tbc) ? ? ? ? ? ? (r/w) * fds 1 11 r/w bit : initial value : r/w : note: * writable only in the h8s/2194c group. rfm2 is an 8-bit read/write register which determines the operational state of the reference signal generators. bits 6 to 1 are reserved. if a read is attempted, an undetermined value is read out. it is initialized to h'fe by a reset, stand-by or module stop. rfm2 is a byte access-only register; if accessed by a word, no operation is assured. bit 7 ? tbc selection bit (tbc): selects whether the reference signals are generated by vd or in free-run in pb mode. bit 7 tbc description 0 reference signals are generated by vd (this function is effective only in the h8s/2194c group) 1 reference signals are generated in free-run (initial value) bits 6 to 1 ? reserved: no write is valid. if a read is attempted, an undetermined value is read out. bit 0 ? field selection bit (fds): determines whether selection between odd or even is made for the field signals when pb mode was switched over to rec mode, or these signals are synchronized with vd signals within phase error of 90 immediately after the switching over. bit 0 fds description 0 generated by the vd signal of odd or even selected (initial value) 1 generated by the vd signal within mode transition phase error of 90 section 28 servo circuits rev.3.00 jan. 10, 2007 page 627 of 1038 rej09b0328-0300 28.3.5 description of operation (1) operation of ref30 signal generators the ref30 signal generators generate the referen ce signals required to control the phase of the drum and capstan. to generate ref30 signals, set the half-period value to the reference period register 1 (rfd) corresponding to the 50% duty cycle. when in playback, ref30 signals are generated by operating ref30 signal generator in free-run. the generator has the external signal synchronization function built-in, and if bit 4 (rex) of the reference period mode register (rfm) is set to 1, it generates ref30 signals from external signals (exttrg). in record mode, the reference signals are gene rated from the vd signal generated in the sync signal detection circuit. any vd drop-out caused by weak field intensity, etc., is compensated by a set value of rfd. to cope with the vd noises, the generator performs automatically the vd masking for a time period about 75% of the rfd setting after ref30 signal was changed due to vd. in record mode, the generation of the reference signals either by vd or free-run operation can be controlled automatically or by software, using th e v noise detection signal detected in the sync signal detection circuit. select which is used by setting bit 6 (vna) or 5 (cvs) of rfm. the phase of the toggle output of the ref30 signal is cleared to l level when the signal mode transits from pb to rec (asm). also the frame servo function can be set, allowing to control the phase of ref30 signals with the field signal detected in the sync signal detection circuit. use bit 2 (od/ev) of rfm for such control. see section 28.13.5(2), ctl mode register (ctlm), as for switching over between pb, asm and rec. (2) operation of the mask circuit the ref30 signal generators have a toggle mask circuit and counter mask (counter set signal mask) circuit built-in. each mask circuit masks irregular vd signals which may occur when the vd signal is unstable because of weak fi eld intensity, etc., in record mode. the toggle mask and counter mask circuits mask the vd automatically for about 75% of double the time period set in the reference period regi ster 1 (rfd) after a vd signal was detected (see figure 28.9). if a vd signal dropped out and v was compensated, the toggle mask circuit begins masking. the counter mask circuit does not do so for about 25% of the time period. if a vd signal was detected during such time period, it does masking for about 75% of the time period. if not detected, it does for the same time period after v was compensated (see figures 28.10 and 28.11). section 28 servo circuits rev.3.00 jan. 10, 2007 page 628 of 1038 rej09b0328-0300 (3) timing of the ref30 signal generation figures 28.8, 28.9, 28.10, 28.11, and 28.12 show the timing of the generation of ref30 and ref30p signals. counter set counter set counter set value set in reference period register 1 (rfd) counter value set in ref30 counter register (rfc) ref30 ref30p figure 28.8 ref30 signals in playback mode section 28 servo circuits rev.3.00 jan. 10, 2007 page 629 of 1038 rej09b0328-0300 sampling sampling sampling value set in reference period register 1 (rfd) selected vd (od/ev = 0) counter mask (clear signal mask) counter value set in ref30 counter register (rfc) ref30 vd toggle mask field signal ref30p hsw drum phase counter t about 75% masking period masking period figure 28.9 generati on of reference signal in r ecord mode (normal operation) section 28 servo circuits rev.3.00 jan. 10, 2007 page 630 of 1038 rej09b0328-0300 sampling cleared cleared cleared drop-out of v value set in reference period register 1 (rfd) selected vd (od/ev = 0) counter mask (clear signal mask) counter value set in ref30 counter register (rfc) ref30 vd toggle mask field signal ref30p hsw drum phase counter sampling t sampling about 75% about 75% about 75% about 75% about 25% masking period masking period figure 28.10 generation of reference signal in reco rd mode (v dropped out) section 28 servo circuits rev.3.00 jan. 10, 2007 page 631 of 1038 rej09b0328-0300 sampling cleared cleared cleared dislocation of v value set in reference period register 1 (rfd) selected vd (od/ev = 0) counter mask (clear signal mask) counter value set in ref30 counter register (rfc) ref30 vd toggle mask field signal ref30p hsw drum phase counter sampling t sampling about 75% about 75% about 75% about 75% masking period masking period figure 28.11 generation of reference signal in reco rd mode (v dislocated) section 28 servo circuits rev.3.00 jan. 10, 2007 page 632 of 1038 rej09b0328-0300 cleared cleared reset value set in reference period register 1 (rfd) counter value set in ref30 counter register (rfc) external sync signal ref30 ref30p figure 28.12 generation of ref30 signal by external sync signal (4) cref signal generator the cref signal generator generates a cref signal which is the reference signal to control the phase of the capstan. to generate cref signals, set the half-period value to the reference period register 2 (crf). if the set value matches the counter value, a toggle waveform is generated corresponding to the 50% duty cycle, and a one-shot pulse signal is output at the rising edge of the waveform. the counter of the cref signal generator is initialized to h'0000 a nd the phase of the toggle is cleared to l level at the mode transition of pb (asm) to rec. the timing of clearing is selectable between immediately after the transition from pb (asm) to rec and the timing of dvcfg2 after the transition. use bit 3 (crd) of the reference period mode register (rfm) for the selection. in the capstan phase error detection circuit, either the ref30 signal or cref signal can be selected for the reference signal. use either of them according to the use of the system. use the cref signal to control the phase of the capstan at a period which is different from the period used to control the phase of the drum. as for the switching between ref30 and cref in the capstan phase control, see section 28.9.4 (3), capstan phase error detection control register (cpgcr). section 28 servo circuits rev.3.00 jan. 10, 2007 page 633 of 1038 rej09b0328-0300 (5) timing chart of the cref signal generation figures 28.13, 28.14, and 28.15 show the generation of the cref signal. cleared cleared cleared value set in reference period register 2 (crf) counter toggle signal cref figure 28.13 generation of cref signal section 28 servo circuits rev.3.00 jan. 10, 2007 page 634 of 1038 rej09b0328-0300 cleared cleared cleared value set in reference period register 2 (crf) counter time period when crf is set rec pb(asm) toggle signal rec/ pb cref figure 28.14 cref signal when pb is switched to rec (when crd bit = 0) section 28 servo circuits rev.3.00 jan. 10, 2007 page 635 of 1038 rej09b0328-0300 cleared cleared cleared value set in reference period register 2 (crf) counter time period when crf is set toggle signal rec/ pb cref dvcfg2 rec pb(asm) figure 28.15 cref signal when pb is switched to rec (when crd bit = 1) section 28 servo circuits rev.3.00 jan. 10, 2007 page 636 of 1038 rej09b0328-0300 figures 28.16 and 28.17 show ref30 (ref30p) when pb is switched to rec. cleared cleared cleared cleared cleared value set in reference period register 1 (rfd) selected vd * (od/ev = 0) note: * when in the field discrimination mode counter mask (clear signal mask) counter value set in ref30 counter register (rfc) ref30 vd (except in pb) rec(asm) pb toggle mask field signal rec/ pb ref30p about 75% masking period masking period figure 28.16 generation of the reference signal when pb is switched to rec (1) section 28 servo circuits rev.3.00 jan. 10, 2007 page 637 of 1038 rej09b0328-0300 value set in reference period register 1 (rfd) selected vd (od/ev = 0) counter mask (clear signal mask) counter value set in ref30 counter register (rfc) ref30 vd (except in pb) rec(asm) pb toggle mask field signal rec/ pb ref30p about 50% cleared cleared cleared cleared masking period masking period figure 28.17 generation of the reference signal when pb is switched to rec (2) section 28 servo circuits rev.3.00 jan. 10, 2007 page 638 of 1038 rej09b0328-0300 figures 28.18, 28.19, 28.20, and 28.21 show ref30 (ref30p) when pb is switched to rec (where fds bit = 1). cleared cleared cleared value set in reference period register 1 (rfd) fds bit = 1 counter mask (clear signal mask) counter value set in ref30 counter register (rfc) ref30 vd (except in pb) rec(asm) pb toggle mask rec/ pb ref30p masking period masking period figure 28.18 generation of the reference signal when pb is switched to rec where rfd bit is 1 (1) section 28 servo circuits rev.3.00 jan. 10, 2007 page 639 of 1038 rej09b0328-0300 value set in reference period register 1 (rfd) fds bit = 1 counter mask (clear signal mask) counter value set in ref30 counter register (rfc) ref30 vd (except in pb) rec(asm) pb toggle mask rec/ pb ref30p masking period masking period 25% 25% 25% figure 28.19 generation of the reference signal when pb is switched to rec where rfd bit is 1 (when vd signal is not detected) (2) section 28 servo circuits rev.3.00 jan. 10, 2007 page 640 of 1038 rej09b0328-0300 cleared cleared value set in reference period register 1 (rfd) fds bit = 1 counter mask (clear signal mask) counter value set in ref30 counter register (rfc) ref30 vd (except in pb) rec(asm) pb toggle mask rec/ pb ref30p masking period masking period max. 25% figure 28.20 generation of the reference signal when pb is switched to rec where rfd bit is 1 (3) section 28 servo circuits rev.3.00 jan. 10, 2007 page 641 of 1038 rej09b0328-0300 cleared cleared value set in reference period register 1 (rfd) fds bit = 1 counter mask (clear signal mask) counter value set in ref30 counter register (rfc) ref30 vd (except in pb) rec(asm) pb toggle mask rec/ pb ref30p masking period masking period max. 25% figure 28.21 generation of the reference signal when pb is switched to rec where rfd bit is 1 (4) section 28 servo circuits rev.3.00 jan. 10, 2007 page 642 of 1038 rej09b0328-0300 28.4 hsw (head-switch) timing generator 28.4.1 overview the hsw timing generator consists of one 5-bit counter and one 16-bit counter, matching circuit, and two 31-bit 10-stage fifos. the 5-bit counter counts the dfg pulses following a dpg pulse. each of them determines the timing to reset the 16-bit timer for each field. the matching circuit compares the timin g data in the most significant 16 bits of fifo with the 16-bit timer, and controls the output of pattern data set in the least significant 15 bits of fifo. the 16-bit timer is a timer clocked by a s/4 clock source, and can be used as a ppg (programmable pattern generator) as well as a free-running counter (frc). if used as a free-running counter, it is cleared by overflow (frcovf) of the prescaler unit. accordingly, two free-running counter operate in sync. 28.4.2 block diagram figure 28.22 shows a block diagram of the hsw timing generator. section 28 servo circuits rev.3.00 jan. 10, 2007 page 643 of 1038 rej09b0328-0300 r w w r/w r/w w r/w r/w strig irrhsw2 isel2 audioff videoff hsw nhsw mlevel vpulse adtrg irrhsw1 r vd pb w r/w r/w cleared cleared clk w r , ncdfg frcovf dpg cksl vff/nff internal bus w ? fpdra ? fpdrb ? ftpra ? ftprb w isel1 ofg fifo output pattern register 1 fifo output pattern register 2 sofg lop r/w r/w r r ww clra,b ovwa,b empa,b fla,b r/w r/w hsm2 ? hsm1 ? hslp edg hsw loop stage number setting register internal bus fgr20ff frt cclr edge detector control circuit fifo 1 (31 bits 10 stages) 15 bits p77 to 70 (ppg output) fifo timing pattern register 1 fifo timing pattern register 2 16 bits fifo2 (31 bits 10 stages) 15 bits 16 bits fifo output selector & output buffer 15 bits 16 bits ? dfcrb ? dfcra ? dfcra ? hsm2 ? hsm2 capture ? hsm2 ? dfcra ? dfcra dfg reference register 1 comparator (5 bits) comparator (5 bits) dfg reference register 2 ? dfctr counter (5 bits) compare circuit (16 bits) ftctr (16 bits) timer counter (16 bits) s/4 s/8 figure 28.22 composition of the hsw timing generator section 28 servo circuits rev.3.00 jan. 10, 2007 page 644 of 1038 rej09b0328-0300 28.4.3 composition the hsw timing generator is composed of the elements shown in table 28.5. table 28.5 composition of the hsw timing generator element function hsw mode register 1 (hsm1) confirmation/determination of this circuits' operating status hsw mode register 2 (hsm2) confirmation/determination of this circuits' operating status hsw loop stage number setting register (hslp) setting of number of loop stages in loop mode fifo output pattern register 1 (fpdra) output pattern data register of fifo1 fifo output pattern register 2 (fpdrb) output pattern data register of fifo2 fifo timing pattern register 1 (ftpra) output timing register of fifo1 fifo timing pattern register 2 (ftprb) output timing register of fifo2 dfg reference register 1 (dfcra) setting of reference dfg edge for fifo1 dfg reference register 2 (dfcrb) setting of reference dfg edge for fifo2 fifo timer capture register (ftctr) capture register of timer counter dfg reference count register (dfctr) dfg edge count fifo control circuit controls fifo status dfg count compare circuit ( 2) detection of match between dfcr and dfg counters 16-bit timer counter 16-bit free-run timer counter 31-bit x 20 stage fifo first in first out data buffer 31-bit fifo data buffer data storing buffer for the first stage of fifo 16-bit compare circuit detection of match between timer counter and fifo data buffer fpdra and fpdrb are intermediate buffers ; an ftpra and ftprb write results in simultaneous writing of all 31 bits to the fifo. the fifo has two 31-bit 10-stage data buffers, its operating status being controlled by hsm1 and hsm2. data is stored in the 31-bit data buffer. the values of ftpra, ftprb and the timer counter are compared, and if they match, the 15-bit pattern data is output to each function. audioff, videoff and ppg (p70 to p77) are pin outputs, adtrg is the a/d converter hardware start signal, vpulse and mlevel signals are the signals to generate the additional v pulses, and hsw and nhsw signals are the same with videoff signals used for the phase control of the drum. in free-run mode (when frt bit of hsm2 = 1), the 16-bit section 28 servo circuits rev.3.00 jan. 10, 2007 page 645 of 1038 rej09b0328-0300 timer counter is initialized when the prescaler unit overflows, or by a signal indicating a match between dfcra, dfcrb and the dfg counter in dfg reference mode. 28.4.4 register configuration table 28.6 shows the register configuration of the hsw timing generator. table 28.6 register configuration name abbrev. r/w size initial value address hsw mode register 1 hsm1 r/w byte h'30 h'fd060 hsw mode register 2 hsm2 r/w byte h'00 h'fd061 hsw loop stage number setting register hslp r/w byte undetermined h'fd062 fifo output pattern register 1 fpdra w word undetermined h'fd064 fifo timing pattern register 1 * ftpra w word undetermined h'fd066 fifo output pattern register 2 fpdrb w word undetermined h'fd068 fifo timing pattern register 2 ftprb w word undetermined h'fd06a dfg reference register 1 * dfcra w byte undetermined h'fd06c dfg reference register 2 dfcrb w byte undetermined h'fd06d fifo timer capture register * ftctr r word h'0000 h'fd066 dfg reference count register * dfctr r byte h'e0 h'fd06c note: * ftpra and ftctr, as well as dfcra and dfctr, are allocated to the same addresses. 28.4.5 register descriptions (1) hsw mode register 1 (hsm1) 0 0 1 0 r/w 2 0 r/(w) * 3 0 4 1 r 1 r 5 6 0 7 empa ovwb ovwa clrb clra 0 r flb r/w r/(w) * r fla empb bit : initial value : r/w : note: * only 0 can be written hsm1 is a register which confirms and determines the operational state of the hsw timing generator. hsm1 is an 8-bit register. bits 7 to 4 are read-only bits, and write is disabled. all the other bits accept both read and write. it is initialized to h'30 by a reset or stand-by. section 28 servo circuits rev.3.00 jan. 10, 2007 page 646 of 1038 rej09b0328-0300 bit 7 ? fifo2 full flag (flb): when the flb bit is 1, it indicates that the timing pattern data and the output pattern data of fifo2 are full. if a write is attempted in this state, the write operation becomes invalid, an interrupt is generated, the ovwb flag (bit 3) is set to 1, and the write data is lost. wait until space becomes available in the fifo2, then write again. bit 7 flb description 0 fifo2 is not full, and can accept data input (initial value) 1 fifo2 is full bit 6 ? fifo1 full flag (fla): when the fla bit is 1, it indicates that the timing pattern data and the output pattern data of fifo1 are full. if a write is attempted in this state, the write operation becomes invalid, an interrupt is generated, the ovwa flag (bit 2) is set to 1, and the write data is lost. wait until space becomes available in the fifo1, then write again. bit 6 fla description 0 fifo1 is not full, and can accept data input (initial value) 1 fifo1 is full bit 5 ? fifo2 empty flag (empb): indicates that fifo2 has no data, or that all the data has been output in single mode. bit 5 empb description 0 fifo2 contains data 1 fifo2 contains no data (initial value) bit 4 ? fifo1 empty flag (empa): indicates that fifo1 has no data, or that all the data has been output in single mode. bit 4 empa description 0 fifo1 contains data 1 fifo1 contains no data (initial value) section 28 servo circuits rev.3.00 jan. 10, 2007 page 647 of 1038 rej09b0328-0300 bit 3 ? fifo2 overwrite flag (ovwb): if a write is attempted when the timing pattern data and the output pattern data of fifo2 are full (flb bit = 1), the write operation becomes invalid, an interrupt is generated, the ovwb flag is set to 1, and the write data is lost. wait until space becomes available in the fifo2, then write again. write 0 to clear the ovwb flag, becau se it is not cleared automatically. bit 3 ovwb description 0 normal operation (initial value) 1 indicates that a write in fifo2 was attempted when fifo2 was full. clear this flag by 0 writing bit 2 ? fifo1 overwrite flag (ovwa): if a write is attempted when the timing pattern data and the output pattern data of fifo1 are full (fla bit = 1), the write operation becomes invalid, an interrupt is generated, the ovwa flag is set to 1, and the write data is lost. wait until space becomes available in the fifo1, then write again. write 0 to clear the ovwa flag, becau se it is not cleared automatically. bit 2 ovwa description 0 normal operation (initial value) 1 indicates that a write in fifo1 was attempted when fifo1 was full. clear this flag by 0 writing bit 1 ? fifo2 pointer clear (clrb): clears the fifo2 write position pointer. after 1 is written, the bit immediately reverts to 0. writing 0 in this bit has no effect. bit 1 clrb description 0 normal operation (initial value) 1 clears the fifo2 pointer section 28 servo circuits rev.3.00 jan. 10, 2007 page 648 of 1038 rej09b0328-0300 bit 0 ? fifo1 pointer clear (clra): clears the fifo1 write position pointer. after 1 is written, the bit immediately reverts to 0. writing 0 in this bit has no effect. bit 0 clra description 0 normal operation (initial value) 1 clears the fifo1 pointer (2) hsw mode register 2 (hsm2) 0 0 1 0 r 2 0 r/w 3 0 4 0 r/w 0 r/w 5 6 0 7 edg isel1 sofg ofg vff/nff 0 r/w frt w r/w r fgr20ff lop bit : initial value : r/w : hsm2 is a register which confirms and determines the operational state of the hsw timing generator. hsm2 is an 8-bit register. bits 6 and 1 are read-only bits, and write is disabled. bit 0 is a write- only bit, and if a read is attempted, an undeterm ined value is read out. all the other bits accept both read and write. it is initialized to h'00 by a reset or stand-by. bit 7 ? free-run bit (frt): selects whether timing is matched to the dpg counter and timer, or to free-running counter. bit 7 frt description 0 5-bit dfg counter + 16-bit timer counter (initial value) 1 16-bit frc bit 6 ? frg2 clear stop bit (fgr2off): nullifies the clearing of the counter by the dfg reference register 2. the fifo group, including both fifo1 and fifo2, is available. bit 6 fgr2off description 0 validates the clearing of the 16-bit timer counter by dfg reference register 2 (initial value) 1 nullifies the clearing of the 16-bit timer counter by dfg reference register 2 section 28 servo circuits rev.3.00 jan. 10, 2007 page 649 of 1038 rej09b0328-0300 bit 5 ? mode selection bit (lop): selects the output mode of fifo. if the loop mode is selected, lob3 to lob0 bits and loa3 to loa0 bits become valid. if the lop bit is rewritten, the pointer which counts the writing position of fifo is cleared. in this case, the ultimate output date is kept. bit 5 lop description 0 single mode (initial value) 1 loop mode bit 4 ? dfg edge selection bit (edg): selects the edge by which to count dfg. bit 4 edg description 0 counts by the rising edge of dfg (initial value) 1 counts by the falling edge of dfg bit 3 ? interrupt selection bit (isel1): selects the factor whic h causes an interrupt. (irrhsw1) bit 3 isel1 description 0 generates an interrupt request by the rising edge of the strig signal of fifo (initial value) 1 generates an interrupt request by the matching signal of fifo section 28 servo circuits rev.3.00 jan. 10, 2007 page 650 of 1038 rej09b0328-0300 bit 2 ? fifo output group selection bit (sofg): selects whether 20 stages of fifo1 + fifo2 or only 10 stages of fifo1 are used. if 20-stage output mode is used in single mode, data write in fifo1 and fifo2 is required. monitor the output fifo group flag (ofg) and control it by software. output all the data of fifo2 after all the data of fifo1 was output. repeat this step again. if 10-stage output mode is used, the data of fifo2 is not reflected. rewriting the sofg bit 0 1 0 initializes the control signal of the fifo output stage to the fifo1 side. bit 2 sofg description 0 20-stage output of fifo1 + fifo2 (initial value) 1 10-stage output of fifo1 only bit 1 ? output fifo group flag (ofg): indicates the fifo group which is outputting. bit 1 ofg description 0 pattern is being output by fifo1 (initial value) 1 pattern is being output by fifo2 bit 0 ? output switching bit between videoff and narrowff (vff/nff): switches the signal output to the videoff pin. bit 0 vff/nff description 0 videoff output (initial value) 1 narrowff output section 28 servo circuits rev.3.00 jan. 10, 2007 page 651 of 1038 rej09b0328-0300 (3) hsw loop stage number setting register (hslp) 0 * 1 * r/w 2 * r/w 3 * 4 * r/w 5 * 6 * 7 r/w r/w r/w lob1 r/w lob2 * r/w lob3 lob0 loa3 loa2 loa1 loa0 bit : initial value : r/w : note: * undetermined hslp sets the number of the loop stages when the hsw timing generator is in loop mode. it is valid if bit 5 (lop) of hsm2 is 1. bits 7 to 4 set the number of fifo2 stages. bits 3 to 0 set the number of fifo1 stages. hslp is an 8-bit read/write register. it is not initialized by a reset, stand-by or module stop, accordingly be sure to set the number of the stages when the loop mode is used. section 28 servo circuits rev.3.00 jan. 10, 2007 page 652 of 1038 rej09b0328-0300 bits 7 to 4 ? fifo2 stage number setting bits (lob3 to lob0): set the number of fifo2?s stages in loop mode. they are valid only if the loop mode is set (lop bit of hsm2 is 1). hsm2 hslp bit 5 bit 7 bit 6 bit 5 bit 4 lop lob3 lob2 lob1 lob0 description 0 * * * * single mode (initial value) 0 only 0th stage of fifo2 is output 0 1 0th and 1st stages of fifo2 are output 0 0th to 2nd stages of fifo2 are output 0 1 1 0th to 3rd stages of fifo2 are output 0 0th to 4th stages of fifo2 are output 0 1 0th to 5th stages of fifo2 are output 0 0th to 6th stages of fifo2 are output 0 1 1 1 0th to 7th stages of fifo2 are output 0 0th to 8th stages of fifo2 are output 1 1 0 0 1 0th to 9th stages of fifo2 are output 0 1 1 0 0 1 0 1 1 1 setting prohibited legend: * don't care. section 28 servo circuits rev.3.00 jan. 10, 2007 page 653 of 1038 rej09b0328-0300 bits 3 to 0 ? fifo1 stage number setting bits (loa3 to loa0): set the number of fifo1?s stages in loop mode. they are valid only if the loop mode is set (lop bit of hsm2 is 1). hsm2 hslp bit 5 bit 3 bit 2 bit 1 bit 0 lop loa3 loa2 loa1 loa0 description 0 * * * * single mode (initial value) 0 only 0th stage of fifo1 is output 0 1 0th and 1st stages of fifo1 are output 0 0th to 2nd stages of fifo1 are output 0 1 1 0th to 3rd stages of fifo1 are output 0 0th to 4th stages of fifo1 are output 0 1 0th to 5th stages of fifo1 are output 0 0th to 6th stages of fifo1 are output 0 1 1 1 0th to 7th stages of fifo1 are output 0 0th to 8th stages of fifo1 are output 1 1 0 0 1 0th to 9th stages of fifo1 are output 0 1 1 0 0 1 0 1 1 1 setting prohibited legend: * don't care. section 28 servo circuits rev.3.00 jan. 10, 2007 page 654 of 1038 rej09b0328-0300 (4) fifo output pattern register 1 (fpdra) 8 * 9 * w 10 * w 11 * 12 * w * w 13 14 * 15 ? ? narrowffa vffa affa vpulsea mlevela 1 w w w adtrga striga 0 * 1 * w 2 * w 3 * 4 * w * w 5 6 * 7 ppga4 ppga3 ppga2 ppga1 ppga0 * w ppga7 w w w ppga6 ppga5 bit : initial value : r/w : bit : initial value : r/w : note: * undetermined fpdra is a buffer register for the output pattern register of fifo1. when the timing pattern is written in ftpra the output pattern data written in fpdra is written at the same time to the position pointed by the buffer pointer of fifo1. be sure to write the output pattern data in fpdra before writing it in ftpra. fpdra is a 16-bit write-only register. only a wo rd access is valid. if a byte access is attempted, resulting operation is not assured. no read is valid. if a read is attempted, an undetermined value is read out. it is not initialized by a reset, stand-by or module stop, accordingly be sure to write data before use. bit 15 ? reserved: it cannot be written in or read out. bit 14 ? a/d trigger a bit (adtrga): a signal for starting the a/d converter hardware. bit 13 ? s-triga bit (striga): a signal for generating an interrupt by pattern data. when striga is selected by isel, pattern data changes from 0 to 1, and thus generates an interrupt. bit 12 ? narrowffa bit (narrowffa): controls the narrow video head. bit 11 ? videoffa bit (vffa): controls the video head. bit 10 ? audioffa bit (affa): controls the audio head. bit 9 ? vpulsea bit (vpulsea): used for generating an additional v signal. see section 28.12, additional v signal generator, for more information. bit 8 ? mlevela bit (mlevela): used for generating an additional v signal. see section 28.12, additional v signal generator, for more information. bits 7 to 0 ? ppg output signal a bits (ppga7 to ppga0): used for timing control output of port 7 (ppg). section 28 servo circuits rev.3.00 jan. 10, 2007 page 655 of 1038 rej09b0328-0300 (5) fifo output pattern register 2 (fpdrb) 8 * 9 * w 10 * w 11 * 12 * w * w 13 14 * 15 ? ? narrowffb vffb affb vpulseb mlevelb 1 w w w adtrgb strigb 0 * 1 * w 2 * w 3 * 4 * w * w 5 6 * 7 ppgb4 ppgb3 ppgb2 ppgb1 ppgb0 * w ppgb7 w w w ppgb6 ppgb5 bit : initial value : r/w : bit : initial value : r/w : note: * undetermined fpdrb is a buffer register for the output pattern register of fifo2. when the timing pattern is written in ftprb the output pattern data written in fpdrb is written at the same time to the position pointed by the buffer pointer of fifo2. be sure to write the output pattern data in fpdrb before writing it in ftprb. fpdrb is a 16-bit write-only register. only a wo rd access is valid. if a byte access is attempted, resulting operation is not assured. no read is valid. if a read is attempted, an undetermined value is read out. it is not initialized by a reset, stand-by or module stop, accordingly be sure to write data before use. bit 15 ? reserved: it cannot be written in or read out. bit 14 ? a/d trigger b bit (adtrgb): a signal for starting the a/d converter hardware. bit 13 ? s-trigb bit (strigb): a signal for generating an interrupt by pattern data. when strigb is selected by isel, pattern data changes from 0 to 1, and thus generates an interrupt. bit 12 ? narrowffb bit (narrowffb): controls the narrow video head. bit 11 ? videoffb bit (vffb): controls the video head. bit 10 ? audioffb bit (affb): controls the audio head. bit 9 ? vpulseb bit (vpulseb): used for generating an additional v signal. see section 28.12, additional v signal generator, for more information. bit 8 ? mlevelb bit (mlevelb): used for generating an additional v signal. see section 28.12, additional v signal generator, for more information. bits 7 to 0 ? ppg output signal b bits (ppgb7 to ppgb0): used for timing control output of port 7 (ppg). section 28 servo circuits rev.3.00 jan. 10, 2007 page 656 of 1038 rej09b0328-0300 (6) fifo timing pattern register 1 (ftpra) * w 13 * w 14 * w 15 ftpra15 ftpra14 ftpra13 ftpra12 ftpra11 ftpra10 ftpra9 ftpra8 ftpra7 ftpra6 ftpra5 ftpra4 ftpra3 ftpra2 ftpra1 ftpra0 10 32 54 7 * w 6 * w 9 * w 8 * w 11 * w 10 * w * www ww ww 12 * * * * * * bit : initial value : r/w : note: * undetermined ftpra is a register to write the timing pattern data of fifo1. the timing data written in ftpra is written at the same time to the position pointed by the buffer pointer of fifo1 together with the buffer data of fpdra. ftpra is a 16-bit write-only regi ster. only a word access is valid . if a byte access is attempted, resulting operation is not assured. it is not in itialized by a reset, stand-by or module stop, accordingly be sure to write data before use. note: its address is shared with the fifo timer capture register (ftctr). accordingly, the value of ftctr is read out if a read is attempted. (7) fifo timing pattern register 2 (ftprb) * w 13 * w 14 * w 15 10 32 54 7 * w 6 * w 9 * w 8 * w 11 * w 10 * w * www ww ww 12 * * * * * * bit : initial value : r/w : ftprb15 ftprb14 ftprb13 ftprb12 ftprb11 ftprb10 ftprb9 ftprb8 ftprb7 ftprb6 ftprb5 ftprb4 ftprb3 ftprb2 ftprb1 ftprb0 note: * undetermined ftprb is a register to write the timing pattern data of fifo2. the timing data written in ftprb is written at the same time to the position pointed by the buffer pointer of fifo2 together with the buffer data of fpdrb. ftprb is a 16-bit write-only regi ster. only a word access is valid . if a byte access is attempted, resulting operation is not assured. it is not in itialized by a reset, stand-by or module stop, accordingly be sure to write data before use. section 28 servo circuits rev.3.00 jan. 10, 2007 page 657 of 1038 rej09b0328-0300 (8) dfg reference register 1 (dfcra) 0 * 1 * w 2 * w 3 * 4 * w 0 w 5 6 0 7 dfcra4 dfcra3 dfcra2 dfcra1 dfcra0 0 w isel2 w w w cclr cksl bit : initial value : r/w : note: * undetermined dfcra is a register which determines the operation of the hsw timing generator as well as the starting point of the timing of fifo1. dfcra is an 8-bit write-only register. it is not initialized by a reset, stand-by or module stop, accordingly be sure to write data before use. note: its address is shared with the dfg refere nce counter register (dfctr). accordingly, the value of dfctr is read out in the low-order five bits if a read is attempted. bit 7 ? interrupt selection bit (isel2): selects the factor whic h causes an interrupt. (irrhsw2) bit 7 isel2 description 0 generates an interrupt request by the clear signal of the 16-bit timer counter (initial value) 1 generates an interrupt request by the vd signal in pb mode bit 6 ? dfg counter clear bit (cclr): enforces clearing of the 5-bit counter which counts dfg by software. writing 1 returns 0 immediately. writing 0 causes no effect on operation. bit 6 cclr description 0 normal operation (initial value) 1 clears the 5-bit dfg counter bit 5 ? 16-bit timer counter clock source selection bit (cksl): selects the clock source of the 16-bit timer counter. bit 5 cksl description 0 s/4 (initial value) 1 s/8 section 28 servo circuits rev.3.00 jan. 10, 2007 page 658 of 1038 rej09b0328-0300 bits 4 to 0 ? fifo1 output timing setting bits (dfcra4 to dfcra0): determine the starting point of the timing of fifo1. the initial value is undetermined. be sure to set a value after a reset or stand-by. it is valid only if bit 7 (frt bit) of hsm2 is 0. (9) dfg reference register 2 (dfcrb) 0 * 1 * w 2 * w 3 * 4 * w 5 6 1 7 ? ? ? ? ? ? dfcrb4 dfcrb3 dfcrb2 dfcrb1 dfcrb0 w w 11 bit : initial value : r/w : note: * undetermined dfcrb is a register which determines the starting point of the timing of fifo2. dfcrb is an 8-bit write-only register. if a read is attempted, an undetermined value is read out. bits 7 to 5 are reserved. no write is valid. if a read is attempted, 1 is read out. it is not initialized by a reset or stand-by, accordingly be sure to write data before use. bits 4 to 0 ? fifo2 output timing setting bits (dfcrb4 to dfcrb0): determine the starting of the fifo2 output. the initial values are undetermined, accordingly be sure to write values in the bits after a reset or stand-by. it is valid only if bit 7 (frt bit) of hsm2 is 0. (10) fifo timer capture register (ftctr) 0 r 13 0 r 14 0 r 15 10 32 54 7 0 r 6 0 r 9 0 r 8 0 r 11 0 r 10 0 r 0 rrr rr rr 12 0 0 0 0 0 0 bit : initial value : r/w : ftctr15 ftctr14 ftctr13 ftctr12 ftctr11 ftctr10 ftctr9 ftctr8 ftctr7 ftctr6 ftctr5 ftctr4 ftctr3 ftctr2 ftctr1 ftctr0 ftctr is a register to display the count of the 16-bit timer counter. ftctr is a 16-bit read-only register. it stores the counter value if a vd signal was detected in pb mode. only a word access is accepted. if a byte access is attempted, resulting operation is not assured. it is initialized to h'0000 by a reset or stand-by. note: its address is shared with the fifo timing pattern register 1 (ftpra). accordingly, if a write is attempted, the value is written in ftpra. section 28 servo circuits rev.3.00 jan. 10, 2007 page 659 of 1038 rej09b0328-0300 (11) dfg reference count register (dfctr) 0 0 1 0 r 2 0 r 3 0 4 0 r 5 6 1 7 ? ? ? ? ? ? dfctr4 dfctr3 dfctr2 dfctr1 dfctr0 r r 11 bit : initial value : r/w : dfctr is a register to count the dfg pulses. dfctr is an 8-bit read-only register. bits 7 to 5 are reserved. if a read is attempted, 1 is read out. it is initialized to h'e0 by a reset or stand-by. note: its address is shared with the dfg referen ce register 1 (dfcra). accordingly, if a write is attempted, the value is written in dfcra. bits 4 to 0 ? dfg pulse count bits (dfctr4 to dfctr0): count the number of pulses of dfg. section 28 servo circuits rev.3.00 jan. 10, 2007 page 660 of 1038 rej09b0328-0300 28.4.6 description of operation 1. 5-bit dfg counter the 5-bit dfg counter takes counts by the edges of dfg selected by the edg bit of hsw mode register 2. the 5-bit dfg counter is clear ed by the dpg's rise or when 1 was written in the cclr bit of dfg reference register 1. 2. 16-bit timer counter dfg reference mode or free-run mode can be selected for the 16-bit timer counter. ? dfg reference mode dfg reference mode is based on the dfg signa l. when the dfg reference registers 1 and 2 and the 5-bit dfg counter value match, the 16-bit timer counter is initialized, and that point becomes the starting of the fifo output. in dfg reference mode, the fgr2off bit of the hsw mode register 2 can be used to select between using only the dfg reference register 1 to set the starting of the fifo output or using both dfg reference registers 1 and 2 to set the starting of the fifo1 and fifo2 outputs, respectively. when using only the dfg reference register 1 to set the starting, continuous values should be set as the timing patterns for fifo1 and fifo2. ? free-run mode free-run mode is to operate together with th e prescaler unit. an overflow of the 18-bit free- running counter in the prescaler unit initializes the 16-bit timer coun ter, and that point becomes the starting of the fifo output. 3. matching circuit the matching circuit compares the timing pattern value of fifo with the 16-bit timer counter value, and if they match, it generates a trigger signal to output the pattern data for the fifo?s next stage. 4. fifo fifo generates the head-switching signal used in the vcr and the pattern data necessary for servo control. data is set in fifo by the fifo timing pattern registers 1 and 2 and the fifo output pattern registers 1 and 2. fifo has two modes, i.e. single mode and loop mode. in either mode, output of 20 stages of fifo1 + fifo2 or output of only 10 stages of fifo1 can be selected. ? single mode in single mode, the output pattern data is output each time the timing data matches. the data, once output, is lost, and the internal pointer is decremented by 1. when the last data was output, it stops operation until data is written again. when it is used in the 20-stage output mode, writing in fifo1 and fifo2 has to be controlled by software. section 28 servo circuits rev.3.00 jan. 10, 2007 page 661 of 1038 rej09b0328-0300 ? loop mode in loop mode, the output pattern cycles rep eatedly from stage 0 through the final stage selected in the hsw loop numbe r setting register. as in single mode, the output pattern data is output each time the timing data matches. in loop mode, the fifo data is retained. when loop mode is active, data can be rewritten for each fifo group. after confirming with the ofg bit of the hsw mode register 2 which fifo group is outputting, clear the fifo group which is not outputting and write data for the entire fifo group. writing has to be completed before the rewritten fifo group starts operation. partial rewriting in the fifo is not possible, because the write pointer is outside the loop stages. figures 28.23 and 28.24 show examples of the timing waveform and its operation of the hsw timing generator. section 28 servo circuits rev.3.00 jan. 10, 2007 page 662 of 1038 rej09b0328-0300 dpg 01 ta1 ta2 tb1 ta3 ta1 234567891011 012 v.ff a.ff clear a clear b example of setting: dfcra=h'02, dfcrb=h'08, hslp=h'21, dfg falling edge dfg figure 28.23 example of timing waveform of hsw (when dfg is 12 shots) section 28 servo circuits rev.3.00 jan. 10, 2007 page 663 of 1038 rej09b0328-0300 output pattern data s/4 w w ftprb fifo2 tb0 pb9 tb5 pb4 tb4 pb3 tb3 pb2 tb2 pb1 tb1 pb0 w w fpdra output select buffer output select buffer comparator ftpra fifo1 ta0 pa9 ta5 pa4 ta4 pa3 ta3 pa2 ta2 pa1 ta1 pa0 internal bus fpdrb timer counter figure 28.24 example of operati on of the hsw timing generator section 28 servo circuits rev.3.00 jan. 10, 2007 page 664 of 1038 rej09b0328-0300 (1) example of operation in single mode (20 stages of fifo used) (a) set to single mode (lop = 0) (b) write the output pattern data (pa0) to fpdra. (c) write the output timing (t a1 ) to ftpra. t a1 is written in fifo1 together with pa0. this initializes the output pattern data to pa0. (d) repeat the steps in the same way, until pa1, pa2, etc., are set. (e) write the output pattern data (pb0) to fpdrb. (f) write the output timing (t b1 ) to ftprb. t b1 is written in fifo2 together with pb0. this initializes the output pattern data to pb0. (g) repeat these steps in the same way, until pb1, pb2, etc., are set. from (c), the pattern data of pa0 is output. if t a1 matches with the timer counter, the pattern data of pa1 is output. if t a2 matches with the timer counter, the pattern data of pa2 is output. . . . section 28 servo circuits rev.3.00 jan. 10, 2007 page 665 of 1038 rej09b0328-0300 after this sequence is repeated and all the pattern data set in fifo1 is output, the pattern data of fifo2 is output. after the pattern data is output, the pointer is decremented by 1. care is required, however, because matching of t a0 is not detected until data is written in fifo2. matching of t b0 also is not detected until data is written in fifo1 again. (2) example of operation in loop mode (a) set the number of loop stages in the hslp register (e.g. hslp = h'44) (b) write the output pattern data (pa0) to fpdra. (c) write the output timing (t a1 ) to ftpra. t a1 is written in fifo1 together with pa0. this initializes the output pattern data to pa0. (d) repeat the steps in the same way, until pa1, pa2, etc., are set. (e) write the output pattern data (pb0) to fpdrb. (f) write the output timing (t b1 ) to ftprb. t b1 is written in fifo2 together with pb0. this initializes the output pattern data to pb0. (g) repeat the steps in the same way, until pb1, pb2, etc., are set. from (c), the pattern data pa0 is output. if t a1 matches the timer counter, the pattern data pa1 is output. if t a2 matches the timer counter, the pattern data pa2 is output. . . . if t a4 matches the timer counter, the pattern data pa4 is output. if t a5 matches the timer counter, the pattern data pb0 is output. if t b1 matches the timer counter, the pattern data pb1 is output. . . . if t b4 matches the timer counter, the pattern data pb4 is output. if t b5 matches the timer counter, the pattern data pa0 is output. . . . section 28 servo circuits rev.3.00 jan. 10, 2007 page 666 of 1038 rej09b0328-0300 28.4.7 interrupt the hsw timing generator generates an interrupt under the following conditions. (1) irrhsw1 occurred when pattern data was written (ovwa, ovwb = 1) and fifo was full (full). (2) irrhsw1 occurred when matching was detected and the strig bit of fifo was 1. (3) irrhsw1 occurred when the values of the 16-bit timer counter and 16-bit timing pattern register matched. (4) irrhsw2 occurred when the 16-bit timer counter was cleared. (5) irrhsw2 occurred when a vd signal (captu re signal of the timer capture register) was received in pb mode. (2) and (3), as well as (4) and (5), are switched over by isel1 and isel2. section 28 servo circuits rev.3.00 jan. 10, 2007 page 667 of 1038 rej09b0328-0300 28.4.8 cautions (1) when both the 5-bit dfg counter and 16-bit timer counter are operating, the latter is not cleared if input of dpg and dfg signals is stopped. this leads to free-running of the 16-bit timer counter, and periodical detection of matching by the 16-bit timer counter. in such a case, the period of the output from the hsw timing generator is independent from dpg or dfg. (2) specify the mode setting bit (lop) of the hsw mode register 2 (hsm2) immediately before writing the fifo data. (3) input the rising edge of dpg and dfg count edge at different timings. if the same timing was input, counting up of dfg and clearing of the 5-bit dfg counter occurs simultaneously. in this case, the latter will take pr ecedence. this leads to the 5-bit dfg counter's lag by 1. figure 28.25 shows the input timing of dpg and dfg. (4) if stop of the drum system is required when fifo output is being used in the 20-stage output mode, rewrite the sofg bit of hsm2 register 0 1 0 by software, and initialize the fifo output stage to the fifo1 side without fail. also clear and rewrite the data of fifo1 and fifo2. dpg i t p fg i > (1 state) t p fg dfg note: when the dfg counter takes count at the rising edges of dfg figure 28.25 input timing of dpg and dfg section 28 servo circuits rev.3.00 jan. 10, 2007 page 668 of 1038 rej09b0328-0300 28.5 four-head high-speed switchin g circuit for sp ecial playback 28.5.1 overview this four-head high-speed switching circuit generates a color rotary signal (c.rotary) and head- amplifier switching signal (h.amp sw) for use in four-head special playback. a pre-amplifier output comparison result signal is input from the comp pin. the signal output at the c.rotary pin is a chroma signal processing control signal. the signal output at the h.amp sw pin is a pre-amplifier output select signal. to reduce the width of noise bars, the c.rotary and h.amp sw signals are synchronized to the horizontal sync signal (osch). osch is made by adding supplemented h, which has been separated from the csync signal in the sync signal detector circuit. for more details of osch, see section 28.15, sync signal detector. if the c.rotary, h.amp sw or comp pin does not require this circuit to configure a vcr system, it can be used as an i/o port. 28.5.2 block diagram figure 28.26 shows the block diagram of this circuit. section 28 servo circuits rev.3.00 jan. 10, 2007 page 669 of 1038 rej09b0328-0300 w w synchronization control chcr w chcr rtp0 h.amp sw c.rotary osch (synchronization) comp narrow.ff video.ff w chcr internal bus internal bus hah crh w chcr sig3 to 0 hswpol v/n decoding circuit figure 28.26 four-head high-speed switching circuit fo r special playback 28.5.3 pin configuration table 28.7 summarizes the pin configuration of the high-speed switching circuit used in four-head special playback. they can also be used as i/o ports when not in use. see section 28.2, servo port. table 28.7 pin configuration name abbrev. i/o function compare input pin comp input input of pre-amplifier output result signal color rotary signal output pin c.rotary output output of chroma processing control signal head-amplifier switching pin h.amp sw output output of pre-amplifier output select signal section 28 servo circuits rev.3.00 jan. 10, 2007 page 670 of 1038 rej09b0328-0300 28.5.4 register description (1) register configuration table 28.8 shows the register configuration of the high-speed switching circuit used in four-head special playback. table 28.8 register configuration name abbrev. r/w size initial value address special playback control register chcr w byte h'00 h'fd06e (2) special playback control register (chcr) 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 6 0 7 hah sig3 sig2 sig1 sig0 0 w v/n w w w hswpol crh bit : initial value : r/w : the special playback control register (chcr) is an 8-bit write-only register. it cannot be read. if a read is attempted, an undetermined value is read out. it is initialized to h'00 by a reset, stand-by or module stop. bit 7 ? hsw signal selection bit (v/n): selects the hsw signal to be used at special playback. bit 7 v/n description 0 video ff signal output (initial value) 1 narrow ff signal output bit 6 ? comp polarity selection bit (hswpol): selects the polarity of the comp signal. bit 6 hswpol description 0 positive (initial value) 1 negative section 28 servo circuits rev.3.00 jan. 10, 2007 page 671 of 1038 rej09b0328-0300 bit 5 ? c.rotary synchronization control bit (crh): synchronizes the c.rotary signal with the osch signal. bit 5 crh description 0 synchronous (initial value) 1 asynchronous bit 4 ? h.amp sw synchronization control bit (hah): synchronizes the h.amp sw signal with the osch signal. bit 4 hah description 0 synchronous (initial value) 1 asynchronous bits 3 to 0 ? signal control bits (sig3 to sig0): these bits, combined w ith the state of the comp input pin, control the outputs at the c.rotary and h.amp sw pins. bit 3 bit 2 bit 1 bit 0 output pins sig3 sig2 sig1 sig0 c.rotary h.amp sw 0 * * l l (initial value) 0 hsw l 0 1 hsw h 0 l hsw 0 1 1 1 h hsw 0 hsw ex-or comp comp 0 1 hsw ex-nor comp comp 0 hsw e-or rtp0 rtp0 1 1 1 * hsw ex-nor rtp0 rtp0 legend: * don't care. section 28 servo circuits rev.3.00 jan. 10, 2007 page 672 of 1038 rej09b0328-0300 28.6 drum speed error detector 28.6.1 overview drum speed error control operates so as to hold the drum at a constant revolution speed by measuring the period of the dfg signal. a digital counter detects the speed deviation from a preset value. the speed error data is processed and added to phase error data in a digital filter. this filter controls a pulse-width m odulated (pwm) output, which controls the revolution speed and phase of the drum. the dfg input signal is reshaped into a square wave by a reshaping circuit, and sent to the speed error detector as the dfg signal. the speed error detector uses the system cloc k to measure the period of the dfg signal, and detects the deviation from a preset data value. the preset data is the value that would result from measuring the dfg signal period with the clock signal if the drum motor was running at the correct speed. the error detector operates by latching a counter value when it detects an edge of the dfg signal. the latched count provides 16 bits of speed error data for the digital filter to operate on. the digital filter processes and adds the speed error data to phase error data from the drum phase control system, then sends the result to the pulse-width modulator as drum error data. 28.6.2 block diagram figure 28.27 shows a block diagram of the drum speed error detector. section 28 servo circuits rev.3.00 jan. 10, 2007 page 673 of 1038 rej09b0328-0300 w w r udf ovf rock 2 up clear latch preset dfvcr dfrlor dfvcr dfpr dfvcr dfvcr dfvcr dfucr fgcr dfer dfrvcr error data (16 bits) to dfu addfgn ncdfg dfrudr internal bus w r/w internal bus r/w w r/w r/w r/w r/w (r)/w rock 1 up s r f/f q s r f/f dfrcs1, 0 df-r/unr lock counter (2 bits) q s r f/f q lock range detector lock range data 1 (16 bits) dpcnt error data limitter control circuit dfefon dfess drf edge detector , error data (16 bits) counter (16 bits) dfovf irrdrm2 irrdrm1 to drockon dfu preset data (16 bits) lock range data 2 (16 bits) dfcs1, 0 s s/2 s/4 s/8 figure 28.27 block diagram of the drum speed error detector section 28 servo circuits rev.3.00 jan. 10, 2007 page 674 of 1038 rej09b0328-0300 28.6.3 register configuration table 28.9 shows the register configuration of the drum speed error detector. table 28.9 register configuration name abbrev. r/w size initial value address specified dfg speed preset data register dfpr w word h'0000 h'fd030 dfg speed error data register dfer r/w word h'0000 h'fd032 dfg lock upper data register dfrudr w word h'7fff h'fd034 dfg lock lower data register dfrldr w word h'8000 h'fd036 drum speed error detection control register dfvcr r/w byte h'00 h'fd038 section 28 servo circuits rev.3.00 jan. 10, 2007 page 675 of 1038 rej09b0328-0300 28.6.4 register descriptions (1) specified dfg speed p reset data register (dfpr) 0 w 13 0 w 14 0 w 15 10 32 54 7 0 w 6 0 w 9 0 w 8 0 w 11 0 w 10 0 w 0 www ww ww 12 0 0 0 0 0 0 bit : initial value : r/w : the specified dfg speed preset data is set in dfpr. when the data is written, a 16-bit preset data is sent to the preset circuit. the preset data is referenced to h'8000*, and can be calculated from the following equation. s/n specified dfg speed preset data = h'8000 ? ( ? 2) dfg frequency s: servo clock frequency (fosc/2) in hz dfg frequency: in hz the constant 2 is the presetting interval (see figure 28.28). s/n clock source of selected counter dfpr is a 16-bit write-only register, and is accessible by word access only. byte access gives unassured results. reads are disabled. dfpr is initialized to h'0000 by a reset, and in standby mode and module stop mode. note: * the preset data value is calculated so that the counter will reach h'8000 when the error is zero. when the counter value is latched as error data in the dfg speed error data register (dfer), however, it is converted to a value referenced to h'0000. section 28 servo circuits rev.3.00 jan. 10, 2007 page 676 of 1038 rej09b0328-0300 (2) dfg speed error data register (dfer) 0 r * /w 13 0 r * /w 14 0 r * /w 15 10 32 54 7 0 r * /w 6 0 r * /w 9 0 r * /w 8 0 r * /w 11 0 r * w 10 0 r * /w 0 r * /w r * /w r * /w r * /w r * /w r * /w r * /w 12 0 0 0 0 0 0 bit : initial value : r/w : note: * note that only detected error data can be read. dfer is a register that stores 16-bit dfg speed error data. when the drum motor speed is correct, the data latched in dfer is h'0000. negative data will be latched if the speed is too fast, and positive data if the speed is too slow. the dfer value is sent to the digital filter either automatically or by software. dfer is a 16-bit readable/writable register. dfer is accessible by word access only. byte access gives unassured results. dfer is initialized to h' 0000 by a reset, and in standby mode and module stop mode. refer to the note in 28.6.4 (1), specified dfg speed preset data register (dfpr). (3) dfg lock upper data register (dfrudr) 1 w 13 1 w 14 0 w 15 10 32 54 7 1 w 6 1 w 9 1 w 8 1 w 11 1 w 10 1 w 1 www ww ww 12 1 1 1 1 1 1 bit : initial value : r/w : dfrudr is a register used to set the lock range on the upper side when drum speed lock is detected, and to set the limit value on the upper side when the limiter function is in use. set a signed data to dfrudr (bit 15 is a sign-setting bit). when lock is being detected, if the drum speed is detected within the lock range, the lock counter which has been set by dfrcs 1 and 0 bits of the dfvcr register counts down. if the set value of dfrcs 1 and 0 matches the number of times of occurrence of locking, the computation of the digital filter in the drum phase system can be controlled automatically. also, if the dfg speed error data is beyond the dfrudr value while th e limiter function is in use, the dfrudr value can be used as the data for computation by the digital filter. dfrudr is a 16-bit write-only register. only a word access is valid. if a byte access is attempted, operation is not assured. no read is valid. if a read is attempted, an undetermined value is read out. it is initialized to h'7fff by a reset, stand-by or module-stop. section 28 servo circuits rev.3.00 jan. 10, 2007 page 677 of 1038 rej09b0328-0300 (4) dfg lock lower data register (dfrldr) 0 w 13 0 w 14 1 w 15 10 32 54 7 0 w 6 0 w 9 0 w 8 0 w 11 0 w 10 0 w 0 www ww ww 12 0 0 0 0 0 0 bit : initial value : r/w : dfrldr is a register used to set the lock range on the lower side when drum speed lock is detected, and to set the limit value on lower side when the limiter function is in use. set a signed data to dfrldr (bit 15 is a sign-setting bit). when lock is being detected, if the drum speed is detected within the lock range, the lock counter which has been set by the dfrcs1 and dfrcs0 bits of the dfvcr register counts down. if the set value of dfrcs1 and dfrcs0 matches the number of times of occurrence of locking, the computation of the digital filter in the drum phase system can be controlled automatically. also, if the dfg speed error data is under the dfrldr value when the limiter function is in use, the dfrldr value can be used as the data for computation by the digital filter. dfrldr is a 16-bit write-only register. only a word access is valid. if a byte access is attempted, operation is not assured. no read is valid. if a read is attempted, an undetermined value is read out. it is initialized to h'8000 by a reset, stand-by or module-stop. (5) drum speed error det ection control register (dfvcr) 0 0 1 0 (r) * 2 /w 2 0 r/w 3 0 4 0 r/w 0 r/(w) * 1 5 6 0 7 dfrfon df-r/unr dpcnt dfrcs1 dfrcs0 0 r/w dfcs1 (r) * 2 /w r r/w dfcs0 dfovf notes: bit : initial value : r/w : 1. only 0 can be written. 2. if read-accessed, the counter value is read out. dfvcr controls the operation of drum speed error detection. dfvcr is an 8-bit readab le/writable register. bit 3 accepts only read, and bit 5 accepts only read and 0 write. it is initialized to h'00 by a reset, stand-by or module-stop. section 28 servo circuits rev.3.00 jan. 10, 2007 page 678 of 1038 rej09b0328-0300 bits 7 and 6 ? clock source selection bits (dfcs1, dfcs0): dfcs1 and dfcs0 select the clock to be supplied to the counter. ( s = fosc/2) bit 7 bit 6 dfcs1 dfcs0 description 0 s (initial value) 0 1 s/2 1 0 s/4 1 s/8 bit 5 ? counter overflow flag (dfovf): the dfovf flag indicates th e overflow of the 16-bit counter. it is cleared by writing 0. write 0 after r eading 1. also, setting has the highest priority in this flag. if a flag set and 0 write occurs simultaneously, the latter is nullified. bit 5 dfovf description 0 normal state (initial value) 1 indicates that overflow has occurred in the counter bit 4 ? error data limit function selection bit (dfrfon): makes the error data limit function valid. (limit values are the values set in the lock range data register (dfrudr, dfrldr)). bit 4 dfrfon description 0 limit function off (initial value) 1 limit function on bit 3 ? drum lock flag (df-r/unr): sets a flag if an underflow occurred in the drum lock counter. bit 3 df-r/unr description 0 indicates that the drum speed system is not locked (initial value) 1 indicates that the drum speed system is locked section 28 servo circuits rev.3.00 jan. 10, 2007 page 679 of 1038 rej09b0328-0300 bit 2 ? drum phase system filter computation automatic start bit (dpcnt): sets on the filter computation of the phase system if an underflow occurred in the drum lock counter. bit 2 dpcnt description 0 does not perform the filter computation by detection of the drum lock (initial value) 1 sets on the filter computation of the phase system when drum lock is detected bits 1 and 0 ? drum lock counter setting bits (dfrcs1, dfrcs0): set the number of times where drum lock has been determin ed (dfg has been detected in the range set by the lock range data register). it sets the drum lock flag if it detected the set number of times of occurrence of drum lock. if an ncdfg signal is detected outside the lock range after data is written in dfrcs1 and 0, data is stored in the lock counter. note: if dfrcs1 or dfrcs0 is re ad-accessed, the counter value is read out. if bit 3 (drum lock flag) is 1 and the drum lock counter's value is 3, it indicates that the drum speed system is locked. the drum look counter stops un til lock is released after underflow. bit 1 bit 0 dfrcs1 dfrcs0 description 0 underflow after lock was detected once (initial value) 0 1 underflow after lock was detected twice 1 0 underflow after lock was detected three times 1 underflow after lock was detected four times section 28 servo circuits rev.3.00 jan. 10, 2007 page 680 of 1038 rej09b0328-0300 28.6.5 description of operation the drum speed error detector detects the speed error based on the reference value set in the dfg specified speed preset register (dfpr). the referen ce value set in dfpr is preset in the counter by the ncdfg signal, and counts down by the selected clock. the timing of the counter presetting and the error data latching can be selected between the rising or falling edge of the ncdfg signal. see section 28.14.4, dfg noise removal circuit. the error data detected is sent to the digital filter circuit. the error data is signed binaries. it takes a positive number (+) if the speed is slower than the specified speed, a negative number (-) if th e speed is faster, or 0 if it correct (revolving at the specified speed). figure 28.28 shows an ex ample of operation to detect the drum speed. setting the error data limit: a limit can be set to the error data sent to the digital filter circuit using the dfg lock data register (dfrudr, dfrldr). set the upper limit of the error data in dfrudr and the lower limit in dfrldr, and write 1 in the dfrfon bit. if the error data is beyond the limit range, the dfrldr value is sent if a negative number is latched, or the dfrudr value is sent if a positive one is latched, as a limit value. be sure to turn off the limit setting (dfrfon = 0) when you set the limit value. if the limit was set with the limit setting on (dfrfon = 1), result of computation is not assured. lock detection: if an error data was detected within the lock range set in the lock data register, the drum lock flag (df-r/unr) is set by the number of the times of occurrence of locking set by the dfrcs1 and dfrcs0 bits, and an interrupt is requested (irrdrm2) at the same time. the number of the occurrence of locking (once to 4 tim es) can be specified when setting the flag. use the dfrcs1 and dfrcs0 bits for this purpose. also, if bit 5 (dpha bit) of the drum system digital filter control register (dfic) is 0 (phased system digital filter computation off) and the dpcnt bit is 1, turning on/off of the phase system digital filter computation can be controlled automatically by the status of lock detection. drum system sspeed e rror detectio n counter: the drum system speed error detection counter stops the counter and sets the overflow flag (dfovf) when the overflow occurred. at the same time, it generates an interrupt request (irrdrm1). clear dfovf by writing 0 after reading 1. if setting the flag and writing 0 take place simultaneously, the latter is nullified. interrupt request: irrdrm1 is generated by the ncdfg signal latch and the overflow of the error detection counter. irrdrm2 is generated by de tection of lock (after the detection of the number of times of setting). section 28 servo circuits rev.3.00 jan. 10, 2007 page 681 of 1038 rej09b0328-0300 ?value+value specified speed value latch data 0 (no error) preset value preset period (2 counts) counter ncdfg signal error data latch signal (dfg ) preset data load figure 28.28 example of the operation of the drum speed error detection (selection of the rising edge of dfg) section 28 servo circuits rev.3.00 jan. 10, 2007 page 682 of 1038 rej09b0328-0300 28.6.6 f h correction in trick play mode in trick play mode, the tape speed changes relative to the video head. this change alters the horizontal sync signal (f h ), causing skew. to correct the skew, the drum motor speed must be shifted to a different speed in each trick play m ode, so as to obtain the normal horizontal sync frequency. to shift the drum motor speed, softwa re should modify the value written in the dfg preset data register in the speed error detector. this f h correction can be expressed in terms of the basic frequency f f of the drum as follows. n 0 f f = f f0 n 0 + h (1 ? n) legend: n: speed multiplier (fwd = positive, rev = negative) h : h alignment (1.5 h in standard mode, 0.75 h in 2 mode, and 0.5 h in 3 mode for vhs and systems; 1 h for an 8-mm vcr) n 0 : standard h numbers within field f f0 : field frequency ntsc: n 0 = 262.5, f f0 = 59.94 pal: n 0 = 312.5, f f0 = 50.00 section 28 servo circuits rev.3.00 jan. 10, 2007 page 683 of 1038 rej09b0328-0300 28.7 drum phase error detector 28.7.1 overview drum phase control must start operating after the drum motor is brought to the correct revolution speed by the speed control system. drum phase cont rol works as follows in record and playback. record: phase is controlled so that the vertical blanking intervals of the recorded video signal will line up along the bottom edge of the tape. playback: phase is controlled so as to trace the recorded tracks accurately. a digital counter detects the phase deviation from a preset value. the phase error data is processed and added to speed error data in a digital filte r. this filter controls a pulse-width modulated (pwm) output, which controls the rotational phase and speed of the drum. the dpg signal from the drum motor is reshaped into a rectangular pulse waveform by a reshaping circuit, and sent to the phase error detector. the phase error detector compares the phase of the dpg pulse (tackle pulse), which contains video head phase information, with a reference si gnal. in the actual circuit, the comparison is carried out by comparing the head-switching (hsw) signal, which is delayed by a counter that is reset by dpg, with a reference signal value. the reference signal is the ref30 signal, which differs between record and playback as follows. record: vsync signal extracted from the video signal to be recorded (frame rate signal, actually 1/2 vsync) playback: 30 hz or 25 hz signal divided from the system clock 28.7.2 block diagram figure 28.29 shows a block diagram of the drum phase error detector. section 28 servo circuits rev.3.00 jan. 10, 2007 page 684 of 1038 rej09b0328-0300 r/w r/w r/w r/w r/w r/w ref30p hsw (video ff) nhsw (narrow ff) dpgcr dpgcr dpgcr dfucr dpgcr dppr1 dppr2 r/(w) s r f/f q w w internal bus internal bus ovf lsb msb dper1 dper2 lsb msb dpovf dfeps hswes n/v latch preset error data (20 bits) to dfu edge detector sequence controller , error data (16 bits) error data (4 bits) preset data (16 bits) preset data (4 bits) counter (20 bits) irrdrm3 dpcs1,0 s s/2 s/4 s/8 s = fosc/2 figure 28.29 block diagram of drum phase error detector section 28 servo circuits rev.3.00 jan. 10, 2007 page 685 of 1038 rej09b0328-0300 28.7.3 register configuration table 28.10 shows the register configuration of the drum phase error detector. table 28.10 register configuration name abbrev. r/w size initial value address drum phase preset data register 1 dppr1 w byte h'f0 h'fd03c drum phase preset data register 2 dppr2 w word h'0000 h'fd03a drum phase error data register 1 dper1 r/w byte h'f0 h'fd03d drum phase error data register 2 dper2 r/w word h'0000 h'fd03e drum phase error detection control register dpgcr r/w byte h'07 h'fd039 section 28 servo circuits rev.3.00 jan. 10, 2007 page 686 of 1038 rej09b0328-0300 28.7.4 register descriptions (1) drum phase preset da ta registers (dppr1, dppr2) dppr1 0 0 1 0 w 2 0 w 3 0 4 1 5 1 6 1 7 ? ? ? ? ? ? ? ? w w 1 bit : initial value : r/w : dppr2 0 w 13 0 w 14 0 w 15 10 32 54 7 0 w 6 0 w 9 0 w 8 0 w 11 0 w 10 0 w 0 www ww ww 12 0 0 0 0 0 0 bit : initial value : r/w : the 20-bit preset data that defines the specified drum phase is set in dppr1 and dppr2. the 20 bits are weighted as follows. b it 3 of dppr1 is the msb, and bit 0 of dppr2 is the lsb. when data is written to dppr2, the 20-bit preset data, in cluding dppr1, is loaded into the preset circuit. write to dppr1 first, and dppr2 next. the preset data is referenced to h'80000*, and can be calculated from the following equation. target phase difference = (reference signal frequency/2) ? 6.5 h drum phase preset data = h'80000 ? ( s/n target phase difference) s: servo clock frequency in hz (fosc/2) s/n: clock source of selected counter dppr2 is accessible by word access only. byte acce ss gives unassured results. reads are disabled. dppr1 and dppr2 are initialized to h'f0 and h'0000 by a reset, and in standby mode. note: * the preset data value is calculated so that the counter will reach h'80000 when the error value is zero. when the counter value is latched as error data in the drum phase error data registers (dper1 and dper2), however, it is converted to a value referenced to h'00000. section 28 servo circuits rev.3.00 jan. 10, 2007 page 687 of 1038 rej09b0328-0300 (2) drum phase error data registers (dper1, dper2) dper1 0 0 1 0 r * /w 2 0 r * /w 3 0 4 1 5 1 6 1 7 ? ? ? ? ? ? ? ? r * /w r * /w 1 bit : initial value : r/w : dper2 0 r * /w 13 0 r * /w 14 0 r * /w 15 10 32 54 7 0 r * /w 6 0 r * /w 9 0 r * /w 8 0 r * /w 11 0 r * /w 10 0 r * /w 0 r * /w r * /w r * /w r * /w r * /w r * /w r * /w 12 0 0 0 0 0 0 bit : initial value : r/w : note: * note that only detected error data can be read. dper1 and dper2 consist of a 20-bit dpg phase error data register. the 20 bits are weighted as follows. bit 3 of dper1 is the msb, and bit 0 of dper2 is the lsb. when the rotational phase is correct, the data h'00000 is latched. negative data will be latched if the drum leads the correct phase, and positive data if it lags. values in dper1 and dper 2 are transferred to the digital filter circuit. dper1 and dper2 are 20-bit readable/writable registers. when writing data to dper1 and dper2, write to dper1 first, and then write to dper2. dper2 is accessible by word access only. byte access gives unassured results. dper1 and dper2 are initialized to h'f0 and h'0000 by a reset, and in standby mode. see the note on the drum phase preset data registers (dppr1 and dppr2) in section 28.7.4 (1), drum phase present data register (dppr1, dppr2). (3) drum phase error det ection control register (dpgcr) 0 1 1 2 ? ? ? ? ? ? 1 3 0 4 0 r/w r/w 5 0 6 0 7 r/(w) * dpovf r/w dpcs0 0 r/w dpcs1 n/v hswes 1 bit : initial value : r/w : note: * only 0 can be written. dpgcr controls the operation of drum phase error detection. dpgcr is an 8-bit readab le/writable register. bits 2 to 0 ar e reserved, bit 5 accepts only read and 0 write. it is initialized to h'07 by a reset or stand-by. section 28 servo circuits rev.3.00 jan. 10, 2007 page 688 of 1038 rej09b0328-0300 bits 7 and 6 ? clock source selection bits (dpcs1, dpcs0): select the clock supplied to the counter. ( s = fosc/2) bit 7 bit 6 dpcs1 dpcs0 description 0 s (initial value) 0 1 s/2 1 0 s/3 1 s/4 bit 5 ? counter overflow flag (dpovf): the dpovf flag indicates the overflow of the 20-bit counter. it is cleared by writing 0. write 0 after r eading 1. also, setting has the highest priority in this flag. if a flag set and 0 write occurs simultaneously, the latter is nullified. bit 5 dpovf description 0 normal state (initial value) 1 indicates that an overflow has occurred in the counter bit 4 ? error data latch signal selection bit (n/v): selects the latch signal of error data. bit 4 n/v description 0 hsw (videoff) signal (initial value) 1 nhsw (narrowff) signal bit 3 ? edge selection bit (hswes): selects the edge of the error data latch signal (hsw or nhsw). bit 3 hswes description 0 latches at the rising edge (initial value) 1 latches at the falling edge bits 2 to 0 ? reserved: no read or write is valid. section 28 servo circuits rev.3.00 jan. 10, 2007 page 689 of 1038 rej09b0328-0300 28.7.5 description of operation the drum phase error detector detects the phase error based on the reference value set in the drum phase preset data register 1 and 2 (dppr1, dppr2). the reference values set in dppr1 and dppr2 are preset in the counter by the ref30p signal, and counted up by the clock selected. the latch of the error data can be selected between the rising or falling edge of hsw (nhsw). the error data detected in the error data automatic transmission mode (dfeps bit of dfucr = 0) is sent to the digital filter circuit automatically. in software transmission mode (dfeps bit of dfucr = 1), the data written in dper1 and dper2 is sent to the digital filter circuit. the error data is signed binary. it takes a positive number (+) if the phase is behind the specified phase, a negative number (-) if in advance of the specified phase, or 0 if it had no phase error (revolving at the specified phase). figures 28.30 and 28.31 show examples of operation to detect a drum phase error. drum phase error detection counter: the drum phase error detection counter stops the counter when overflow or latch occurred. at the same time, it generates an interrupt request (irrdrm3), setting the overflow flag (dpovf) if overflow occurred. clear dpovf by writing 0 after reading 1. if setting the flag and writing 0 take place simultaneously, the latter is nullified. interrupt request: irrdrm3 is generated by the hsw (nhsw) signal latch and the overflow of the error detection counter. latch latch preset value counter hsw (nhsw) * ref30p preset value preset note: * edge selectable preset figure 28.30 drum phase control in playback mode (hsw rising edge selected) section 28 servo circuits rev.3.00 jan. 10, 2007 page 690 of 1038 rej09b0328-0300 latch latch preset value counter hsw (nhsw) * vd ref30p preset value preset note: * edge selectable preset reset reset figure 28.31 drum phase control in r ecord mode (hsw rising edge selected) 28.7.6 phase comparison the phase comparison circuit takes measures of the difference of time between the reference signal and the comparing signal with a digital counter. the ref30 signal is used for the reference signal, and the hsw signal (videoff) or hhsw signal (narrowff) from the hsw timing generator is used for the comparing signal. in record mode, however, the phase of the ref30 signal is the same as that of the vertical sync signal (vsync) because the reference signal generator (ref30 generator) is reset by the vertical sync signal (vsync) in the video signals. the error detection counter performs the data latc hing operation at the rising or falling edge of the hsw signal. the digital filter circuit performs computation using this data as 20-bit phase error data. after processing and adding the phase error data and the speed error data from the drum speed control system, the digital filter circuit sends the data as the error data of the drum system to the pwm modulation circuit. section 28 servo circuits rev.3.00 jan. 10, 2007 page 691 of 1038 rej09b0328-0300 28.8 capstan speed error detector 28.8.1 overview capstan speed control operates so as to hold the capstan motor at a constant revolution speed, by measuring the period of the cfg signal. a digital counter detects the speed deviation from a preset value. the speed error data is added to phase error data in a digital filter. this filter controls a pulse-width modulated (pwm) output, which controls the revolution speed and phase of the capstan motor. the cfg input signal is downloaded by the comparator circuit, then reshaped into a square wave by a reshaping circuit, divided by the cfg divider, and sent to the speed error detector as the dvcfg signal. the speed error detector uses the system clock to measure the period of the dvcfg signal, and detects the deviation from a preset data value. the preset data is the value that would result from measuring the dvcfg signal period with the clock signal if the capstan motor was running at the correct speed. the error detector operates by latching a counter value when it detects an edge of the dvcfg signal. the latched count provides 16 bits of speed error data for the digita l filter to operate on. the digital filter adds the speed error data to phase error data from the capstan phase control system, then sends the result to the pulse-width modulator as capstan error data. 28.8.2 block diagram figure 28.32 shows a block diagram of the capstan speed error detector. section 28 servo circuits rev.3.00 jan. 10, 2007 page 692 of 1038 rej09b0328-0300 w w r udf ovf lock 2 up clear latch preset cfvcr cfrldr cfvcr cfpr cfvcr cfvcr cfvcr cfucr cfer cfrvcr error data (16 bits) to dfu dvcfg cfrudr internal bus r/w internal bus r/w w r/w r/w r/w r/w (r)/w lock 1 up s r f/f q s r f/f cfrcs1,0 cf-r/unr lock counter (2 bits) q s r f/f q lock range detector lock range data 2 (16 bits) lock range data 1 (16 bits) cpcnt error data limitter control circuit cfrfon cfess error data (16 bits) counter (16 bits) cfovf irrcap2 irrcap1 crockon to dfu preset data (16 bits) cfcs1, 0 s s/2 s/4 s/8 figure 28.32 block diagram of capstan speed error detector section 28 servo circuits rev.3.00 jan. 10, 2007 page 693 of 1038 rej09b0328-0300 28.8.3 register configuration table 28.11 shows the register configuration of the capstan speed error detector. table 28.11 register configuration name abbrev. r/w size initial value address cfg speed preset data register cfpr w word h'0000 h'fd050 cfg speed error data register cfer r/w word h'0000 h'fd052 cfg lock upper data register cfrudr w word h'7fff h'fd054 cfg lock lower data register cfrldr w word h'8000 h'fd056 capstan speed error detection control register cfvcr r/w byte h'00 h'fd058 28.8.4 register descriptions (1) cfg speed preset data register (cfpr) 0 w 13 0 w 14 0 w 15 10 32 54 7 0 w 6 0 w 9 0 w 8 0 w 11 0 w 10 0 w 0 www ww ww 12 0 0 0 0 0 0 bit : initial value : r/w : the 16-bit preset data that defines the specified cfg speed is set in cfpr. the preset data is referenced to h'8000*, and can be calculated from the following equation. s/n cfg speed preset data = h'8000 ? ( ? 2) dvcfg frequenc y s: servo clock frequency in hz (f osc /2) dvcfg frequency: in hz the constant 2 is the preset interval (see figure 28.33). s/n: clock source of the selected counter section 28 servo circuits rev.3.00 jan. 10, 2007 page 694 of 1038 rej09b0328-0300 cfpr is a 16-bit write-only register. cfpr is accessible by word access only. byte access gives unassured results. no read is valid. if a read is attempted, an undetermined value is read out. cfpr is initialized to h'0000 by a reset, stand-by or module stop. note: * the preset data value is calculated so that the counter will reach h'8000 when the error is zero. when the counter value is latched as error data in the cfg speed error data register (cfer), however, it is converted to a value referenced to h'0000. (2) cfg speed error data register (cfer) 0 r * /w 13 0 r * /w 14 0 r * /w 15 10 32 54 7 0 r * /w 6 0 r * /w 9 0 r * /w 8 0 r * /w 11 0 r * /w 10 0 r * /w 0 r * /w r * /w r * /w r * /w r * /w r * /w r * /w 12 0 0 0 0 0 0 bit : initial value : r/w : note: * note that only detected error data can be read. cfer is a 16-bit data register. when the speed of the capstan motor is correct, the data latched in cfer is h'0000. negative data will be latched if the speed is too fast, and positive data if the speed is too slow. the cfer value is sent to the digital filter either automatically or by software. cfer is a 16-bit readable/writable register. cfer is accessible by word access only. byte access gives unassured results. cfer is initialized to h'0000 by a reset, and in module stop mode and standby mode. see the note on the cfg speed preset data regi ster (cfpr) in section 28.8.4 (1), cfg speed present data register (cfpr). (3) cfg lock upper data register (cfrudr) 1 w 13 1 w 14 0 w 15 10 32 54 7 1 w 6 1 w 9 1 w 8 1 w 11 1 w 10 1 w 1 www ww ww 12 1 1 1 1 1 1 bit : initial value : r/w : cfrudr is a register used to set the lock range on the upper side when capstan speed lock is detected, and to set the limit value on the upper side when the limiter function is in use. when lock is being detected, if the capstan speed is detected within the lock range, the lock counter which has been set by the cfrcs1 and cfrcs0 bits of the cfvcr register counts down. if the set value of cfrcs1 and cfrcs0 matches the number of times of occurrence of locking, the computation of the digital filter in the capstan phase system can be controlled automatically. also, if the cfg speed error data is beyond the cfrudr value when the limiter function is in use, the cfrudr value can be used as the data for computation by the digital filter. cfrudr is a 16-bit write-only register. only a word access is valid. if a byte access is attempted, operation is not assured. a read is invalid. if a read is attempted, an undetermined value is read out. it is initialized to h'7fff by a reset, stand-by or module-stop. section 28 servo circuits rev.3.00 jan. 10, 2007 page 695 of 1038 rej09b0328-0300 (4) cfg lock lower data register (cfrldr) 0 w 13 0 w 14 1 w 15 10 32 54 7 0 w 6 0 w 9 0 w 8 0 w 11 0 w 10 0 w 0 www ww ww 12 0 0 0 0 0 0 bit : initial value : r/w : cfrldr is a register used to set the lock range on the lower side when capstan speed lock is detected, and to set the limit value on lower side when limiter function is in use. when lock is being detected, if the drum speed is detected within the lock range, the lock counter which has been set by the cfrcs1 and cfrcs0 bits of the cfvcr register counts down. if the set value of cfrcs1 and cfrcs0 matches the number of times of occurrence of locking, the computation of the digital filter in the drum phase system can be controlled automatically. also, if the cfg speed error data is under the cfrldr value when the limiter function is in use, the cfrldr value can be used as the data for computation by the digital filter. cfrldr is a 16-bit write-only register. only a wo rd access is valid. if a byte access is attempted, operation is not assured. no read is valid. if a read is attempted, an undetermined value is read out. it is initialized to h'8000 by a reset, stand-by or module-stop. (5) capstan speed error detection control register (cfvcr) 0 0 1 0 (r) * 2 /w 2 0 r/w 3 0 4 0 r/w 0 r/(w) * 1 5 6 0 7 cfrfon cf-r/unr cpcnt cfrcs1 cfrcs0 0 r/w cfcs1 (r) * 2 /w r r/w cfcs0 cfovf notes: bit : initial value : r/w : 1. only 0 can be written. 2. if read-accessed, the counter value is read out. cfvcr controls the operation of capstan speed error detection. cfvcr is an 8-bit readable/writable register. b it 3 accepts only read, and bit 5 accepts only read and 0 write. it is initialized to h'00 by a reset, stand-by or module-stop. bits 7 and 6 ? clock source selection bits (cfcs1, cfcs0): cfcs1 and cfcs0 select the clock to be supplied to the counter. ( s = fosc/2) bit 7 bit 6 cfcs1 cfcs0 description 0 s (initial value) 0 1 s/2 1 0 s/4 1 s/8 section 28 servo circuits rev.3.00 jan. 10, 2007 page 696 of 1038 rej09b0328-0300 bit 5 ? counter overflow flag (cfovf): the cfovf flag indicates overflow of the 16-bit counter. it is cleared by writing 0. write 0 after r eading 1. also, setting has the highest priority in this flag. if a flag set and 0 write occurs simultaneously, the latter is nullified. bit 5 cfovf description 0 normal state (initial value) 1 indicates that an overflow has occurred in the counter bit 4 ? error data limit function selection bit (cfrfon): makes the error data limit function valid. (limit values are the values set in the lock range data register (cfrudr, cfrldr)). bit 4 cfrfon description 0 limit function off (initial value) 1 limit function on bit 3 ? capstan lock flag (cf-r/unr): sets a flag if an underflow occurred in the capstan lock counter. bit 3 cf-r/unr description 0 indicates that the capstan speed system is not locked (initial value) 1 indicates that the capstan speed system is locked bit 2 ? capstan phase system filter computation automatic start bit (cpcnt): sets on the filter computation of the phase system if an underflow occurred in the capstan lock counter. bit 2 cpcnt description 0 does not perform the filter computation by detection of the capstan lock (initial value) 1 set on the filter computation of the phase system when capstan lock is detected section 28 servo circuits rev.3.00 jan. 10, 2007 page 697 of 1038 rej09b0328-0300 bits 1 and 0 ? capstan lock counter setting bits (cfrcs1, cfrcs0): sets the number of times where drum lock has been determined (dvcfg has been detected in the range set by the lock range data register). it sets the capstan lo ck flag if it detected the set number of times of occurrence of capstan lock. if a dvcfg signal is detected outside the lock range after data is written in cfrcs1 and cfrcs0, data is stored in the lock counter. note: if cfrcs1 or cfrcs0 is read-accessed, th e counter value is read out. if bit 3 (capstan lock flag) is 1 and the capstan lock counter's value is 3, it i ndicates that the capstan speed system is locked. the capstan look counter stops until lock is released after underflow. bit 1 bit 0 cfrcs1 cfrcs0 description 0 underflow after lock was detected once (initial value) 0 1 underflow after lock was detected twice 1 0 underflow after lock was detected three times 1 underflow after lock was detected four times 28.8.5 description of operation the capstan speed error detector detects the speed error based on the reference value set in the cfg speed preset register (cfpr). the reference value set in cfpr is preset in the counter by the dvcfg signal, and counts down by the selected clock. the timing of the counter presetting and the error data latching can be selected between the rising or falling edge of the dvcfg signal. see description of dvcfg control register (cdvc), in section 28.14.3, cfg frequency divider. the error data detected is sent to the digital filter circuit. the error data is signed binaries. it takes a positive number (+) if the speed is slower than the specified speed, a negative number (-) if the speed is faster, or 0 if it had no error (revolving at the specified speed). figure 28.33 shows an example of operation to de tect the capstan speed. setting the error data limit: a limit can be set to the error data sent to the digital filter circuit using the cfg lock data register (cfrudr, cfrldr). set the upper limit of the error data in cfrudr and the lower limit in cfrldr, and write 1 in the cfrfon bit. if the error data is beyond the limit range, the cfrldr value is sent if a negative number is latched, or the cfrudr value is sent if a positive one is latched, as a limit value. be sure to turn off the limit setting (cfrfon = 0) when you set the limit value. if the limit was set with the limit setting on (cfrfon = 1), result of computation is not assured. section 28 servo circuits rev.3.00 jan. 10, 2007 page 698 of 1038 rej09b0328-0300 lock detection: if error data was detected within the lock range set in the lock data register, the capstan lock flag (cf-r/unr) is set by the numb er of the times of occurrence of locking set by the cfrcs1 and cfrcs0 bits, and an interrupt is requested (irrcap2) at the same time. the number of the occurrence of locking (once to 4 tim es) can be specified when setting the flag. use the cfrcs1 and cfrcs0 bits for this purpose. also, if bit 5 (cpha bit) of the capstan system digital filter control register (cfic) is 0 (phased system digital filter computation off) and the dpcnt bit is 1, turning on/off of the phase system digital filter computation can be controlled automatically by the status of lock detection. capstan system sspeed error detection counter: the capstan system speed error detection counter stops the counter and sets the overflow flag (cfovf) when overflow occurred. at the same time, it generates an interrupt request (irrcap1). clear cfovf by writing 0 after reading 1. if setting the flag and writing 0 take place simultaneously, the latter is nullified. interrupt request: irrcap1 is generated by the dvcfg signal latch and the overflow of the error detection counter. irrcap2 is generated by detection of lock (after the detection of the number of times of setting). ?value +value specified speed value latch data 0 (no error) preset value preset period (2 counts) counter error data latch signal (dvcfg) preset data load figure 28.33 example of the operation of the capstan sp eed error detection section 28 servo circuits rev.3.00 jan. 10, 2007 page 699 of 1038 rej09b0328-0300 28.9 capstan phase error detector 28.9.1 overview the capstan phase control system is required to start operation after the capstan motor has arrived at the specified speed under the control of the speed control system. the capstan phase control system operates in the following way in record/playback mode. in record mode: controls the tape running so that it may run at a specified speed together with the speed control system. in playback mode: controls the tape running so that the recorded track may be traced correctly. any error deviated from the reference phase is detected by the digital counter. this phase error data and the speed error data is processed and added by the digital filter circuit to control the pwm output. the phase and speed of the capstan, in turn, is controlled by this pwm output. the control signal of the capstan phase control in rec mode differs from that in pb mode. in rec mode, the control is performed by the dvcfg 2 signal which is generated by dividing the frequencies of the reference signal (ref30p or cref) and the cfg signal. in pb mode, it is performed by divided rising signal (dvctl) of the reference signal (capref30) and the playback control pulse (pb-ctl). the reference signal in record and playback modes are as follows. in record mode: 1/2 vsync signal extracted from the video signal to be recorded in playback mode: signal generated by dividing the pb-ctl signal (dvctl) at its rising edge 28.9.2 block diagram figure 28.34 shows the block diagram of the capstan phase error detector. section 28 servo circuits rev.3.00 jan. 10, 2007 page 700 of 1038 rej09b0328-0300 r/w r/w r/w r/w r/w r/w cref ref30p capref30 recref dvcfg2 dvctl cpgcr r/w cr/rf cpgcr dfucr cpgcr cppr1 cppr2 r/(w) s r f/f q w w internal bus internal bus ovf lsb msb cper1 cper2 lsb msb cpovf cfeps selcfg2 r/w ctlm r/ p asm latch preset error data (20 bits) to dfu sequence controller error data (16 bits) error data (4 bits) preset data (16 bits) preset pb: x value + trk value = capref30 rec: ref30p or cref latch pb : dvctl rec : dvcfg2 preset data (4 bits) counter (20 bits) irrcap3 cpcs1,0 s s/2 s/4 s/8 s = fosc/2 figure 28.34 block diagram of capstan phase error detector section 28 servo circuits rev.3.00 jan. 10, 2007 page 701 of 1038 rej09b0328-0300 28.9.3 register configuration table 28.12 shows the register configuration of the capstan phase error detector. table 28.12 register configuration name abbrev. r/w size initial value address capstan phase preset data register 1 cppr1 w byte h'f0 h'fd05c capstan phase preset data register 2 cppr2 w word h'0000 h'fd05a capstan phase error data register 1 cper1 r/w byte h'f0 h'fd05d capstan phase error data register 2 cper2 r/w word h'0000 h'fd05e capstan phase error detection control register cpgcr r/w byte h'07 h'fd059 section 28 servo circuits rev.3.00 jan. 10, 2007 page 702 of 1038 rej09b0328-0300 28.9.4 register descriptions (1) capstan phase preset data registers (cppr1, cppr2) cppr1 0 0 1 0 w 2 0 w 3 0 4 1 5 1 6 1 7 ? ? ? ? ? ? ? ? w w 1 bit : initial value : r/w : cppr2 0 w 13 0 w 14 0 w 15 10 32 54 7 0 w 6 0 w 9 0 w 8 0 w 11 0 w 10 0 w 0 www ww ww 12 0 0 0 0 0 0 bit : initial value : r/w : the 20-bit preset data that defines the specified capstan phase is set in cppr1 and cppr2. the 20 bits are weighted as follows. b it 3 of cppr1 is the msb. bit 0 of cppr2 is the lsb. when cppr2 is written to, the 20-bit preset data, including cppr1, is loaded into the preset circuit. write to cppr1 first, and cppr2 next. the preset data is referenced to h'80000*, and can be calculated from the following equation. target phase difference = rreference signal frequency/2 capstan phase preset data = h'80000 ? ( s/n target phase difference) s: servo clock frequency in hz (fosc/2) s/n: clock source of selected counter cppr2 is accessible by word access only. byte acce ss gives unassured results. reads are disabled. if read is attempted to cppr1 or cppr2, an undetermined value is read out. cppr1 and cppr2 are initialized to h'f0 and h'0000 by a reset, and in standby mode. note: * the preset data value is calculated so that the counter will reach h'80000 when the error is zero. when the counter value is latched as error data in the capstan phase error data registers (cper1 and cper2), however, it is converted to a value referenced to h'00000. section 28 servo circuits rev.3.00 jan. 10, 2007 page 703 of 1038 rej09b0328-0300 (2) capstan phase error data registers (cper1, cper2) 0 0 1 0 r * /w 2 0 r * /w 3 0 4 1 5 1 6 1 7 ? ? ? ? ? ? ? ? r * /w r * /w 1 bit : initial value : r/w : 0 r * /w 13 0 r * /w 14 0 r * /w 15 10 32 54 7 0 r * /w 6 0 r * /w 9 0 r * /w 8 0 r * /w 11 0 r * /w 10 0 r * /w 0 r * /w r * /w r * /w r * /w r * /w r * /w r * /w 12 0 0 0 0 0 0 bit : initial value : r/w : note: * note that only detected error data can be read. cper1 and cper2 constitute a 20-bit capstan phase error data register. the 20 bits are weighted as follows. bit 3 of cper1 is th e msb. bit 0 of cper2 is the ls b. when the rotational phase is correct, the data h'00000 is latched. negative data will be latched if the phase leads the correct phase, and positive data if it lags. values in cper1 and cper 2 are transferred to the digital filter circuit. cper1 and cper are 20-bit readable/writable registers. when writing data to cper1 and cper2, write to cper1 first, and then write to cper2. cper2 is accessible by word access only. byte access gives unassured results. cper1 and cper2 are initialized to h'f0 and h'0000 by a reset, and in standby mode. see the note on the capstan phase preset data registers (cppr1 and cppr2) in section 28.9.4 (1), capstan phase present data registers (cppr1, cppr2). (3) capstan phase error det ection control register (cpgcr) 0 1 1 2 ? ? ? ? ? ? 1 3 0 4 0 r/w 5 0 6 0 7 r/w r/(w) * cpovf r/w cpcs0 0 r/w cpcs1 cr/rf selcfg2 1 note: * only 0 can be written bit : initial value : r/w : cpgcr controls the operation of capstan phase error detection. cpgcr is an 8-bit readable/writa ble register. bits 2 to 0 are re served, bit 5 accepts only read and 0 write. it is initialized to h'07 by a reset or stand-by. section 28 servo circuits rev.3.00 jan. 10, 2007 page 704 of 1038 rej09b0328-0300 bits 7 and 6 ? clock source selection bits (cpcs1, cpcs0): select the clock supplied to the counter. ( s = fosc/2) bit 7 bit 6 cpcs1 cpcs0 description 0 s (initial value) 0 1 s/2 1 0 s/4 1 s/8 bit 5 ? counter overflow flag (cpovf): cpovf flag indicates the overflow of the 20-bit counter. it is cleared by writing 0. write 0 after r eading 1. also, setting has the highest priority in this flag. if a flag set and 0 write occurs simultaneously, the latter is nullified. bit 5 cpovf description 0 normal state (initial value) 1 indicates that an overflow has occurred in the counter bit 4 ? preset signal selection bit (cr/rf): selects the preset signal. bit 4 cr/rf description 0 presets ref30p signal (initial value) 1 presets cref signal bit 3 ? preset and latch signal selection bit (selcfg2): selects the counter preset signal and the error data latch signal data in pb (asm) mode. bit 3 selcfg2 description 0 presets capref30 signal; latches dvctl signal (initial value) 1 presets ref30p (cref) signal; latches dvcfg2 signal bits 2 to 0 ? reserved: no read or write is valid. section 28 servo circuits rev.3.00 jan. 10, 2007 page 705 of 1038 rej09b0328-0300 28.9.5 description of operation the capstan phase error detector detects the phase error based on the reference value set in the capstan specified phase preset data register 1 an d 2 (cppr1, cppr2). the reference values set in cppr1 and cppr2 are preset in the counter by the ref30p (cref) signal or capref30 signal, and counted up by the clock selected. the latching of the error data is performed by dvctl or dvcfg2. the error data detected in the error data automatic transmission mode (cfeps bit of dfucr = 0) is sent to the digital filter circuit automatically. in software transmission mode (cfeps bit of dfucr = 1), the data written in cper1 and cper2 is sent to the digital filter circuit. the error data is signed binary. it takes a positive number (+) if the phase is behind the specified phase, a negative number (-) if in advance of the specified phase, or 0 if it had no phase error (revolving at the specified phase). figures 28.35 and 28.36 show examples of operation to detect a capstan phase error. capstan phase erro r detection counter: the capstan phase error de tection counter stops the counter when overflow or latch occurred. at the same time, it generates an interrupt request (irrcap3), setting the overflow flag (cpovf) if overflow occurred. clear cpovf by writing 0 after reading 1. if setting the flag and writing 0 take place simultaneously, the latter is nullified. interrupt request: irrcap3 is generated by the dvctl or dvcfg2 signal latch and the overflow of the error detection counter. latch latch preset value counter pb-ctl capref30 dvctl or dvcfg2 preset preset figure 28.35 capstan phase control in playback mode section 28 servo circuits rev.3.00 jan. 10, 2007 page 706 of 1038 rej09b0328-0300 latch latch preset value counter dvcfg2 ref30p or cref preset preset figure 28.36 capstan phas e control in record mode section 28 servo circuits rev.3.00 jan. 10, 2007 page 707 of 1038 rej09b0328-0300 28.10 x-value and tracking adjustment circuit 28.10.1 overview to maintain compatibility with other vcrs, an on-chip adjustment circuit adjusts the phase of the reference signal (internal reference signal (ref30) or external reference signal (excap)) during playback. because of manufacturing tolerances, th e physical distance betw een the video head and control head (the x-value: 79.244 mm) may vary from set to set, so when a tape that was recorded on a different set is played back, the phase of th e reference signal may need to be adjusted. the adjustment can be made by a register setting. the same setting can adjust the rotational phase of the capstan motor to maintain positional alignment (tracking alignment) of the video head with the recorded tracks in autotrack ing, or when tracks that were record ed with an ep head are traced by a wider head. these tracking adjustments can be made by acquisition of the envelope signal by the a/d converter. 28.10.2 block diagram the adjustment circuit consists of a 10-bit counter clocked by the servo clock ( s or s/2), and two down-counters with load register. individual setting of x-value adjustment can be made by the x- value data register (xdr) and tracking adjustment by the trk data register (trdr). the reference signal clears the 10-bit counter and sets the load register value in the down-counter with two load registers. after the adjusted referenc e signal is generated, clock supply stops and the circuit halts until the next reference signal is input . the ref30 signal can be divided (by 2 to 4) as necessary. figure 28.37 shows a block diagram. section 28 servo circuits rev.3.00 jan. 10, 2007 page 708 of 1038 rej09b0328-0300 r * /w notes: * when dvref1 and dvref0 are read, values in the down counter (2 bits) are read out. s = fosc/2 s s /2 excap ref30p xtcr w w xcs xtcr w at/ mu asm rec/pb xtcr w trk/ x s r q s r q internal bus internal bus dvref1, 0 caprf exc/ref w w xtcr xtcr down counter edge selection (2 bits) counter (10 bits) capref30 ref30x w x-value data register xdr (12 bits) trk value data register trdr (12 bits) down counter (12 bits) (12 bits) down counter figure 28.37 block diagram of x-value adjustment circuit section 28 servo circuits rev.3.00 jan. 10, 2007 page 709 of 1038 rej09b0328-0300 28.10.3 register descriptions (1) register configuration table 28.13 shows the register configuration of x-value adjustment and tracking adjustment circuits. table 28.13 register configuration name abbrev. r/w size initial value address x-value and trk-value control register xtcr r/w byte h'80 h'fd074 x-value data register xdr w word h'f000 h'fd070 trk-value data register trdr w word h'f000 h'fd072 (2) x-value and trk-value control register (xtcr) 0 0 1 0 r/w 2 0 w 3 0 4 0 w 5 0 6 0 7 ? ? r/w w w at/mu w caprf trk/x exc/ref xcs dvref1 dvref0 1 bit : initial value : r/w : xtcr is an 8-bit register to determine the x-value and trk-value adjustment circuits. bits 6 to 2 are write-only bits. no read is valid. if a read is attempted, an undetermined value is read out. bits 1 and 0 are readable/writable bits. xtcr accepts onl y a byte access. if a word access is attempted, operation is unassured. it is initialized to h'80 by a reset, stand-by or module stop. bit 7 ? reserved: no write is valid. if a read is attempted, an undetermined value is read out. bit 6 ? external sync signal edge selection bit (caprf): selects the excap edge when a selection is made to generate external sync signals. bit 6 caprf description 0 signal generated at the rising edge of excap (initial value) 1 signal generated at both edges of excap section 28 servo circuits rev.3.00 jan. 10, 2007 page 710 of 1038 rej09b0328-0300 bit 5 ? capstan phase correction auto /manual selection bit (at/ mu ): selects whether the generation of the correction reference signal (capref30) for capstan phase control is controlled automatically or manually depending on the status of the asm and rec/ pb bits of the ctl mode register. bit 5 at/ mu description 0 manual mode (initial value) 1 auto mode bit 4 ? capstan phase correction regi ster selection bit (trk/ x ): determines the method to generate the capref30 signal when the at/ mu bit is 0. bit 4 trk/ x description 0 generates capref30 only by the set value of xdr (initial value) 1 generates capref30 by the set values of xdr and trdr bit 3 ? reference signal selection bit (exc/ref): selects the reference signal to generate the correction reference signal (capref30). bit 3 exc/ref description 0 generates the signal based on ref30p (initial value) 1 generates the signal based on the external reference signal bit 2 ? clock source selection bit (xcs): selects the clock source to be supplied to the 10-bit counter. bit 2 xcs description 0 s (initial value) 1 s/2 section 28 servo circuits rev.3.00 jan. 10, 2007 page 711 of 1038 rej09b0328-0300 bits 1 and 0 ? ref30p division ratio selection bits (dvref1, dvref0): select the division value of ref30p. if it is read-accessed, the counter value is read out. (the selected division value is set by the udf of the counter.) bit 1 bit 0 dvref1 dvref0 description 0 division in 1 (initial value) 0 1 division in 2 1 0 division in 3 1 division in 4 (3) x-value data register (xdr) 1 13 1 14 1 15 10 32 54 7 0 w 6 0 w 9 0 w 8 0 w 11 0 w 10 0 w 1 ww ww ww 12 ? ? ?? ? ? ?? xd1 xd0 xd3 xd2 xd5 xd4 xd7 xd6 xd9 xd8 xd11 xd10 0 0 0 0 0 0 bit : initial value : r/w : the x-value data register (xdr) is a 16-bit write- only register. no read is valid. if a read is attempted, an undefined value is read out. xdr accepts only a word-access. if a byte access is attempted, operation is not assured. set x-value correction data to xdr, except a value which is beyond the cycle of the ctl pulse. if at/ mu = 0, trk/ x = 0 was set, capref30 can be generated only by the setting of xdr. set an x-value and trk correction value in pb mode, and an x-value in rec mode. it is initialized to h'f000 by a reset, stand-by or module stop. (4) trk-value data register (trdr) 1 13 1 14 1 15 10 32 54 7 0 w 6 0 w 9 0 w 8 0 w 11 0 w 10 0 w 1 ww ww ww 12 ? ? ?? ? ? ?? trd1 trd0 trd3 trd2 trd5 trd4 trd7 trd6 trd9 trd8 trd11 trd10 0 0 0 0 0 0 bit : initial value : r/w : the trk-value data register (trdr) is a 16-bit write-only register. no read is valid. if a read is attempted, an undefined value is read out. trdr accepts only a word-access. if a byte access is attempted, operation is not assured. set a trk-value correction data to trdr, except a value which is beyond the cycle of the ctl pulse. it is initialized to h'f000 by a reset, stand-by or module stop. section 28 servo circuits rev.3.00 jan. 10, 2007 page 712 of 1038 rej09b0328-0300 28.11 digital filters 28.11.1 overview the digital filters required in servo control make extensive use of multiply-accumulate operations on signed integers (error data) and coefficients. a filter computation circuit (digital filter computation circuit) is provided in on-chip hardware to reduce the load on software, and to improve processing efficiency. figure 28.38 shows a block diagram of the digital filter computation circuit configuration. the filter computation circuit includes a high-speed 24-bit 16-bit multiplier-accumulator, an arithmetic buffer, and an i/o processor. the digital filter computations are carried out by the high- speed multiplier-accumulator. the arithmetic buffer st ores coefficients and gain constants needed in the filter computations, which are referenced by the high-speed multiplier-accumulator. the i/o processor is activated by a frequency generator signal, and determines what operation is carried out. when activated, it reads the speed error and phase error from the speed and phase error detectors and sends them to the accumulator. when the filter computation is completed, the i/o processor reads the result from the accumulator and sends it to a 12-bit pwm. at this time, the accumulation result gain can be controlled. section 28 servo circuits rev.3.00 jan. 10, 2007 page 713 of 1038 rej09b0328-0300 28.11.2 block diagram data bus accumulator end start error latch signal error data (from the error detector) motor control data (to pwm circuit) buffer/ register select & r/w address bus error check accumulation controller la (16 bits), lower accumulator ua (32 bits), upper accumulator md (32 bits), multiplied data data shifter accumulation sequence circuit buffer circuit a, b, g, etc. write-only read-only accumu- lator calculation buffer coefficient register constant register sign controller figure 28.38 block diagram of digital filter circuit section 28 servo circuits rev.3.00 jan. 10, 2007 page 714 of 1038 rej09b0328-0300 16 24 8 z -1 -+ * usn-1 gks + + ofs + - + + 24 8 ws 24 8 vbs 14 4 24 8 xas 24 8 xsn 24 8 vsn 24 8 dfuout 12 24 8 es error detector ? add 0s to 8 bits after the decimal point ? add the same 8-bit value as msb right-bit shift of the decimal point along with go pwm note: go = 64, 32 are optional. go = 64, 32, 16, 8, 4, 2 24 8 usn 16 dzs11 to 0 czs11 to 0 dbs15 to 0 cbs15 to 0 16 dgks15 to 0 cgks15 to 0 dofs15 to 0 cofs15 to 0 dfic cfic dfer15 to 0 cfer15 to 0 das15 to 0 cas15 to 0 bs as gs ks go 16 es pwm digital filter control register speed system 24 8 z -1 -+ * upn-1 gkp + + ofp + - 24 8 tp 24 8 vbp 24 8 xap 24 8 vpn 24 8 y phase direct test output * : see figure 28.42, z -1 initialization circuit. 12 24 8 ep error detector ? add 0s to 8 bits after the decimal point ? add the same 8-bit value as msb pwm notes: 1. 24 8 upn dzp11 to 0 czp11 to 0 dbp15 to 0 cbp15 to 0 16 16 dgkp15 to 0 cgkp15 to 0 dofp15 to 0 cofp15 to 0 dper19 to 0 cper19 to 0 dap15 to 0 cap15 to 0 bp ap gp kp 20 16 16 ep pwm pton note 2 ? dfucr ? option cp/ d p phase system overflows during accumulation are ignored, and values below the decimal point are always omitted. 2. gain control is disabled during phase output. figure 28.39 digital filter representation section 28 servo circuits rev.3.00 jan. 10, 2007 page 715 of 1038 rej09b0328-0300 28.11.3 arithmetic buffer this buffer stores computational data used in th e digital filters. see table 28.14. write access is limited to the gain and coefficient data (z -1 ). other data is used by hardware. none of the data can be read. table 28.14 arithmetic bu ffer register configuration buffer data length arithmetic data gain or coefficient processing data 16 bits 16 bits 16 bits phase system ep upn upn-1 (zp -1 ) vpn tp y ap bp gkp ofp ap epn bp vpn speed system es xsn usn usn-1 (z -1 s) vsn ws as bs gks ofs as xsn bs vsn error output pwm legend: valid bits non-existent bits decimal point section 28 servo circuits rev.3.00 jan. 10, 2007 page 716 of 1038 rej09b0328-0300 28.11.4 register configuration table 28.15 shows the register configuration of the digital filter computation circuit. table 28.15 register configuration name abbrev. r/w size initial value address capstan phase gain constant cgkp w word undetermined h'fd010 capstan speed gain constant cgks w word undetermined h'fd012 capstan phase coefficient a cap w word undetermined h'fd014 capstan phase coefficient b cbp w word undetermined h'fd016 capstan speed coefficient a cas w word undetermined h'fd018 capstan speed coefficient b cbs w word undetermined h'fd01a capstan phase offset cofp w word undetermined h'fd01c capstan speed offset cofs w word undetermined h'fd01e drum phase gain constant dgkp w word undetermined h'fd000 drum speed gain constant dgks w word undetermined h'fd002 drum phase coefficient a dap w word undetermined h'fd004 drum phase coefficient b dbp w word undetermined h'fd006 drum speed coefficient a das w word undetermined h'fd008 drum speed coefficient b dbs w word undetermined h'fd00a drum phase offset dofp w word undetermined h'fd00c drum speed offset dofs w word undetermined h'fd00e drum system speed delay initialization register dzs w word h'f000 h'fd020 drum system phase delay initialization register dzp w word h'f000 h'fd022 capstan system speed delay initialization register czs w word h'f000 h'fd024 capstan system phase delay initialization register czp w word h'f000 h'fd026 drum system digital filter control register dfic r/w byte h'80 h'fd028 capstan system digital filter control register cfic r/w byte h'80 h'fd029 digital filter control register dfucr r/w byte h'c0 h'fd02a section 28 servo circuits rev.3.00 jan. 10, 2007 page 717 of 1038 rej09b0328-0300 28.11.5 register descriptions (1) gain constants (dgkp, dgks, cgkp, cgks) * w 13 * w 14 * w 15 10 32 54 7 * w 6 * w 9 * w 8 * w 11 * w 10 * w * www ww ww 12 * * * * * * bit : initial value : r/w : note: * initial value is uncertain. these registers are 16-bit write-only buffers that set accumulation gain of the digital filter. they cannot be read. they can be accessed by word access only. accumulation gain can be set to gain 1 value as the maximum value. byte access gives unassured results. if read is attempted, an undetermined value is read out. these registers are not initialized by a reset or in standby mode. be sure to write data in them before processing starts. in the digital filter, output gain and accumulation gain can be adjusted separately. take output gain into account when setting accumulation gain. (2) coefficients (dap, dbp, das, dbs, cap, cbp, cas, cbs) * w 13 * w 14 * w 15 10 32 54 7 * w 6 * w 9 * w 8 * w 11 * w 10 * w * www ww ww 12 * * * * * * bit : initial value : r/w : note: * initial value is uncertain. these registers are 16-bit write-only buffers that determine the cutoff frequency f1 and f2. they cannot be read. they can be accessed by word access only. byte access gives unassured results. if read is attempted, an undetermined value is read out. these registers are not initialized by a reset or in standby mode. be sure to write data in them before processing starts. in the digital filter, output gain and accumulation gain can be adjusted separately. take output gain into account when setting accumulation gain. section 28 servo circuits rev.3.00 jan. 10, 2007 page 718 of 1038 rej09b0328-0300 (3) offsets (dofp, dofs, cofp, cofs) * w 13 * w 14 * w 15 10 32 54 7 * w 6 * w 9 * w 8 * w 11 * w 10 * w * www ww ww 12 * * * * * * bit : initial value : r/w : note: * initial value is uncertain. these registers are 16-bit write-only buffers that set the offset level of digital filter output. they cannot be read. they can be accessed by word access only. byte access gives unassured results. if read is attempted, an undetermined value is read out. these registers are not initialized by a reset or in standby mode. be sure to write data in them before processing starts. in this digital filter, output gain adjustment ( 1, 2, 4, 8 ,16, 32, 64) after offset adding is enabled. take output gain into account when setting accumulation gain. (4) delay initialization registers (czp, czs, dzp, dzs) 13 14 15 10 32 54 7 0 w 6 0 w 9 0 w 8 0 w 11 0 w 10 0 www ww ww 12 0 0 0 0 0 0 1 1 1 1 ? ? ? ? bit : initial value : r/w : the delay initialization register is a 16-bit write- only register. it accepts only a word-access. if a byte access is attempted, operation is not assured. if a read is attempted, an undefined value is read out. bits 12 to 15 are reserved, and no write in them is valid. it is initialized to h'f000 by a reset, stand-by or module stop. the msb of 12-bit data (bit 11) is a sign bit. loading to z -1 is performed automatically by bits 4 and 3 of cfic and dfic (czpon, czson, dzpon, dzson). writing in register is always available, but loading in z -1 is not possible when the digital filter is performing calculation processing in relation to such register. in such a case, loading to z -1 will be done the next time computation begins. section 28 servo circuits rev.3.00 jan. 10, 2007 page 719 of 1038 rej09b0328-0300 (5) drum system digital filter control register (dfic) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 0 6 0 7 ? ? r/w r/w r/(w) dpha r/(w) * drov dzpon dzson dsg2 dsg1 dsg0 1 note: * only 0 can be written bit : initial value : r/w : dfic is an 8-bit readable/writable register that controls the status of the drum system digital filter and operating mode. it can be accessed by byte access only. word access gives unassured results. bit 7 is a reserved bit. writes are disabled. if read is attempted, an undetermined value is read out. dfic is initialized to h'80 by a reset, and in standby mode and module stop mode. bit 7 ? reserved: reads and writes are both disabled. bit 6 ? drum system range over flag (drov): this flag is set to 1 when the result of a drum system filter computation exceeds 12 bits in width. to clear this flag, write 0. bit 6 drov description 0 indicates that the filter computation result did not exceed 12 bits (initial value) 1 indicates that the filter computation result exceeded 12 bits bit 5 ? drum phase system filter computation start bit (dpha): starts or stops filter processing for the drum phase system. bit 5 dpha description 0 phase system filter computations are disabled phase computation result (y) is not added to es (see figure 28.39) (initial value) 1 phase system filter computations are enabled bit 4 ? drum phase system z -1 initialization bit (dzpon): reflects the dzp value on z -1 of the phase system when computation processing of the drum phase system begins. if 1 was written, it is reflected on the computation, and then cleared to 0. set this bit after writing data to dzp. bit 4 dzpon description 0 dzp value is not reflected on z -1 of the phase system (initial value) 1 dzp value is reflected on z -1 of the phase system section 28 servo circuits rev.3.00 jan. 10, 2007 page 720 of 1038 rej09b0328-0300 bit 3 ? drum speed system z -1 initialization bit (dzson): reflects the dzs value on z -1 of the speed system when computation processing of the drum speed system begins. if 1 was written, it is reflected on the computation, and then cleared to 0. set this bit after writing data to dzs. bit 3 dzson description 0 dzs value is not reflected on z -1 of the speed system (initial value) 1 dzs value is reflected on z -1 of the speed system bits 2 to 0 ? drum system output gain control bits (dsg2, dsg1, dsg0): control the gain output to drmpwm. bit 2 bit 1 bit 0 dsg2 dsg1 dsg0 description 0 1 (initial value) 0 1 2 0 4 0 1 1 8 0 16 0 1 ( 32) * 0 ( 64) * 1 1 1 invalid (do not set) note: * setting optional section 28 servo circuits rev.3.00 jan. 10, 2007 page 721 of 1038 rej09b0328-0300 (6) capstan system digital filter control register (cfic) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 0 6 0 7 ? ? r/w r/w r/(w) cpha r/(w) * crov czpon czson csg2 csg1 csg0 1 note: * only 0 can be written. bit : initial value : r/w : cfic is an 8-bit readable/writable register that controls the status of the capstan system digital filter and operating mode. it can be accesse d by byte access only. word access gives unassured results. bit 7 is a reserved bit. writes are disabled. if read is attempted, an undetermined value is read out. cfic is initialized to h'80 by a reset, and in standby mode and module stop mode. bit 7 ? reserved: reads and writes are both disabled. bit 6 ? capstan system range over flag (crov): this flag is set to 1 when the result of a capstan system filter computation exceeds 12 bits in width. to clear this flag, write 0. bit 6 crov description 0 indicates that the filter computation result did not exceed 12 bits (initial value) 1 indicates that the filter computation result exceeded 12 bits bit 5 ? capstan phase system filter start bit (cpha): starts or stops filter processing for the capstan phase system. bit 5 cpha description 0 phase filter computations are disabled phase computation result (y) is not added to es (see figure 28.39) (initial value) 1 phase filter computations are enabled section 28 servo circuits rev.3.00 jan. 10, 2007 page 722 of 1038 rej09b0328-0300 bit 4 ? capstan phase system z -1 initialization bit (czpon): reflects the czp value on z -1 of the capstan phase system when computation processing of the phase system begins. if 1 was written, it is reflected on the computation, and then cleared to 0. set this bit after writing data to czp. bit 4 czpon description 0 czp value is not reflected on z -1 of the phase system (initial value) 1 czp value is reflected on z -1 of the phase system bit 3 ? capstan speed system z -1 initialization bit (czson): reflects the czs value on z -1 of the capstan speed system when computation pr ocessing of the speed system begins. if 1 was written, it is reflected on the computation, and then cleared to 0. set this bit after writing data to czs. bit 3 czson description 0 czs value is not reflected on z -1 of the speed system (initial value) 1 czs value is reflected on z -1 of the speed system bits 2 to 0 ? capstan system gain control bits (csg2, csg1, csg0): control the gain output to cappwm. bit 1 bit 2 bit 0 csg2 csg1 csg0 description 0 1 (initial value) 0 1 2 0 4 0 1 1 8 0 16 0 1 ( 32) * 0 ( 64) * 1 1 1 invalid (do not set) note: * setting optional section 28 servo circuits rev.3.00 jan. 10, 2007 page 723 of 1038 rej09b0328-0300 (7) digital filter control register (dfucr) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 0 6 7 ? ? ? ? r/w r/w r/w pton cp/dp cfeps dfeps cfess dfess 1 1 bit : initial value : r/w : dfucr is an 8-bit readable/writable register which controls the operation of the digital filter. it accepts a byte-access only. if it was word-accessed, operation is not assured. bits 7 and 6 are reserved. no write in them is valid. it is initialized to h'00 by a reset, stand-by or module stop. bits 7 and 6 ? reserved: no read or write is valid. if a read is attempted, an undefined value is read out. bit 5 ? phase system computation result pwm output bit (pton): outputs the computation results of only the phase system to pwm. (the computation results of the drum phase system is output to the cappwm pin, and that of the capstan phase system is output to the drmpwm pin.) bit 5 pton description 0 outputs the results of ordinary computation of the filter to pwm pin (initial value) 1 outputs the computation results of only the phase system to pwm pin bit 4 ? pwm output selection bit (cp/ dp ): selects whether the phase system computation results when pton was set to 1 is output to the drum or capstan. the pwm of the selected side outputs ordinary filter computation results (speed system of mix). bit 4 cp/ dp description 0 outputs the drum phase system computation results (cappwm) (initial value) 1 outputs the capstan phase system computation results (drmpwm) section 28 servo circuits rev.3.00 jan. 10, 2007 page 724 of 1038 rej09b0328-0300 bit 3 ? capstan phase system error data transfer bit (cfeps): transfers the capstan phase system error data to the digital filter when the data write is enforced. bit 3 cfeps description 0 error data is transferred by dvcfg2 signal latching (initial value) 1 error data is transferred when the data is written bit 2 ? drum phase system error da ta transfer bit (dfeps): transfers the drum phase system error data to the digital filter when the data write is enforced. bit 2 dfeps description 0 error data is transferred by hsw (nhsw) signal latching (initial value) 1 error data is transferred when the data is written bit 1 ? capstan speed system error data transfer bit (cfess): transfers the capstan speed system error data to the digital filter when the data write is enforced. bit 1 cfess description 0 error data is transferred by dvcfg signal latching (initial value) 1 error data is transferred when the data is written bit 0 ? drum speed system error data transfer bit (dfess): transfers the drum speed system error data to the digital filter when the data write is enforced. bit 0 dfess description 0 error data is transferred by ncdfg signal latching (initial value) 1 error data is transferred when the data is written section 28 servo circuits rev.3.00 jan. 10, 2007 page 725 of 1038 rej09b0328-0300 28.11.6 filter characteristics (1) lag-lead filter a filter required for a servo loop is built in the hardware. this filter uses an iir (infinite impulse response) type digital filter (another type of the di gital filter is fir, i.e. finite impulse response type). this digital filter circuit implements a lag-lead filter, as shown in figure 28.40. r1 r2 c + input output figure 28.40 lag-lead filter the transfer function g (s) is expressed by the following equation. s 1 + 2f 2 transfer function g (s) = s 1 + 2 f 1 f 1 = 1/2 c (r1 + r2) f 2 = 1/2 cr2 section 28 servo circuits rev.3.00 jan. 10, 2007 page 726 of 1038 rej09b0328-0300 (2) frequency characteristics the computation circuit repeats computation of the function, which is obtained by s-z conversion according to bi-linear approximati on of the transfer function on the s-plane. figure 28.41 shows the frequency characteristics of the lag-lead filter. f1 0 f2 frequency (hz) 20log (f1/f2) gain (db) phase (deg) figure 28.41 frequency characteristics of the lag-lead filter the pulse transfer function g(z) is obtained by the bi-linear approximation of the transfer function g (s). in the transfer g (s), s = 2 ts 1 ? z ?1 1 + z ?1 where, assumed that z ?1 = e -j ts , g (z) = g 2 ts 1 + az ?1 1 + bz ?1 g (z) = ts + 1 f 2 ts + 1 f 1 a = ts ? 1 f 2 ts + 1 f 2 b = ts ? 1 f 1 ts + 1 f 1 ts: sampling cycle (sec) section 28 servo circuits rev.3.00 jan. 10, 2007 page 727 of 1038 rej09b0328-0300 28.11.7 operations in case of transient response in case of transient response when the motor is activated, the digital f ilter computation circuit must prevent computation due to a large error. the convergence of the computations becomes slow and servo retraction becomes de teriorating if a large error is i nput to the filter circuit when it is performing repeated computations. to prevent them from occurring, operate the filter (set constants a and b) after pulling in the speed and phase within a certain range of error, initialize z -1 (set initial values in czp, czs, dzp, dzs) (see section 28.11.8, initialization of z -1 ), or use the error data limit function (see section regarding the error detector). 28.11.8 initialization of z -1 z -1 can be initialized by its delay initialization register (czp, czs, dzp, dzs). loading to z -1 is performed automatically by bits 4 and 3 of cfic and dfic (czpon, czson, dzpon, dzson). writing in register is always available, but loading in z -1 is not possible when the digital filter is performing calculation processing in relation to such register. in such a case, loading to z -1 will be done the next time computation begins. fi gure 28.42 shows the initialization circuit of z -1 . the delay initialization register sets 12-bit data. the msb (bit 11) is a signed bit. z -1 has 24 bits for integers and 8 bits for decimals. accordingly, the same value as the signed bits should be set in the 13 bits on the msb side of z -1 , and 0 in the entire decimal section. example: value set for the delay initialization register value set for z -1 msb 0 msb set here the value in the signed bits fixed 1 0000000000 1111111111111 0 0 0 0 0 0 0 0 0 0 0 00000000 section 28 servo circuits rev.3.00 jan. 10, 2007 page 728 of 1038 rej09b0328-0300 ww internal bus z -1 initiali- zation bit dzson dzpon czson czson w 16 16 12 24 8 w delay initialization register z -1 usn -+ res note: msb of 12-bit data to be written in the delay initialization register is a sign bit. usn - 1 + + xn vn dbs15 to 0 dbp15 to 0 cbs15 to 0 cbp15 to 0 dzs11 to 0 dzp11 to 0 czs11 to 0 czp11 to 0 das15 to 0 dap15 to 0 cas15 to 0 cap15 to 0 ab figure 28.42 z -1 initialization circuit section 28 servo circuits rev.3.00 jan. 10, 2007 page 729 of 1038 rej09b0328-0300 28.12 additional v signal generator 28.12.1 overview the circuit described in this section outputs an a dditional vertical sync signal to take the place of vsync in special playback. it is activated at both edges of the hsw signal output by the head- switch timing generator. the head-switch timing generator also outputs a vpulse signal containing the additional vertical sync pulse itself, and an mlevel signal that defines the width of the additional vertical sync signal including the equalizing pulses. the additional v signal is output at a three-level output pin (vpulse). figure 28.43 shows the additional v signal control circuit. csync additional v pulse osch vpulse signal mlevel signal sync detector hsw timing generator additional v pulse generator figure 28.43 additional v pulse control circuit hsw timing generator: this circuit generates signals that are synchronized with head switching. it should be programmed to generate th e mlevel and vpulse signals at edges of the hsw signal (videoff). for details, see section 28.4, hsw (head-switch) timing generator. sync detector: this circuit detects pulses of the width specified by vtr or htr from the signal input at the csync pin and generates an internal horizontal sync signal (osch). the sync detector has an interpolation function, so osch has a regular period even if there are horizontal sync dropouts in the signal received at the pin. for details, see section 28.15, sync signal detector. section 28 servo circuits rev.3.00 jan. 10, 2007 page 730 of 1038 rej09b0328-0300 28.12.2 pin configuration table 28.16 summarizes the pin configuration of the additional v signal. table 28.16 pin configuration name abbrev. i/o function additional v pulse pin vpulse output output of additional v signal synchronized to videoff 28.12.3 register configuration table 28.17 summarizes the register that controls the additional v signal. table 28.17 register configuration name abbrev. r/w size initial value address additional v control register addvr r/w byte h'e0 h'fd06f 28.12.4 register description additional v control register (addvr) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 1 6 7 ? ? ? ? ? ? r/w r/w hmsk hi-z cut vpon pol 11 bit : initial value : r/w : addvr is an 8-bit readable/writable register. it is initialized to h'e0 by a reset, and in standby mode. bits 7 to 5 ? reserved: writes are disabled. if a read is attempted, an undefined value is read out. bit 4 ? osch mask bit (hmsk): masks the osch signal in the additional v pulse. bit 4 hmsk description 0 osch is added in (initial value) 1 osch is not added in section 28 servo circuits rev.3.00 jan. 10, 2007 page 731 of 1038 rej09b0328-0300 bit 3 ? high impedance bit (hi-z): set to 1 when the intermediate level is generated by an external circuit. bit 3 hi-z description 0 vpulse is a three-level output pin (initial value) 1 vpulse is a three-state output pin (high, low, or high-impedance) bits 2 to 0 ? additional v output control bit (cut, vpon, pol): these bits control the output at the additional v pin. bit 2 bit 1 bit 0 cut vpon pol description 0 * low level (initial value) 0 negative polarity (see figure 28.46) 0 1 1 positive polarity (see figure 28.45) 1 * 0 intermediate level (high impedance if hi-z bit = 1) 1 high level legend: * don't care. section 28 servo circuits rev.3.00 jan. 10, 2007 page 732 of 1038 rej09b0328-0300 28.12.5 additional v pulse signal figure 28.44 shows the additional v pulse signal. the mlevel and vpulse signals are generated by the head-switch timing generator. the osch signal is combined with these to produce equalizing pulses. the polarity can be selected by the pol bit in the additional v register (addvr). the vpulse pin outputs a low level by a reset, and in standby mode and module stop mode. r/w r/w addvr addvr r/w internal bus r/w r/w cut vpon hmsk pol hi-z stby v cc v cc v ss v ss rs rs vpulse pin osch vpulse mlevel legend: stby: power-down mode signal vpulse, mlevel: signal from the hsw timing generator rs: voltage division resistance (20 k : reference value) figure 28.44 additional v pin additional v pulses when sync signal is not detected: with additional v pulses, the pulse signal (osch) detected by the sync detector is superimposed on the vpulse and mlevel signals generated by the head-switch timing generator. if there is a lot of noise in the input sync signal (csync), or a pulse is missing, osch will be a complementary pulse, and therefore an h pulse of the period set in hrtr and hpwr will be superim posed. in this case, there may be slight timing drift compared with the normal sync signal, depending on the hrtr and hpwr setting, with resultant discontinuity. if no sync signal is input, the additional v pulse is generated as a complementary pulse. set the sync detector registers and activate the sync detector by manipulating the syct bit in the sync signal control register (syncr). see section 28.15.7, sync signal detector activation. section 28 servo circuits rev.3.00 jan. 10, 2007 page 733 of 1038 rej09b0328-0300 figures 28.45 and 28.46 show the additional v pulse timing charts. hsw signal edge osch vpon = 1, cu t= 0, pol = 1 additional v pulse vpulse signal mlevel signal figure 28.45 additional v pulse when positive polarity is specified section 28 servo circuits rev.3.00 jan. 10, 2007 page 734 of 1038 rej09b0328-0300 hsw signal edge osch vpon = 1, cut = 0, pol = 0 additional v pulse vpulse signal mlevel signal figure 28.46 additional v pulse when negative polarity is specified section 28 servo circuits rev.3.00 jan. 10, 2007 page 735 of 1038 rej09b0328-0300 28.13 ctl circuit 28.13.1 overview the ctl circuit includes a schmitt amplifier that amplifies and reshapes the ctl input, then outputs it as the pb-ctl signal to the servo, linear time counter, and other circuits. the pb-ctl signal is also sent to a duty discriminator in the ctl circuit that detects and records viss, asm, and vass marks. a rec-ctl amplifier is included in the record circuits. detection and recording whether the ctl pulse pattern is long or short can also be enabled to correspond to the wide-aspect. the following operating modes can be selected by settings in the ctl mode register: ? duty discrimination viss detect, asm detect, vass detect, l/s bit pattern detect ? ctl record viss record, asm record, vass r ecord, l/s bit pattern detect ? rewrite trapezoid waveform generator section 28 servo circuits rev.3.00 jan. 10, 2007 page 736 of 1038 rej09b0328-0300 28.13.2 block diagram figure 28.47 shows a block diagram of the ctl circuit. + - pb-ctl fw/rv ctl(-) ctl(+) schmitt amplifier ctl mode ctl detector duty des- criminator bit pattern register viss detect viss control circuit viss write duty i/o flag write control circuit rec- ctl amplifier internal bus ref30x irrctl figure 28.47 block diagram of ctl circuit section 28 servo circuits rev.3.00 jan. 10, 2007 page 737 of 1038 rej09b0328-0300 28.13.3 pin configuration table 28.18 summarizes the pin configuration of the ctl circuit. table 28.18 pin configuration name abbrev. i/o function ctl (+) i/o pin ctl (+) i/o ctl signal input/output ctl (?) i/o pin ctl (?) i/o ctl signal input/output ctl bias input pin ctl bias input ctl primary amplifier bias supply ctl amp (o) output pin ctlamp (o) output ctl amplifier output ctl smt (i) input pin ctlsmt (i) input ctl schmitt amplifier input ctl fb input pin ctl fb input ctl amplifier high-range characteristics control ctl ref output pin ctl ref output ctl amplifier reference voltage output 28.13.4 register configuration table 28.19 shows the register configuration of the ctl circuit. table 28.19 register configuration name abbrev. r/w size initial value address ctl control register ctcr r/w byte h'30 h'fd080 ctl mode register ctlm r/w byte h'00 h'fd081 rec-ctl duty data register 1 rcdr1 w word h'f000 h'fd082 rec-ctl duty data register 2 rcdr2 w word h'f000 h'fd084 rec-ctl duty data register 3 rcdr3 w word h'f000 h'fd086 rec-ctl duty data register 4 rcdr4 w word h'f000 h'fd088 rec-ctl duty data register 5 rcdr5 w word h'f000 h'fd08a duty i/o register di/o r/w byte h'f1 h'fd08c bit pattern register btpr r/w byte h'ff h'fd08d section 28 servo circuits rev.3.00 jan. 10, 2007 page 738 of 1038 rej09b0328-0300 28.13.5 register descriptions (1) ctl control register (ctcr) 0 0 1 0 r 2 0 w 3 0 4 1 w 5 1 6 0 7 w w w fslb w fslc 0 w nt/pl fsla ccs lctl unctl slwm bit : initial value : r/w : the ctl control register (ctcr) controls pb-ctl rewrite and sets the slow mode. when a ctl pulse cannot be detected with the input amplifier gain set at the ctl gain control register (ctlgr) in the pb-ctl circuit, bit 1 (unctl) of ctcr is set to 1. it is automatically cleared to 0 when a ctl pulse is detected. ctcr is an 8-bit readable/writable register. however, bit 1 is read-only, and the rest is write-only. ctcr is initialized to h'30 by a reset, and in standby and module stop mode. bit 7 ? ntsc/pal selection bit (nt/pl): selects the period of the rewrite circuit. bit 7 nt/pl description 0 ntsc mode (frame rate: 30 hz) (initial value) 1 pal mode (frame rate: 25 hz) bits 6 to 4 ? frequency selection bits (fsla, fslb, fslc): these bits select the operating frequency of the ctl rewrite circuit. they should be set according to fosc. bit 6 bit 5 bit 4 fslc fslb fsla description 0 reserved (do not set) 0 1 reserved (do not set) 0 fosc = 8 mhz 0 1 1 fosc = 10 mhz (initial value) 1 * * reserved (do not set) legend: * don't care. section 28 servo circuits rev.3.00 jan. 10, 2007 page 739 of 1038 rej09b0328-0300 bits 3 ? clock source selection bit (ccs): selects clock source of ctl. bit 3 ccs description 0 s (initial value) 1 s/2 bit 2 ? long ctl bit (lctl): sets the long ctl detection mode. bit 2 lctl description 0 clock source (ccs) operates at the setting value (initial value) 1 clock source (ccs) operates for further 8-division after operating at the setting value bit 1 ? ctl undetected bit (unctl): indicates the ctl pulse det ection status at the ctl input amplifier sensitivity set at the ctl gain control register (ctlgr). bit 1 unctl description 0 detected (initial value) 1 undetected bit 0 ? mode selection bit (slwm): selects ctl mode. bit 0 slwm description 0 normal mode (initial value) 1 slow mode section 28 servo circuits rev.3.00 jan. 10, 2007 page 740 of 1038 rej09b0328-0300 (2) ctl mode register (ctlm) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 0 6 0 7 r/w r/w r/w fw/rv r/w rec/pb 0 r/w asm md4 md3 md2 md1 md0 bit : initial value : r/w : the ctl mode register (ctlm) is an 8-bit readable/writable register that controls the operating state of the ctl circuit. if 1 is written in bits md3 and md2, they will be cleared to 0 one cycle ( ) later. ctlm is initialized to h'00 by a reset, and in standby mode and module stop mode. when ctl is being stopped, only bits 7, 6, and 5 operate. note: do not set any value other than the setting value for each mode (see table 28.20). bits 7 and 6 ? record/playback mode bits (asm, rec/ pb ): these bits switch between record and playback. combined with bits 4 to 0 (md4 to md0), they support the viss, vass, and asm mark functions. bit 7 bit 6 asm rec/ pb description 0 playback mode (initial value) 0 1 record mode 1 0 assemble mode 1 invalid (do not set) bit 5 ? direction bit (fw/rv): selects the direction in playback. clear this bit to 0 during record. figure 28.48 shows the pb-ctl signal in forward and reverse. bit 5 fw/rv description 0 forward (initial value) 1 reverse section 28 servo circuits rev.3.00 jan. 10, 2007 page 741 of 1038 rej09b0328-0300 ctl input pb-ctl fwd rev figure 28.48 internal pb-ctl signal in forward and reverse bits 4 to 0 ? ctl mode selection bits (md4 to md0): these bits select the detect, record, and rewrite modes for viss, vass, and asm marks. if 1 is written in bits md3 and md2, they will be cleared to 0 one cycle ( ) later. the 5 bits from md4 to md0 are used in combination with bits 7 and 6 (asm and rec/ pb ). table 28.20 describes the modes. table 28.20 ctl mode functions bit asm rec/ pb fw/ rv md4 md3 md2 md1 md0 mode description 0 0 0/1 0 0 0 0 0 vass detect (duty detect) pb-ctl duty discrimination (initial value) ? duty i/o flag is set to 1 if duty 44% is detected ? duty i/o flag is cleared to 0 if duty < 44% is detected ? interrupt request is generated when one ctl pulse has been detected 0 1 0 0 0 0 0 0 vass record ? if 0 is written in the duty i/o flag, rec-ctl is generated and recorded with the duty cycle set by register rcdr2 or rcdr3 ? if 1 is written in the duty i/o flag, rec-ctl is generated and recorded with the duty cycle set by register rcdr4 or rcdr5 0 0 0 1 0 0 1 0 vass rewrite same as above (vass record; trapezoid waveform circuit operation) section 28 servo circuits rev.3.00 jan. 10, 2007 page 742 of 1038 rej09b0328-0300 bit asm rec/ pb fw/rv md4 md3 md2 md1 md0 mode description 0 0 0/1 0 1 0 0 1 viss detect (index detect) the duty i/o flag is set to 1 at the point of write access to register ctlm ? the 1 pulses recognized by the duty discrimination circuit are counted in the viss control circuit ? the duty i/o flag is cleared to 0, indicating viss detection, when the value set at vctr register is repeatedly detected ? an interrupt request is generated when viss is detected 0 1 0 0 0 1 0 1 viss record (index record) ? 64 pulse data with 0 pulse data at both edges are written (index record) ? the index bit string is written through the duty i/o flag ? an interrupt request is generated at the end of viss recording 0 0 0 0 0 1 0 1 viss rewrite same as above (viss record; trapezoid waveform circuit operation) 0 0 0 1 0 0 0 0 viss initialize viss write is forcibly aborted 1 0 0/1 0 0 0 0 0 asm mark detect asm mark detection ? the duty i/o flag is cleared to 0 when pb-ctl duty 66% is detected ? an interrupt request is generated when an asm mark is detected 0 1 0 1 0 0 0 0 asm mark record ? an asm mark is recorded by writing 0 in the duty i/o flag ? an interrupt is requested for every one ctl pulse ? rec-ctl is generated and recorded with the duty cycle set by register rcdr3 section 28 servo circuits rev.3.00 jan. 10, 2007 page 743 of 1038 rej09b0328-0300 (3) rec-ctl duty data register 1 (rcdr1) 13 14 15 10 32 54 76 98 11 10 cmt11 w 12 1 1 11 ? ? ?? ? ? ?? 0 cmt10 w 0 cmt13 w 0 cmt12 w 0 cmt15 w 0 cmt14 w 0 cmt17 w 0 cmt16 w 0 cmt19 w 0 cmt18 w 0 cmt1b w 0 cmt1a w 0 bit : initial value : r/w : rcdr1 is a register that sets the rec-ctl risi ng timing. this setting is valid only for recording and rewriting, and is not used in detection. rcdr1 is a 12-bit write-only register, and can be accessed by word access only. byte access gives unassured results. if read is attempted, an undetermined value is read out. bits 15 to 12 are reserved and are not affected by write access. rcdr1 is initialized to h'f000 by a reset, and in standby mode, module stop mode and ctl stop mode. the value to set in rcdr1 can be calculated from the transition timing t1 and the servo clock frequency s by the equation given below. see figure 28.60. any transition timing can be set. however, the timing should be selected with attention to playback tracking compensation and the latch timing for phase control. rcdr1 = t1 s/64 s is the servo clock frequency (= f osc /2) in hz, and t1 is the set timing (s). note: 0 cannot be set to rcdr1. set a value 1 or above. (4) rec-ctl duty data register 2 (rcdr2) 1111 13 14 15 10 32 54 76 98 11 10 cmt21 w 12 ? ? ?? ? ? ?? 0 cmt20 w 0 cmt23 w 0 cmt22 w 0 cmt25 w 0 cmt24 w 0 cmt27 w 0 cmt26 w 0 cmt29 w 0 cmt28 w 0 cmt2b w 0 cmt2a w 0 bit : initial value : r/w : rcdr2 is a register that sets 1 pulse (short) falling timing of rec-ctl at recording and rewriting, and detects long/short pulses at detecting. rcdr2 is a 12-bit write-only register, and can be accessed by word access only. byte access gives unassured results. if read is attempted, an undetermined value is read out. bits 15 to 12 are reserved and are not affected by write access. rcdr2 is initialized to h'f000 by a reset, and in standby mode, module stop mode, and ctl stop mode. at recording, the value to set in rcdr2 can be calculated from the transition timing t2 and the servo clock frequency s by the equation given below, and the set value should be 25% of the duty obtained by the equation. see figure 28.60. section 28 servo circuits rev.3.00 jan. 10, 2007 page 744 of 1038 rej09b0328-0300 rcdr2 = t2 s/64 s is the servo clock frequency (= f osc /2) in hz, and t2 is the set timing (s). at bit pattern detection, set the 1 pulse long/short threshold value at fwd. see figure 28.56. rcdr2 = t2' s/64 s is the servo clock frequency (= f osc /2) in hz, and t2' is the 1 pulse long/short threshold value at fwd (s). (5) rec-ctl duty data register 3 (rcdr3) 1111 13 14 15 10 32 54 76 98 11 10 cmt31 w 12 ? ? ?? ? ? ?? 0 cmt30 w 0 cmt33 w 0 cmt32 w 0 cmt35 w 0 cmt34 w 0 cmt37 w 0 cmt36 w 0 cmt39 w 0 cmt38 w 0 cmt3b w 0 cmt3a w 0 bit : initial value : r/w : rcdr3 is a register that sets 1 pulse (long) and assemble mark falling timing of rec-ctl at recording and rewriting, and detects long/short pulses at detecting. rcdr3 is a 12-bit write-only register, and can be accessed by word access only. byte access gives unassured results. if read is attempted, an undetermined value is read out. bits 15 to 12 are reserved and are not affected by write access. rcdr3 is initialized to h'f000 by a reset, and in standby mode, module stop mode, and ctl stop mode. at recording, the value to set in rcdr3 can be calculated from the transition timing t3 and the servo clock frequency s by the equation given below. the set value should be 30% of the duty when the rcdr3 is used for rec-ctl 1 pulse (long), and 67% to 70% when used for assemble mark. the set value must not exceed th e value of ref30x. see figure 28.60. rcdr3 = t3 s/64 s is the servo clock frequency (= f osc /2) in hz, and t3 is the set timing (s). at bit pattern detection, set the 0 pulse long/short threshold value at fwd. see figure 28.56. rcdr3 = t3' s/64 s is the servo clock frequency (= f osc /2) in hz, and t3' is the 0 pulse long/short threshold value at fwd (s). section 28 servo circuits rev.3.00 jan. 10, 2007 page 745 of 1038 rej09b0328-0300 (6) rec-ctl duty data register 4 (rcdr4) 1111 13 14 15 10 32 54 76 98 11 10 cmt41 w 12 ? ? ?? ? ? ?? 0 cmt40 w 0 cmt43 w 0 cmt42 w 0 cmt45 w 0 cmt44 w 0 cmt47 w 0 cmt46 w 0 cmt49 w 0 cmt48 w 0 cmt4b w 0 cmt4a w 0 bit : initial value : r/w : rcdr4 sets the timing of falling edge of the 0 pulse (short) of rec-ctl in record or rewrite mode. in detection mode, it is used to detect the long/short pulse. rcdr4 is a 12-bit write-only register. it accepts onl y a word-access. if a byte access is attempted, operation is not assured. if a read is attempted, an undefined value is read out. bits 15 to 12 are reserved, and no write in them is valid. it is initialized to h'f000 by a reset, stand-by, module stop or ctl stop. in record mode, set a value with the 57.5% duty cycle obtained from the transition timing t4 corresponding to the servo clock frequency s according to the following equation. see figure 28.60. rcdr4 = t4 s/64 s is the servo clock frequency (= f osc /2) in hz, and t4 is the set timing (s). at bit pattern detection, set the 0 pulse long/short threshold value at rev. see figure 28.56. rcdr4 = h'fff ? (t4' s/80) s is the servo clock frequency (= f osc /2) in hz, and t4' is the 0 pulse long/short threshold value at rev (s). (7) rec-ctl duty data register 5 (rcdr5) 1111 13 14 15 10 32 54 76 98 11 10 cmt51 w 12 ? ? ?? ? ? ?? 0 cmt50 w 0 cmt53 w 0 cmt52 w 0 cmt55 w 0 cmt54 w 0 cmt57 w 0 cmt56 w 0 cmt59 w 0 cmt58 w 0 cmt5b w 0 cmt5a w 0 bit : initial value : r/w : rcdr5 sets the timing of falling edge of the 0 pulse (long) of rec-ctl in record or rewrite mode. in detection mode, it is used to detect the long/short pulse. rcdr5 is a 12-bit write-only register. it accepts onl y a word-access. if a byte access is attempted, operation is not assured. if a read is attempted, an undefined value is read out. bits 15 to 12 are reserved, and no write in them is valid. it is initialized to h'f000 by a reset, stand-by, module stop or ctl stop. in record mode, set a value with the 62.5% duty cycle obtained from the transition timing t5 corresponding to the servo clock frequency s according to the following equation. see figure 28.60. section 28 servo circuits rev.3.00 jan. 10, 2007 page 746 of 1038 rej09b0328-0300 rcdr5 = t5 s/64 s is the servo clock frequency (= f osc /2) in hz, and t5 is the set timing (s). at bit pattern detection, set the 1 pulse long/short threshold value at rev. see figure 28.56. rcdr5 = h'fff ? (t5' s/80) s is the servo clock frequency (= f osc /2) in hz, and t5' is the 1 pulse long/short threshold value at rev (s). (8) duty i/o register (di/o) 0 1 1 0 r/(w) * 2 0 w 3 0 4 ? ? 5 1 6 7 r/w w w vctr0 1 w vctr1 1 w vctr2 bpon bps bpf di/o 1 note: * only 0 can be written. bit : initial value : r/w : the duty i/o register is an 8-bit register that confirms and determines the operating status of the ctl circuit. it is initialized to h'f1 by a reset, and in standby mode, module stop mode, and ctl stop mode. bits 7, 6, and 5 ? viss interrupt setting bits (vctr2, vctr1, vctr0): combination of vctr2, vctr1, and vctr0 sets number of 1 puls e detection in viss detection mode. detecting the set number of pulse detection is considered as viss detection, and an interrupt request is generated. note: when changing the detection pulse number during viss detection, initialize viss first, then resume the viss detection setting. bit 7 bit 6 bit 5 vctr2 vctr1 vctr0 number of 1-pulse for detection 0 2 0 1 4 (sync mark) 0 6 0 1 1 8 (mark a, short) 0 12 (mark a, long) 0 1 16 0 24 (mark b) 1 1 1 32 section 28 servo circuits rev.3.00 jan. 10, 2007 page 747 of 1038 rej09b0328-0300 bit 4 ? reserved: writes are disabled. when read, undefined values are obtained. bit 3 ? bit pattern detection on/off bit (bpon): determines on or off of bit pattern detection. note: when writing 1 to the bpon bit, be sure to set appropriate data to rcdr2 to rcdr5 beforehand. bit 3 bpon description 0 bit pattern detection off (initial value) 1 bit pattern detection on bit 2 ? bit pattern detection start bit (bps): starts 8-bit bit pattern detection. when 1 is written to this bit, it returns to 0 after one cycle. writing 0 to this bit does not affect operation. bit 2 bps description 0 normal status (initial value) 1 starts 8-bit bit pattern detection bit 1 ? bit pattern detection flag (bpf): sets the flag every time 8-bit pb-ctl is detected in pb or asm mode. to clear the flag, write 0 after reading 1. bit 1 bpf description 0 bit pattern (8-bit) is not detected (initial value) 1 bit pattern (8-bit) is detected bit 0 ? duty i/o register (di/o): this flag has different functions for record and playback. in viss detect mode, vass detect mode, and asm mark detect mode, this flag indicates the detection result. in viss record or rewrite mode, this flag controls the write control circuit so as to write an index code, operating according to a control signal from the viss control circuit. in viss record or rewrite mode and asm mark record mode, this flag is used for write control, one ctl pulse at a time. this bit can always be written to, but this does not affect the write control circuit in modes other than viss record or re write, and asm record. section 28 servo circuits rev.3.00 jan. 10, 2007 page 748 of 1038 rej09b0328-0300 viss detect mode and vass detect mode: the duty i/o flag indicates the result of duty discrimination. the duty i/o flag is 1 when the duty cycle of the pb-ctl signal is equal to or above 44% (a 0 pulse in the ctl signal). the duty i/o flag is 0 when the duty cycle of the pb-ctl signal is below 43% (a 1 pulse in the ctl signal). asm mark detect mode: the duty i/o flag indicates the result of duty discrimination. the duty i/o flag is 0 when the duty cycle of the pb-ctl signal is equal to or ab ove 66% (when an asm mark is detected). the duty i/o flag is 1 when the duty cycle of the pb-ctl signal is below 65% (when an asm mark is not detected). viss record mode and viss rewrite mode: the duty i/o flag operates according to a control signal from the viss control circuit, and controls the write control circuit so as to write an index code. the write timing is set in the rec-ctl duty data registers (rcdr1 to rcdr5). for viss recording, registers rcdr1 to rcdr5 are set with reference to ref30x. for viss rewrite, registers rcdr2 to rcdr5 are set with reference to the low-to-high transition of the previously recorded ctl signal, and the write is carried out through the trapezoid waveform generator. set the duty timing for a 1 pulse (short) in rcdr2, for a 1 pulse (long) in rcdr3, for a 0 pulse (short) in rcdr4, and for a 0 pulse (long) in rcdr5. while an index code is being written, the value of the bit being written can be read by reading the duty i/o flag. if the ctl signal currently being written is a 0 pulse, the duty i/o flag will read 1. if the ctl signal currently being written is a 1 pulse, the duty i/o flag will read 0. vass record mode and vass rewrite mode: the duty i/o flag is used for write control, one ctl pulse at a time. the write timing is set in the rec-ctl duty data registers (rcdr1 to rcdr5). for vass recording, registers rcdr1 to rcdr5 are set with reference to ref30x. for vass rewrite, registers rcdr2 to rcdr5 are set with reference to the low-to-high transition of the previously recorded ctl signal, and the write is carried out through the trapezoid waveform generator. set the duty timing for a 1 pulse (short) in rcdr2, for a 1 pulse (long) in rcdr3, for a 0 pulse (short) in rcdr4, and for a 0 pulse (long) in rcdr5. if 0 is written in the duty i/o flag, a ctl pulse will be written with a duty cycle set in rcdr2 and rcdr3, referenced to the immediately following ref30x. if 1 is written in the duty i/o flag, a ctl pulse will be written with a duty cycle se t in rcdr4 and rcdr5, referenced to the immediately following ref30x. asm record mode: the duty i/o flag is used for write control, one ctl pulse at a time. the write timing is set in the rec-ctl duty data registers (rcdr1 and rcdr3). if 0 is written in the duty i/o flag, a ctl section 28 servo circuits rev.3.00 jan. 10, 2007 page 749 of 1038 rej09b0328-0300 pulse will be written with a duty cycle of 67% to 70% as set in rcdr3, referenced to the immediately following ref30x. (9) bit pattern register (btpr) 0 1 1 1 r/w * 2 1 r/w * 3 1 4 5 1 6 7 r/w * r/w * r/w * lsp5 1 r/w * lsp4 1 r/w * lsp6 1 r/w * lsp7 lsp3 lsp2 lsp1 lsp0 note: * write is prohibited when bit pattern detection is selected. bit : initial value : r/w : the bit pattern register (btpr) is an 8-bit shift register which detects and records the bit pattern of the ctl pulses. if a ctl pulse is detected in pb or asm mode, the register is shifted leftward at the rising edge of pb-ctl, and reflects the determined result of long/short on bit 0 (long pulse = 1, short pulse = 0). if the bpon bit is set to 1 in pb mode, the register starts detection of bit pattern immediately after the ctl pulse. to exit the bit pattern detection, set the bpon bit at 0. if 1 was written in the bps bit when the bit pattern is being detected, the bpf bit is set at 1 when an 8-bit bit pattern was detected. if continuous detection of 8-bits is required, write 0 in the bpf bit, and then write 1 in the bps bit. at the time of viss detection, the bit pattern detection is disabled. set the bpon bit to 0 at the time of viss detection. in rec mode, the register records the long/short in the bit pattern set in btpr. the pulse in record mode is determined always by bit 7 (lsp7) of btpr. btpr records one pulse, shifts leftward, and stores the data of bit 7 to bit 0. btpr is initialized to h'ff by a reset, stand-by, module stop, or ctl stop. section 28 servo circuits rev.3.00 jan. 10, 2007 page 750 of 1038 rej09b0328-0300 28.13.6 operation ctl circuit operation: as shown in figure 28.49, the ctl discrimination/record circuit is composed of a 16-bit up/down counter and 12-bit registers ( 5). in playback (pb) mode, the 16-bit up/down counter counts on a s/4 clock when the pb-ctl pulse is high, and on a s/5 clock when low. in record (rec) or slow mode, this counter counts up on a s/8 clock when the pulse is high, and on a s/4 clock when low. this counter always counts up in record and slow modes. in playback or slow mode, it is cleared on the rise of a pb-ctl signal. in record mode, it is cleared on the rise of an ref30x signal. s/4 ( s/8) s/5 ( s/4) rec-ctl (l0) rcdr5 rec-ctl (s0) rcdr4 rec-ctl (l1and asm) rcdr3 rec-ctl (s1) rcdr2 rec-ctl match detection match detection match detection match detection match detection rcdr1 12-bit register udf: down udf upper 12 bits up up/down counter (16 bits) duty detection counter clear signal ref30x (rec) pb-ctl (pb, asm) up/down control signal rec: up pb, asm: up when pb-ctl is high down when pb-ctl is low underflows when pb-ctl duty is 43% or less figure 28.49 ctl discri mination/record circuit ctl mode register (ctlm) switchover timing: ctlm is enabled immediately after data is written to the register. care must be taken with changes in the operating state. capstan phase control is performed by the vd sync ref30x (x-value + tracking value) and pb- ctl in asm mode, and by the ref30x or cref and cfg division signal (dvcfg2) in rec section 28 servo circuits rev.3.00 jan. 10, 2007 page 751 of 1038 rej09b0328-0300 mode. if the capref30 signal to be used for capstan phase control is always generated by xdr, the value of xdr must be overwritten when switching between pb and rec modes. figures 28.50 and 28.51 show examples of switchover timing of ctlm and xdr. vd dvcfg2 ref30x 16-bit up/down counter hsw ctl tx latch preset the x-value is updated by ref30p. modification of xdr must be performed before ref30p in the cycle in which the x-value is changed. x-value x-value after change rcdr3 rcdr1 rcdr2 ref30p ta pb-ctl tb 1 pulse udf 0 pulse 0 pulse cdivr2 register write ta is the interval calculated from rcdr3. tb is the interval in which switchover is performed from asm mode to rec mode. tx is the cycle in which the ref30x period is shortened due to the change of xdr. 1 pulse x-value (xdr) is rewritten in this cycle rcdr1 capstan phase control asm mode, pb mode : ref30x-pb-ctl rec mode : ref30p-dvcfg2 /4 /5 /4 rec-ctl figure 28.50 example of ctlm switchover timing (when phase control is performed by ref30p and dvcfg2 in rec mode) section 28 servo circuits rev.3.00 jan. 10, 2007 page 752 of 1038 rej09b0328-0300 vd cref ref30x 16-bit up/down counter hsw ctl tx latch preset the x-value is updated by ref30p. modification of xdr must be performed before ref30p in the cycle in which the x-value is changed. x value x-value after change rcdr3 rcdr1 rcdr2 ref30p ta pb-ctl tb 1 pulse 0 pulse 0 pulse asm-rec switchover ta is the interval calculated from rcdr3. tb is the interval in which switchover is performed from asm mode to rec mode. tx is the cycle in which the ref30x period is shortened due to the change of xdr. with cref and dvcfg2 phase alignment, the frequency need not be 25 hz or 30 hz. 1 pulse x-value (xdr) is rewritten in this cycle dvcfg2 rcdr1 capstan phase control asm mode, pb mode: ref30x-pb-ctl capstan phase control rec mode : ref30p-dvcfg2 /4 /5 /4 rec-ctl cdivr2 register write udf figure 28.51 example of ctlm switchover timing (when phase control is performed by cref and dvcfg2 in rec mode) section 28 servo circuits rev.3.00 jan. 10, 2007 page 753 of 1038 rej09b0328-0300 28.13.7 ctl input section the ctl input section consists of an input amplifier whose gain can be controlled by register setting and a schmitt amplifier. figure 28.52 shows a block diagram of the ctl input section. a trivial ctl pulse signal is received from the ctl head, amplified by the input amplifier, reshaped into a square wave by the schmitt amplifier, and sent to the servo circuits and timer l as the pb-ctl signal. control the ctl input amplifier gain by bits 3 to 0 in the ctl gain control register (ctlgr) of the servo port. ? + + ? ctlfb ctlsmt(i) ctlfb ctlref ctlbias ctlgr0 ctlgr3 to 1 ampshort (rec-ctl) pb-ctl(+) note : be sure to set a capacitor between ctlamp (o) and ctlsmt (i). note pb-ctl(-) ampon (pb-ctl) ? + ctlamp(o) ctl(+) ctl(-) figure 28.52 block diagram of ctl input section section 28 servo circuits rev.3.00 jan. 10, 2007 page 754 of 1038 rej09b0328-0300 (1) ctl detector if the ctl detector fails to detect a ctl pulse, it se ts bit 1 of the ctl control register (ctcr) to high indicating that the pulse has not been detected. if a ctl pulse is detected after that, the bit is automatically cleared to 0. duration used for determining detection or non-detection of the pulse depends on magnitude of phase shift of the last detected pulse from the reference phase (phase difference between ref30 and ctl signal). typica lly, detection or non-detection is determined within 3 to 4 cycles of the reference period. if settings of the ctl gain control register are maintained in a table format, you can refer to it when the ctl detector failed to detect ctl pulses. from the table, you can control input sensitivity of the ctl according to the state of the unctl bit, thereby selecting an optimum ctl amplifier gain depending on the state of the pulse recorded. figure 28.53 illustrates the concept of gain control for detecting the ctl input pulse. * v+th (fixed) * v-th (fixed) note: * ctl input sensitivity is variable depending on ctl gain control register (ctlgr) setting. figure 28.53 ctl input pulse gain control section 28 servo circuits rev.3.00 jan. 10, 2007 page 755 of 1038 rej09b0328-0300 (2) pb-ctl waveform shaper in slow mode operation if bit 0 in the ctl control register (ctcr) is set to slow mode, slow reset function is activated. in slow mode, if the falling edge is not detected within the specified time from rising edge detection, pb-ctl is forcibly shut down (slow reset). the time t fs (s) until the signal falls is the following interval after the rising edge of the internal ctl signal is detected: t fs = 16384 4 s ( s = f osc /2) when f osc = 10 mhz, t fs = 13.1 ms. figure 28.54 shows the pb-ctl waveform in slow mode. ctl waveform internal ctl signal 1 frame 1 frame 1 frame slow tracking delay slow tracking delay slow tracking delay accelera- tion accelera- tion accelera- tion decelera- tion decelera- tion slow reset stop stop ctlp ctlp ctlp figure 28.54 pb-ctl waveform in slow mode operation section 28 servo circuits rev.3.00 jan. 10, 2007 page 756 of 1038 rej09b0328-0300 28.13.8 duty discriminator the duty discriminator circuit measures the period of the control signal recorded on the tape (pb- ctl signal) and discriminates its duty cycle. in viss or vass detection, the duty i/o flag is set or cleared according to the result of duty discrimination. the duty i/o flag is set to 1 when the duty cycle of the pb-ctl signal is equal to or abov e 44%, and is cleared to 0 when the duty cycle is below 43%. in asm detection, an asm mark is recognized (and the duty i/o fl ag is cleared to 0) when the duty cycle is equal to or above 66%. when the duty cycle is below 65%, no asm mark is recognized and the duty i/o flag is set to 1. the detection direction can be switched between forward and reverse by bit 5 (fw/rv) in the ctl mode register. a long or short pulse can be detected by comparing the rec-ctl duty data register (rcdr2 to rcdr5) and up/down counter. long or short pul se is discriminated at pb-ctl signal falling. discrimination result is stored in bit 0 (lsp0) of the bit pattern register (btpr). at the same time, btpr is shifted to the left. lsp0 indicates 0 when a short pulse is detected, and 1 when a long pulse is detected. set the threshold value of a long/short pulse in rcdr2 to rcdr5. see (4), detection of the long/short pulse. figure 28.55 shows the duty cycle of the pb-ctl signal. section 28 servo circuits rev.3.00 jan. 10, 2007 page 757 of 1038 rej09b0328-0300 input signal short 1 pulse 25 0.5% pb-ctl input signal long 1 pulse 30 0.5% pb-ctl input signal short 0 pulse 57.5 0.5% 62.5 0.5% pb-ctl input signal long 0 pulse pb-ctl input signal asm mark 67 to 70% pb-ctl figure 28.55 pb-ctl signal duty cycle section 28 servo circuits rev.3.00 jan. 10, 2007 page 758 of 1038 rej09b0328-0300 figure 28.56 shows the duty discrimination circuit. a 44% duty cycle is discriminated by counting with the 16-bit up/down counter, using a s/4 clock for the up-count and a s/5 clock for the down-count. an up-count is performed when the pb-ctl signal is high, and a down-count when low. long or short pulse is discriminated by comparing with rcdr2 to rcdr5. counter pb-ctl 1 pulse pb-ctl pb-ctl s/4 s/5 counter pb-ctl 0 pulse s/4 s/5 counter fwd pb-ctl short pulse (0 pulse) s/4 s/5 rcdr3 rcdr2 0 pulse l/s threshold value 1 pulse l/s threshold value counter rev pb-ctl long pulse (1 pulse) s/5 s/4 rcdr4 rcdr5 0 pulse l/s threshold value 1 pulse l/s threshold value up/down comparison of upper 12-bit up/down counter (16 bits) * rcdr2or4 (12 bits) * fwd : discriminated by rcdr2 and rcdr3 rev : discriminated by rcdr4 and rcdr5 * rcdr3or5 (12 bits) 0/1 discrimination udf clear r s q s/4 s/5 l/s discrimination figure 28.56 duty discriminator section 28 servo circuits rev.3.00 jan. 10, 2007 page 759 of 1038 rej09b0328-0300 (1) viss (index) detect/record mode viss detection is carried out by the viss control circuit, which counts 1 pulses in the pb-ctl signal. if the pulse count detects any value set in th e viss interrupt setting bits (bits 5, 6, and 7 in the duty i/o register), an interrupt request is generated and the duty i/o flag is cleared to 0. at viss record or rewrite, index code is automatically written. index code is composed of continuous 62-bit data with 0 pulse data at both edges. examples of bit strings and the duty i/o flag at viss detection/record are illustrated in figure 28.57. 0 tape direction duty i/o flag (a) viss detection (index: thirty-two 1 pulse setting) 1111 613 bits thirty-two 1 pulses detected irrctl 633 bits start 11110 0 tape direction duty i/o flag (b) viss record 1111 62 bits irrctl 64 bits start 11110 1 2 3 62 63 64 figure 28.57 examples of viss bit strings and duty i/o flag section 28 servo circuits rev.3.00 jan. 10, 2007 page 760 of 1038 rej09b0328-0300 (2) vass detect mode vass detection is carried out by the duty discriminator. software can detect index sequences by reading the duty i/o flag at each ctl pulse. at each ctl pulse, the duty discriminator sends th e result of duty discrimi nation to the duty i/o flag, and simultaneously generates an interrupt request. the duty i/o flag is cleared to 0 if the ctl pulse is a 1 (duty cycle below 43%), and is set to 1 if the ctl pulse is a 0 (duty cycle equal to or above 44%). the duty i/o flag is modified at each ctl pulse. it should be read by the interrupt-handling routine within the period of the pb-ctl signal. the vass detection format is illustrated in figure 28.58. 1 tape direction written three times 1111111111 m s b l s b l s b m s b m s b l s b l s b m s b thousands header (11 bits) hundreds data (16 bits: 4 digits of 4-bit bcd) tens ones figure 28.58 vass (index) format (3) assemble (asm) mark detect mode asm mark detection is carried out by the duty discriminator. if the duty discriminator detects that the duty cycle of the pb-ctl signal is 66% or higher, it generates an interrupt request, and simultaneously clears the duty i/o flag to 0. the duty i/o flag is updated at every ctl pulse. it should be read by the interrupt-handling routine within the period of the pb-ctl signal. section 28 servo circuits rev.3.00 jan. 10, 2007 page 761 of 1038 rej09b0328-0300 (4) detection of th e long/short pulse the long/short pulse is detected in pb mode by the l/s determination based on the comparison of the rec-ctl duty registers (rcdr2 to rcdr5) with the up/down counter and the results of the duty i/o flag. the results of the determination are stored in bit 0 (lsp0) of the bit pattern register (btpr) at the rising edge of pb-ctl, shifting btpr leftward at the same time. rcdr2 to rcdr5 set the l/s thresholds for each of fwd/rev. set to rcdr2 a threshold of 1 pulse l/s for fwd, to rcdr3 a threshold of 0 pulse l/s for fwd, to rcdr4 a threshold of 0 pulse l/s for rev, and to rcdr5 a threshold of 1 pulse l/s for rev. figure 28.59 shows the detection of the long/short pulse. also, the bit pattern of eight bits can be detected by btpr. check that an 8-bit detection has been done by bit 1 (bpf bit) of the duty i/o register, and then read btpr. bit pattern register (8 bits) up/down counter (16 bits) rcdr2 (12 bits) high-order 12-bit data l/s is determined at the rising edge of pb-ctl. after the determination, the bit pattern register is shifted leftward, and the results of the determination are stored in the lsb. rcdr3 (12 bits) internal bus lsb fw/ r v di/o shift leftward btpr r r s q rcdr4 (12 bits) rcdr5 (12 bits) r sq s/4 figure 28.59 detection of long/short pulse section 28 servo circuits rev.3.00 jan. 10, 2007 page 762 of 1038 rej09b0328-0300 28.13.9 ctl output section an on-chip control head amplifier is provided for writing the rec-ctl signal generated by the write control circuit onto the tape. the write control circuit controls the duty cycle of the rec-ctl signal in the writing of viss and vass sequences and asm marks and the rewriting of viss and vass sequences. the duty cycle of the rec-ctl signal is set in rec-ctl duty data registers 1 to 5 (rcdr1 to rcdr5). times calculated in terms of s (= f osc /2) should be converted to appropriate data to be set in these registers. in viss or vass mode, set rcdr2 for a duty cycle of 25% 0.5%, rcdr3 for a duty cycle of 30% 0.5%, rcdr4 for a duty cycle of 57.5 0.5%, and rcdr5 for a duty cycle of 62.5 0.5%. when 1 is written in the duty i/o flag, the rec-ctl signal will be written on the tape with a 25% 0.5% duty cycle when 0 is written in bit 7 (lsp7) in the bit pattern register (btpr) and with a 30 0.5% duty cycle when 1 is written. table 28.21 shows the relationship between the rec-ctl duty register and ctl outputs. in asm mark write mode, set rcdr3 for a duty cycle of 67% to 70%. an asm mark will be written when 0 is written in the duty i/o flag. an interrupt request is generated at the rise of the reference signal after one ctl pulse has been written. the reference signal is derived from the output signal (ref30x) of the x-value adjustment circuit, and has a period of one frame. figure 28.60 shows the timings that generate the rec-ctl signal. table 28.21 rec-ctl duty register and ctl outputs mode d/io lsp7 pulse rcdr duty 0 s1 rcdr2 25 0.5% 0 1 l1 rcdr3 30 0.5% 0 s0 rcdr4 57.5 0.5% viss and vass modes 1 1 l0 rcdr5 62.5 0.5% asm mode 0 * ? rcdr3 67 to 70% legend: * don?t care. section 28 servo circuits rev.3.00 jan. 10, 2007 page 763 of 1038 rej09b0328-0300 w internal bus rcdr2or4 (12 bits) w rcdr1 (12 bits) up/down counter (12 bits) counter ref30x rec-ctl counter reset match detection match detection end of writing of one ctl pulse (except viss) irrctl rcdr2 (viss/vass s1 pulse) rcdr3 (viss/vass l1 pulse, or asm) rcdr4 (viss/vass s0 pulse) rcdr5 (viss/vass l0 pulse) rcdr1 clear upper 12 bits rec-ctl 0 pulse fall timing rec-ctl rise timing rec-ctl 1 pulse, asm fall timing reset ref30x w rcdr3or5 (12 bits) s/4 compare compare compare figure 28.60 rec-ctl signal generation timing section 28 servo circuits rev.3.00 jan. 10, 2007 page 764 of 1038 rej09b0328-0300 the 16-bit counter in the rec-ctl circuit continues counting on a clock derived by dividing the system clock s (= f osc /2) by 4. the counter is cleared on the rise of ref30x in record mode, and on the rise of pb-ctl in rewrite mode. the rec-ctl match detection is carried out by comparing the counter valu e with each rcdr value. rcdr1 to rcdr5 can be written to by software at all times. if rcdr is changed before the respective match detection is performed, match de tection is performed using the new value. the value changed after match detection becomes valid on the rise of ref30x following the change. figure 28.61 shows an example of rcdr change timing. ref30x rec-ctl rcdr1 rcdr2 rcdr1 1 pulse (short) 0 pulse (short) rewritten 0 pulse (short) rcdr1 rcdr1 counter rcdr4 rcdr2 rcdr1 rcdr4 rcdr4 rcdr4 interval in which rcdr4 can be written to figure 28.61 example of rcdr change timing (example showing rcdr4) section 28 servo circuits rev.3.00 jan. 10, 2007 page 765 of 1038 rej09b0328-0300 28.13.10 trapezoid waveform circuit in rewriting, the trapezoid wavefo rm circuit leaves the rising e dge of the already-recorded pb- ctl signal intact, but changes the duty cycle. in rewriting, the ctl pulse is written with refere nce to the rise of pb-ctl. the ctl duty cycle for a rewrite is set in the rec-ctl duty data registers (rcdr2 to rcdr5). time values t2 to t5 are referenced to the rise of pb-ctl. figure 28.62 shows the rewrite waveform. w internal bus rcdr3or5 (12 bits) w not used when rewriting rcdr2or4 (12 bits) up/down counter (16 bits) clear upper 12 bits rec-ctl 0 pulse fall timing rec-ctl 1 pulse fall timing reset pb-ctl w t 2 to t 5 eliminated pulse high-impedance interval end of writing of one ctl pulse (except viss) irrctl rcdr1 (12 bits) s/4 compare compare rcdr2 (viss/vass s1 pulse) rcdr3 (viss/vass l1 pulse) rcdr4 (viss/vass s0 pulse) rcdr5 (viss/vass l0 pulse) pb-ctl rec-ctl when rewriting new pulse figure 28.62 relationship between re c-ctl and rcdr2 to rcdr5 when rewriting section 28 servo circuits rev.3.00 jan. 10, 2007 page 766 of 1038 rej09b0328-0300 28.13.11 note on ctl interrupt following a reset, the ctl circuit is in the vass detect (duty detect) mode. depending on the ctl pin states, a false pb-ctl input pulse may be recognized and an interrupt request generated. if the interrupt request will be enabled, first clear the ctl interrupt request flag. 28.14 frequency dividers 28.14.1 overview on-chip frequency dividers are provided for the pulse signal picked up from the control track during playback (pb-ctl signal), and the pulse signal received from the capstan motor (cfg signal). an on-chip noise canceller is provided for the drum motor pulse signal (dfg signal). the ctl frequency divider generates a ctl divided control signal (dvctl) from the pb-ctl signal, for use in capstan phase control during high-speed search, for example. the cfg frequency divider generates two divided signals (dvcfg for speed control and dvcfg2 for phase control) from the cfg signal. the dfg noise canceller is a circuit which considers a signal less than 2 as noise and masks it. 28.14.2 ctl frequency divider (1) block diagram figure 28.63 shows a block diagram of the ctl frequency divider. exctl pb-ctl , dvctl udf r/w w (8 bits) r/w internal bus cex ctl division register down counter (8 bits) ceg edge detector ctvc ctlr ctvc figure 28.63 ctl frequency divider section 28 servo circuits rev.3.00 jan. 10, 2007 page 767 of 1038 rej09b0328-0300 (2) register configuration register configuration table 28.22 shows the register configuration of the ctl dividers. table 28.22 register configuration name abbrev. r/w size initial value address dvctl control register ctvc r/w byte undefined h'fd098 ctl division register ctlr w byte h'00 h'fd099 dvctl control register (ctvc) 0 * 1 * r 2 * r 3 4 5 ? ? ? ? ? ? 6 7 r cfg hsw 0 w 0 w cex ceg ctl 1 11 bit : initial value : r/w : note: * undefined. the dvctl control register (ctvc) is a register consisting of the external input signal selection bit and the flags which show the cfg, hsw, and ctl levels. note: it has an undetermined value by a reset or stand-by. bit 7 ? dvctl signal generation selection bit (cex): selects whether the pb-ctl signal or the external input signal is used to generate the dvctl signal. bit 7 cex description 0 generates dvctl signal with pb-ctl signal (initial value) 1 generates dvctl signal with external input signal bit 6 ? external sync signal edge selection bit (ceg): selects the edge of the external signal at which the frequency division is made when the external signal was selected to generate the dvctl signal. bit 6 ceg description 0 rising edge (initial value) 1 falling edge section 28 servo circuits rev.3.00 jan. 10, 2007 page 768 of 1038 rej09b0328-0300 bits 5 to 3 ? reserved: no write in them is valid. if a read is attempted, an undetermined value is read out. bit 2 ? cfg flag (cfg): shows the cfg level. bit 2 cfg description 0 cfg is at low level (initial value) 1 cfg is at high level bit 1 ? hsw flag (hsw): shows the level of the hsw signal selected by the vff/nff bit of the hsw mode register 2 (hsm2). bit 1 hsw description 0 hsw is at low level (initial value) 1 hsw is at high level bit 0 ? ctl flag (ctl): shows the ctl level. bit 0 ctl description 0 rec or pb-ctl is at low level (initial value) 1 rec or pb-ctl is at high level ctl frequency division register (ctlr) 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 6 0 7 ctl4 ctl3 ctl2 ctl1 ctl0 0 w ctl7 w w w ctl6 ctl5 bit : initial value : r/w : the ctl frequency division register (ctlr) is an 8-bit write-only register to set the frequency dividing value (n-1 if divided by n) for pb-ctl. if a read is attempted, an undetermined value is read out. pb-ctl is divided by n at its rising edge. if the register value was 0, no division operation is performed, and the dvctl signal with the same cycle with pb-ctl is output. it is initialized to h'00 by a reset or stand-by. section 28 servo circuits rev.3.00 jan. 10, 2007 page 769 of 1038 rej09b0328-0300 (3) operation during playback, control pulses recorded on the tape are picked up by the control head and input to the ctl pin. the control pulse signal is amp lified by a schmitt amplifier, reshaped, then input to the ctl frequency divider as the pb-ctl signal. this circuit is employed when the control pulse (pb-ctl signal) is used for phase control of the capstan motor. the divided signal is sent as the dvctl signal to the capstan phase system in the servo circuits, and the timer r. the ctl frequency divider is an 8-bit reload timer consisting of a reload register and a down- counter. frequency division is obtained by setting freque ncy-division data in bits 7 to 0 in the ctl frequency division register (ctlr), which is the reload register. when a frequency-division value is written in this reload regist er, it is also written into the down-counter. the down-counter is decremented on rising edges of the pb-ctl signal. figure 28.64 shows examples of the pb-ctl signal and dvctl waveforms. ctl input signal legend: ctlr : ctl frequency division register pb-ctl or external sync signal ctlr = 00 ctlr = 01 ctlr = 02 figure 28.64 ctl frequency division waveforms section 28 servo circuits rev.3.00 jan. 10, 2007 page 770 of 1038 rej09b0328-0300 28.14.3 cfg frequency divider (1) block diagram figure 28.65 shows a block diagram of the 7-bit cfg frequency divider and its mask timer. w r/w w r/w w wwr r/w internal bus cmn crf udf udf udf cfg dvcfg dvcfg2 , mcgin internal bus cfg clock select ctmr (6 bits) cdivr2 (7 bits) dvtrg pb(asm) rec s = fosc/2 s/1024 s/512 s/256 s/128 down counter (7 bits) down counter (7 bits) down counter (6 bits) cdivr (7 bits) cmk s r edge select cdvc cdvc cdvc cdvc cdvc figure 28.65 cfg frequency divider section 28 servo circuits rev.3.00 jan. 10, 2007 page 771 of 1038 rej09b0328-0300 (2) register descriptions register configuration table 28.23 shows the register configuration of the cfg frequency divider. table 28.23 register configuration name abbrev. r/w size initial value address dvcfg control register cdvc r/w byte h'60 f'fd09a cfg frequency division register 1 cdivr1 w byte h'80 h'fd09b cfg frequency division register 2 cdivr2 w byte h'80 h'fd09c dvcfg mask period register ctmr w byte h'ff h'fd09d dvcfg control register (cdvc) 0 0 1 0 w 2 0 w 3 4 0 w 5 1 6 ? ? 1 7 w r cmk cmn w dvtrg 0 r/w * mcgin crf cps1 cps0 0 note: * only 0 can be written. bit : initial value : r/w : cdvc is an 8-bit register to control the capstan frequency division circuit. it is initialized to h'60 by a reset, stand-by or module stop. bit 7 ? mask cfg flag (mcgin): mcgin is a flag to indicate occurrence of a frequency division signal during the mask timer's mask period. to clear it, write 0. to clear it by software, write 0 after reading 1. also, setting has the highest priority in this flag. if a condition setting the flag and 0 write occurs simultaneously, the latter is nullified. bit 7 mcgin description 0 cfg is in normal operation (initial value) 1 shows that dvcfg was detected during masking (runaway detected) bit 6 ? reserved: no write in it is valid. if a read is attempted, 1 is read out. section 28 servo circuits rev.3.00 jan. 10, 2007 page 772 of 1038 rej09b0328-0300 bit 5 ? cfg mask status bit (cmk): indicates the status of the mask. it is initialized to 1 by a reset, stand-by or module stop. bit 5 cmk description 0 indicates that the capstan mask timer has released masking 1 indicates that the capstan mask timer is currently masking (initial value) bit 4 ? cfg mask selection bit (cmn): selects the turning on/off of the mask function. bit 4 cmn description 0 capstan mask timer function on (initial value) 1 capstan mask timer function off bit 3 ? pb (asm) rec transition timing sync on/off selection bit (dvtrg): selects the on/off of the timing sync of the transition from pb (asm) to rec when the dvcfg2 signal is generated. bit 3 dvtrg description 0 pb (asm) rec transition timing sync on (initial value) 1 pb (asm) rec transition timing sync off bit 2 ? cfg frequency division edge selection bit (crf): selects the edge of the cfg signal to be divided. bit 2 crf description 0 performs frequency division at the rising edge of cfg (initial value) 1 performs frequency division at both edges of cfg section 28 servo circuits rev.3.00 jan. 10, 2007 page 773 of 1038 rej09b0328-0300 bits 1 and 0 ? cfg mask timer clock selection bits (cps1, cps0): selects the clock source for the cfg mask timer. ( s = fosc/2) bit 1 bit 0 cps1 cps0 description 0 s/1024 (initial value) 0 1 s/512 1 0 s/256 1 s/128 cfg frequency division register 1 (cdivr1) 0 0 1 0 w 2 0 w 3 4 0 w 5 0 6 7 ? ? w w cdv15 cdv14 0 w cdv16 0 w cdv13 cdv12 cdv11 cdv10 1 bit : initial value : r/w : the cfg frequency division register 1 (cdivr1) is an 8-bit write-only register to set the cfg division value (n-1 for n division). if a read is attempted, an undetermined value is read out. bit 7 is reserved. the frequency division value is written in the reload register and the down counter at the same time. cfg?s frequency is divided by n at its rising edge or both edges. if the register value was 0, no division operation is performed, and the dvcfg signal with the same input cycle with the cfg signal is output. the dvcfg signal is sent to the cap stan speed error detector. it is initialized to h'80 by a reset or stand-by together with the capstan frequency division register and the down counter. cfg frequency division register 2 (cdivr2) 0 0 1 0 w 2 0 w 3 4 0 w 5 0 6 7 ? ? w w cdv25 cdv24 0 w cdv26 0 w cdv23 cdv22 cdv21 cdv20 1 bit : initial value : r/w : the cfg frequency division register 2 (cdivr2) is an 8-bit write-only register to set the cfg division value (n-1 for n division). if a read is attempted, an undetermined value is read out. bit 7 is reserved. the frequency division value is written in the reload register and the down counter at the same time. section 28 servo circuits rev.3.00 jan. 10, 2007 page 774 of 1038 rej09b0328-0300 cfg?s frequency is divided by n at its rising edge or both edges. if the register value was 0, no division operation is performed, and the dvcfg signal with the same input cycle with the cfg signal is output. the dvcfg2 signal is sent to the capstan speed error detector and the timer l. the dvcfg2 circuit has no mask timer function. the frequency division counter for the dvcfg2 signal starts its division operation at the point data was written in cdivr2. if synchronization is required for phase matching, for example, do it by writing in cdivr2. if the dvtrg bit of the cdvc register was 0, the register synchronizes with the switching timing from pb (asm) to rec. it is initialized to h'80 by a reset or stand-by together with the capstan frequency division register and the down counter. dvcfg mask period register (ctmr) 0 1 1 1 w 2 1 w 3 4 1 w 5 1 6 7 ? ? ? ? w w cpm5 cpm4 1 w cpm3 cpm2 cpm1 cpm0 11 bit : initial value : r/w : the dvcfg mask period register (ctmr) is an 8-bit write-only register. if a read is attempted, an undetermined value is read out. ctmr is a reload register for the mask timer (down counter). set in it the mask period of cfg. the mask period is determined by the clock specified by bits 1 and 0 of cdvc and the set value (n-1). if data is written in ctmr, it is written also in the mask timer at the same time. it is initialized to h'ff by a reset, stand-by or module stop. mask period = n clock cycle section 28 servo circuits rev.3.00 jan. 10, 2007 page 775 of 1038 rej09b0328-0300 (3) operation frequency divider the cfg pulses output from the capstan motor are sent to internal circuitry as the cfg signal via the zero-cross type comparator. the cfg signal, shaped into a rectangular waveform by a reshaping circuit, is divided by the cfg frequency dividers, and used in servo control. the rising edge or both edges of the cfg signal can be selected for the frequency divider. the cfg frequency dividers comprises a 7-bit frequency divider with a mask timer for capstan speed control (dvcfg signal generator) and a 7-bit frequency divider for capstan phase control (dvcfg2 signal generator). the dvcfg signal generator consists of a 7-bit re load register (cfg frequency division register1: cdivr1), a 7-bit down-counter, and a 6-bit mask timer (with settable mask interval). frequency division is performed by setting the frequency-division value in 7-bit cdivr1. when the frequency-division value is written in cdivr1, it is also written in the down-counter. after frequency division of a cfg signal for which the edge has been selected, the signal is sent via the mask timer to the capstan speed e rror detector as the dvcfg signal. the dvcfg2 signal generator consists of a 7-bit re load register (cfg frequency division register 2: cdivr2) and a 7-bit down-counter. the 7-bit fr equency divider does not have a mask timer. frequency division is performed by setting the frequency-division value in cdivr2. when the frequency-division value is written in cdivr2, it is also written in the down-counter. after frequency division of a cfg signal for which the edge has been selected, the signal is sent to the capstan speed error detector and the timer l as the dvcfg2 signal. frequency division starts when the frequency-division value is written. when the dvtrg bit in the cdvc register is set to 0, reloading is executed with the switchover timing from pb (asm) mode to rec mode. to switch from ref30 to cref, change the settings of bit 4 (cr/rf bit) in the capstan phase error detection control register (cpgcr). if synchronization is necessary for phase control, this can be provided by writing the frequency- division value in cdivr2. the down-counters are decremented on rising edge s of the cfg signal when the crf bit is 0 in the dvcfg control register (cdvc), and on both edges when the crf bit is 1. figure 28.66 shows examples of cfg frequency division waveforms. section 28 servo circuits rev.3.00 jan. 10, 2007 page 776 of 1038 rej09b0328-0300 cfg crf bit = 1 cdivr = 00 crf bit = 0 cdivr = 00 crf bit = 0 cdivr = 01 crf bit = 0 cdivr = 02 figure 28.66 frequency division waveforms mask timer the capstan mask timer is a 6-b it reload timer that uses a prescaled clock as a clock source. the mask timer is used for masking the dvcfg signal intended for controlling the capstan speeds. the capstan mask timer prevents edge detection to be carried out for an unnecessarily long duration by masking the edge detection for a certain period. the above trouble can result from abnormal revolution (runout) of the capstan motor b ecause its revolution has to cover a wide range speeds from the slow/still up to the high speed search. the capstan mask timer is started by output of a pulse edge in the divided cfg signal (dvcfg). while the timer is running, a mask signal disables the output of further dvcfg pulses. the mask signal is shown in figure 28.67. the mask timer status can be recognized by reading the cmk flag in the dvcfg control register (cdvc). section 28 servo circuits rev.3.00 jan. 10, 2007 page 777 of 1038 rej09b0328-0300 mask dvcfg mask timer underflow figure 28.67 mask signal figures 28.68 and 28.69 show examples of cfg mask timer operations. cfg (racing) edge detect cleared by writing 0 after reading 1 capstan motor mask timer mask interval mask interval dvcfg mcgin flag figure 28.68 cfg mask timer opera tion (when capstan motor is racing) section 28 servo circuits rev.3.00 jan. 10, 2007 page 778 of 1038 rej09b0328-0300 cfg edge detect capstan motor mask timer mask interval mask interval figure 28.69 cfg mask ti mer operation (when capstan motor is operati ng normally) 28.14.4 dfg noise removal circuit (1) block diagram figure 28.70 shows the block diagram of the dfg noise removal circuit. edge detection delay circuit dfg sq r ncdfg delay = 2 edge detection figure 28.70 dfg noise removal circuit (2) register descriptions register configuration table 28.24 shows the register configuration of the dfg mask circuit. table 28.24 register configuration name abbrev. r/w size initial value address fg control register fgcr w byte h'fe h'fd09e section 28 servo circuits rev.3.00 jan. 10, 2007 page 779 of 1038 rej09b0328-0300 fg control register (fgcr) 0 0 1 1 2 1 3 1 4 1 5 1 6 1 7 ? ? ? ? ? ? ? ? ? ? ? ? ? ? w drf 1 bit : initial value : r/w : selects the edge of the dfg noise removal signal (ncdfg) to be sent to the drum speed error detector. if a read is attempted, an undetermined value is read out. bits 7 to 1 are reserved. no write in them is valid. it is initialized to h'fe by a reset, stand-by or module stop. the edge selection circuit is located in the dr um speed error detector, and outputs the register output to the drum speed error detector. bits 7 to 1 ? reserved: no write in them is valid. if a read is attempted, an undetermined value is read out. bit 0 ? dfg edge selection bit (drf): selects the edge of the ncdf g signal used in the drum speed error detector. bit 0 drf description 0 selects the rising edge of ncdfg signal (initial value) 1 selects the falling edge of ncdfg signal section 28 servo circuits rev.3.00 jan. 10, 2007 page 780 of 1038 rej09b0328-0300 (3) description of operation the dfg noise removal circuits generates a signal (ncdfg signal) with a delay circuit as a result of removing noise (signal fluctuation smaller than 2 ) from the dfg signal. the resulted ncdfg signal is behind the time when the dfg signal was detected by 2 . figure 28.71 shows the ncdfg signal. dfg ncdfg noise 2 2 2 = fosc figure 28.71 ncdfg signal section 28 servo circuits rev.3.00 jan. 10, 2007 page 781 of 1038 rej09b0328-0300 28.15 sync signal detector 28.15.1 overview this block performs detection of the horizontal sync signal (hsync) and vertical sync signal (vsync) from the composite sync signal (csync), noise counting, and field detection. it detects the horizontal and vertical sync signals by setting threshold in the register and based on the servo clock ( s = fosc/2). noise masking is possible during the detection of the horizontal sync signals, and if any hsync is missing, it can be supplemented. also, if total volume of the noise detected in one frame of csync amounted over a specified volume, the detector generates a noise detection interrupt. note: this circuit detects a pulse with a specific width set by the threshold register. it does not classify or restore the sync signal to a formal one. 28.15.2 block diagram figure 28.72 shows the block diagram of the sync signal detector. section 28 servo circuits rev.3.00 jan. 10, 2007 page 782 of 1038 rej09b0328-0300 w h threshold register w v threshold register (6 bits) (4 bits) htr vtr w w h supplement start time register supplemented h pulse width register (8 bits) (4 bits) hpwr hrtr w w (6 bits) (8 bits) ndr r/w r/w r/(w) r nois h counter (8 bits) noise detector supplement control & noise mask control circuit up/down counter (6 bits) seph selection of polarity noise detection window noise detection interrupt vd interrupt csync sync signal detector h reload counter (8 bits) field detector noise counter (10 bits) toggle circuit clear fld syct vd(sepv) filed noise irrsnc osch nis/vd syncr nwr internal bus s = fosc/2 s/2 noise detection window register noise detection register figure 28.72 block diagram of the sync signal detector section 28 servo circuits rev.3.00 jan. 10, 2007 page 783 of 1038 rej09b0328-0300 28.15.3 pin configuration table 28.25 shows the pin configuration of the sync signal detector. table 28.25 pin configuration name abbrev. i/o function composite sync signal input pin csync input composite sync signal input 28.15.4 register configuration table 28.26 shows the register configuration of the sync signal detector. table 28.26 register configuration name abbrev. r/w size initial value address vertical sync signal threshold register vtr w byte h'c0 h'fd0b0 horizontal sync signal threshold register htr w byte h'f0 h'fd0b1 h supplement start time setting register hrtr w byte h'00 h'fd0b2 supplemented h pulse width setting register hpwr w byte h'f0 h'fd0b3 noise detection window setting register nwr w byte h'c0 h'fd0b4 noise detector register ndr w byte h'00 h'fd0b5 sync signal control register syncr r/w byte h'f8 h'fd0b6 section 28 servo circuits rev.3.00 jan. 10, 2007 page 784 of 1038 rej09b0328-0300 28.15.5 register descriptions (1) vertical sync signal threshold register (vtr) 0 0 1 0 w 2 0 w 3 0 4 0 w 5 0 6 1 7 ? ? ? ? w w w vtr5 vtr4 vtr3 vtr2 vtr1 vtr0 1 bit : initial value : r/ w : sets the threshold for the vertical sync signal when the signal is detected from the composite sync signal. the threshold is set by bits 5 to 0 (vtr5 to vtr0). bits 7 and 6 are reserved. vtr is an 8-bit write-only register. if a read is attempted, an undetermined value is read out. it is initialized to h'c0 by a reset, stand-by or module stop. (2) horizontal sync signal threshold register (htr) 0 0 1 0 w 2 0 w 3 0 4 5 6 1 7 ? ? ? ? ? ? ? ? w w htr3 htr2 htr1 htr0 11 1 bit : initial value : r/w : sets the threshold for the horizontal sync signal when the signal is detected from the composite sync signal. the threshold is set by bits 3 to 0 (htr3 to htr0). bits 7 and 4 are reserved. htr is an 8-bit write-only register. if a read is attempted, an undetermined value is read out. it is initialized to h'f0 by a reset, stand-by or module stop. figure 28.73 shows threshold and separated sync signals. section 28 servo circuits rev.3.00 jan. 10, 2007 page 785 of 1038 rej09b0328-0300 legend: th hpuls th sepv hpuls : cycle of the horizontal sync signal (ntsc: 63.6, pal: 64 [ s]) : pulse width of the horizontal sync signal (ntsc, pal: 4.7 [ s]) vvth hvth : value set as the threshold of the vertical sync signal : value set as the threshold of the horizontal sync signal sepv seph : detected vertical sync signal : detected horizontal sync signal (before supplement) th seph csync h'00 counter value 1/2 hpuls vd interrupt hpuls vvth hvth figure 28.73 threshold and separated sync signals example the set values to detect the vertical and horizontal sync signals (sepv and seph) from csync are required to meet the following conditions. assumed that the set values in the vthr register were vvth and hvth, (vvth - 1) 2/ s > hpuls (hvth - 2) 2/ s hpuls/2 < (hvth - 1) ) 2/ s where, hpuls is pulse width ( s) of the horizontal sync signal, and s is servo clock (fosc/2). thus, if s = 5 mhz, ntsc system is used, (vvth - 1) 0.4 s > 4.7 s vvth h'd (hvth - 2) 0.4 s 2.35 s < (hvth - 1) 0.4 s hvth h'7 note: this circuits detects the pulse with the width set in the vthr register. if a noise pulse with the width greater than the set value was input, the circuit regards that it detected a sync signal. section 28 servo circuits rev.3.00 jan. 10, 2007 page 786 of 1038 rej09b0328-0300 (3) h supplement start time setting register (hrtr) 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 6 0 7 hrtr4 hrtr3 hrtr2 hrtr1 hrtr0 0 w hrtr7 w w w hrtr6 hrtr5 bit : initial value : r/w : sets the timing to generate a supplementary pulse if a drop-out of a pulse of the horizontal sync signal occurred. hrtr is an 8-bit write-only register. if a read is attempted, an undetermined value is read out. it is initialized to h'00 by a reset, stand-by or module stop. ((value of hrtr7 to hrtr0) + 1) 2/ s = th where, th is the cycle of the horizontal sync signal ( s), and s is the servo clock (fosc/2). whether the horizontal sync signal exists or not is determined one clock before the supplementary pulse is generated. accordingly, set to hrtr7 to hrtr0 a value obtained from the equation shown above plus one. also, hrtr7 to hrtr0 set the noise mask period. if the horizontal sync signal had the normal pulses, it is masked in the mask period. the start and end of the mask period are computed frm the rising edge of osch and seph, respectively. see figure 28.75. (4) supplemented h pulse width setting register (hpwr) 0 0 1 0 w 2 0 w 3 0 4 5 6 1 7 ? ? ? ? ? ? ? ? w w hpwr3 hpwr2 hpwr1 hpwr0 11 1 bit : initial value : r/w : hpwr sets the pulse width of the supplemented pulse which is generated if a drop-out of a pulse of the horizontal sync signal occurs. bits 7 to 4 are reserved. hrwr is an 8-bit write-only register. if a read is attempted, an undetermined value is read out. it is initialized to h'f0 by a reset or stand-by. ((value of hpwr3 to hpwr0) + 1) 2/ s = hpulse where, hpuls is the pulse width of the horizontal sync signal ( s), and s is the servo clock (fosc/2). section 28 servo circuits rev.3.00 jan. 10, 2007 page 787 of 1038 rej09b0328-0300 (5) noise detection window setting register (nwr) 0 0 1 0 w 2 0 w 3 0 4 0 w 5 0 6 1 7 ? ? ? ? w w w nwr5 nwr4 nwr3 nwr2 nwr1 nwr0 1 bit : initial value : r/w : nwr sets the period (window) when the drop-out of the pulse of the horizontal sync signal is detected and the noise is counted. set the timing of the noise detection window in bits 5 to 0. bits 7, and 6 are reserved. nwr is an 8-bit write-only register. if a read is attempted, an undetermined value is read out. it is initialized to h'c0 by a reset, stand-by or module stop. set the value of the noise detection window timing according to the following equation. ((value of nwr5 to nwr0) + 1) 2/ s = 1/4 th where, th is the pulse width of the horizontal sync signal ( s), and s is the servo clock (fosc/2). it is recommended that this timing value is set at about 1/4 of the cycle of the horizontal sync signal. (6) noise detection register (ndr) 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 6 0 7 ndr4 ndr3 ndr2 ndr1 ndr0 0 w ndr7 w w w ndr6 ndr5 bit : initial value : r/w : ndr sets the noise detection level when the noise of the horizontal sync signal is detected (when nwr is set). set the noise detection level in bits 7 to 0. ndr is an 8-bit write-only register. no read is valid. if a read is attempted, an undetermined value is read out. it is initialized to h'00 by a reset, stand-by or module stop. the noise detector takes counts of the drop-outs of the horizontal sync signals and the noises within the pulses, and if they amount to a count greater than four times of the value set in ndr7 to ndr0, the detector sets the nois flag in the sync signal control register (syncr). set the noise detection level at 1/4 of the noise counts in one frame. the noise counter is cleared when ever vsync was detected twice. see section 28.15.6, noise detection, for the details of the noise detection window and the noise detection level. section 28 servo circuits rev.3.00 jan. 10, 2007 page 788 of 1038 rej09b0328-0300 (7) sync signal control register (syncr) 0 0 1 0 r 2 0 r/(w) * 3 1 4 5 6 1 7 ? ? ? ? ? ? ? ? r/w r/w nis/vd nois fld syct 11 1 note: * only 0 can be written bit : initial value : r/w : syncr controls the noise detection, field detection, polarity of the sync signal input, etc. syncr is an 8-bit register. it is initialized to h'f8 by a reset, stand-by or module stop. bits 7 to 4 are reserved. no write is valid. bit 1 is valid for read only. bits 7 to 4 ? reserved: writes are disabled. if a read is attempted, an undetermined value is read out. bit 3 ? interrupt selection bit (nis/vd): selects whether an interrupt request is generated when a noise level was detected or when the vd signal was detected. bit 3 nis/vd description 0 interrupt at the noise level 1 interrupt at vd (initial value) bit 2 ? noise detection flag (nois): nois is a status flag indica ting that the noise counts reached at more than four times of the value set in ndr. the flag is cleared only by writing 0 after reading 1. care is required because it is not cleared automatically. bit 2 nois description 0 noise count is smaller than four times of the value set in ndr (initial value) 1 noise count is equal to or greater than four times of the value set in ndr bit 1 ? field detection flag (fld): indicates whether the field curre ntly being scanned is even or odd. see figure 28.74. bit 1 fld description 0 odd field (initial value) 1 even field section 28 servo circuits rev.3.00 jan. 10, 2007 page 789 of 1038 rej09b0328-0300 bit 0 ? sync signal polarity selection bit (syct): selects the polarity of the sync signal (csync) to be input. bit 0 syct description polarity 0 (initial value) positive 1 negative field detection flag (fld) sepv noise detection window composite sync signal (csync) even field (a) even field (even) field detection flag (fld) sepv noise detection window composite sync signal (csync) odd field (b) odd field (odd) figure 28.74 field detection section 28 servo circuits rev.3.00 jan. 10, 2007 page 790 of 1038 rej09b0328-0300 28.15.6 noise detection if drop-out of a pulse of the horizontal sync signal occurred, set a supplemented pulse at the timing set in hpwr and with the set pulse width. set the noise detection window with hwr of about 1/4 of the horizontal sync signal, and the pulse with equal high and low periods will be obtained. (1) example of setting assumed that a supplemented pulse is se t when fosc = 10mhz under the conditions s = 5mhz, ntsc:th = 63.6 ( s) and hpuls = 4.7 ( s), the set values of the supplemented pulse timing (hrtr7-0), supplemented pulse width (hpwr3-0) and noise detection window timing (nwr5- 0) are expressed by the following equations. (value of hrtr7 ? 0) 2/ s = th ((value of hpwr3 ? 0) + 1) 2/ s = hpuls ((value of nwr5 ? 0) + 1) 2/ s = 1/4 th where, th is the cycle of the horizontal sync signal ( s), hpuls is the pulse width of the horizontal sync signal ( s) and s is the servo clock (hz) (fosc/2). accordingly, (value of hrtr7 to hrtr0) 0.4 ( s) = 63.6 ( s) hrtr7 ? 0 = h'9f ((value of hpwr3 to hpwr0) + 1) 0.4 ( s) = 4.7 ( s) hpwr3 ? 0 = h'b ((value of nwr5 to nwr0) + 1) 0.4 ( s) = 16 ( s) nwr5 ? 0 = h'27 also, the noise mask period is computed as follows. ((value of hrtr7 to hrtr0) + 1) ? 24) 2/ s = 54 ( s) where, 24 is a constant required for a structural reason. figure 28.75 shows the set period for hrtr, hpwr, and nwr. section 28 servo circuits rev.3.00 jan. 10, 2007 page 791 of 1038 rej09b0328-0300 legend: seph noise detection window noise mask for osch osch noise mask for h counter h reload counter h counter seph c osch : horizontal sync signal after detection : horizontal sync signal after supplement a b : value set for the noise detection window (nwr5 to nwr0) : value set for the pulse width of the horizontal sync signal (npwr3 to npwr0) c a , b , c : value set for supplement timing (hrtr7 to hrtr0) : complements of 1 of a,b,c, respectively h ' e 8 th :complement of 2 of multiplier 24 in the equation for the noise mask period (the noise mask period ends 24 counts before the overflow of h reload counter.) : cycle of the horizontal sync signal (ntsc:63.6 [ms], pal:64[ms]) tm : timing at which the noise mask period ends. drop-out of the horizontal sync signal ignore signal during noise mask period. th a b h'00 ovf h'e8 c a mask period period determined by nwr5 to nwr0 mask period tm mask period mask period mask period mask period mask period mask period th don't mask immediately after supplement period deter- mined by a and a period determined by hrtr7 to hrtr0 period determined by c and h'e8 period determined by hpwr3 to hper0 period determined by b do mask also im- mediately after supplement. figure 28.75 set period for hrtr, hpwr and nwr section 28 servo circuits rev.3.00 jan. 10, 2007 page 792 of 1038 rej09b0328-0300 (2) operation to detect noise the noise detector considers an irregular pulse of the composite sync signal (csync) and a chip of a pulse of the horizontal sync signal within a frame as noise. the noise counter takes counts of the irregular pulses during the high period of the noise detection window and the chips and drop-outs of the horizontal sync signal pulses during the low period. also, it counts more than one irregular pulses as one. the noise counter is cleared at every frame (vsync is detected twice). the equivalent pulse contained in 9h of the vertical sync signal is counted also as an irregular pulse. it sets the noise detection flag (nois) in the sync signal control register (syncr) at 1 if the count of the irregular pulses + the count of the pulse chips and drop-outs of the horizontal sync signal > 4 (value of ndr7 to ndr0). see section 28.15.5 (7), sync signal control register (syncr), for the nois bit. figure 28.76 shows the operation of the noise detection. csync noise detection window noise detection flag (nois) noise counter noise detection level noise detection flag is set. nois : bit 2 of the sync signal control register (syncr) noise figure 28.76 operation of the noise detection section 28 servo circuits rev.3.00 jan. 10, 2007 page 793 of 1038 rej09b0328-0300 28.15.7 sync signal detector activation the sync signal detector starts operation by release of reset, or by accepting input of a sync signal after its transition from power-down mode to active mode and release of module stop. the signal given to the detector is the polarity pulse assigned by the syct bit of the sync signal control register (syncr). the detector starts operation even if this pulse was a noise pulse with a width short of the regular width. the minimum pulse width which can activate the detector is not constant depending on the internal operation of the input circuit. accordingly, if the assured activation of the detector is required, input a pulse with a width greater than 4/ s ( s = fosc/2 (hz)). in such a case, care is required to noise, et c., because even a pulse w ith a width smaller than 4 /s may cause activation. section 28 servo circuits rev.3.00 jan. 10, 2007 page 794 of 1038 rej09b0328-0300 28.16 servo interrupt 28.16.1 overview the interrupt exception processing of the servo module is started by one of ten factors, i.e. the drum speed error detector ( 2), drum phase error detector, capstan speed error detector ( 2), capstan phase error detector, hsw timing generator ( 2), sync detector and ctl circuit. for these interrupt factors, see each of their circuit sections in this manual. also, see section 5, exception handling. 28.16.2 register configuration table 28.27 shows the list of the registers which control the interrupt of the servo section. table 28.27 registers which control the interrupt of the servo section name abbrev. r/w size initial value address servo interrupt permission register 1 sienr1 r/w byte h'00 h'fd0b8 servo interrupt permission register 2 sienr2 r/w byte h'fc h'fd0b9 servo interrupt request register 1 sirqr1 r/w byte h'00 h'fd0ba servo interrupt request register 2 sirqr2 r/w byte h'fc h'fd0bb 28.16.3 register description (1) servo interrupt permission register 1 (sienr1) 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 6 0 7 iecap3 iecap2 iecap1 iehsw2 iehsw1 0 r/w iedrm3 r/w r/w r/w iedrm2 iedrm1 bit : initial value : r/w : sienr1 controls the permission and prohibition of the interrupt of the servo section. sienr1 is an 8-bit readable/writable regist er. it is initialized to h'00 by a reset, stand-by or module stop. section 28 servo circuits rev.3.00 jan. 10, 2007 page 795 of 1038 rej09b0328-0300 bit 7 ? drum phase error detection int errupt permission bit (iedrm3) bit 7 iedrm3 description 0 prohibits the interrupt request through irrdrm3 (initial value) 1 permits the interrupt request through irrdrm3 bit 6 ? drum speed error detection (lock detection) interrupt permission bit (iedrm2) bit 6 iedrm2 description 0 prohibits the interrupt request through irrdrm2 (initial value) 1 permits the interrupt request through irrdrm2 bit 5 ? drum speed error detectio n (ovf, latch) interrupt permission bit (iedrm1) bit 5 iedrm1 description 0 prohibits the interrupt request through irrdrm1 (initial value) 1 permits the interrupt request through irrdrm1 bit 4 ? capstan phase error de tection interrupt permission bit (iecap3) bit 4 iecap3 description 0 prohibits the interrupt request through irrcap3 (initial value) 1 permits the interrupt request through irrcap3 bit 3 ? capstan speed error de tection (lock detectio n) interrupt permission bit (iecap2) bit 3 iecap2 description 0 prohibits the interrupt request through irrcap2 (initial value) 1 permits the interrupt request through irrcap2 section 28 servo circuits rev.3.00 jan. 10, 2007 page 796 of 1038 rej09b0328-0300 bit 2 ? capstan speed error detection (ovf, latch) interr upt permission bit (iecap1) bit 2 iecap1 description 0 prohibits the interrupt request through irrcap1 (initial value) 1 permits the interrupt request through irrcap1 bit 1 ? hsw timing generation (counter clear, capture) interrupt permission bit (iehsw2) bit 1 iehsw2 description 0 prohibits the interrupt request through irrhsw2 (initial value) 1 permits the interrupt request through irrhsw2 bit 0 ? hsw timing generation (ovw, matching, strig) interrupt permission bit (iehsw1) bit 0 iehsw1 description 0 prohibits the interrupt request through irrhsw1 (initial value) 1 permits the interrupt request through irrhsw1 (2) servo interrupt permission register 2 (sienr2) 0 0 1 0 r/w 2 3 4 5 6 1 7 ? ? ? ? ? ? ? ? ? ? ? ? r/w iesnc iectl 11 11 1 bit : initial value : r/w : sienr2 controls the permission and prohibition of the interrupt of the servo section. sienr2 is an 8-bit readable/writable register. it is initialized to h'fc by a reset, stand-by or module stop. bits 7 to 2 ? reserved: no read or write is valid. if a read is attempted, an undetermined value is read out. section 28 servo circuits rev.3.00 jan. 10, 2007 page 797 of 1038 rej09b0328-0300 bit 1 ? vertical sync signal interrupt permission bit (iesnc) bit 1 iesnc description 0 prohibits the interrupt (interrupt to the vertical sync signal) request through irrsnc (initial value) 1 permits the interrupt request through irrsnc bit 0 ? ctl interrupt permission bit (iectl) bit 0 iectl description 0 prohibits the interrupt request through irrctl (initial value) 1 permits the interrupt request through irrctl (3) servo interrupt request register 1 (sirqr1) 0 0 1 0 r/(w) * 2 0 r/(w) * 3 0 4 0 r/(w) * 0 r/(w) * 5 6 0 7 irrcap3 irrcap2 irrcap1 irrhsw2 irrhsw1 0 r/(w) * irrdrm3 r/(w) * r/(w) * r/(w) * irrdrm2 irrdrm1 note: * only 0 can be written to clear the flag. bit : initial value : r/w : sirqr1 displays an occurrence of an interrupt request of the servo section. if the interrupt request occurred, the corresponding bit is set to 1. sirqr1 is an 8-bit readable/writable register. writing is allowed only in the case of writing 0 to clear the flag. it is initia lized to h'00 by a reset, stand-by or module stop. bit 7 ? drum phase error detector interrupt request bit (irrdrm3) bit 7 irrdrm3 description 0 no interrupt request from the drum phase error detector (initial value) 1 interrupt requested from the drum phase error detector section 28 servo circuits rev.3.00 jan. 10, 2007 page 798 of 1038 rej09b0328-0300 bit 6 ? drum speed error detector (lock det ection) interrupt request bit (irrdrm2) bit 6 irrdrm2 description 0 no interrupt request from the drum speed error detector (lock detection) (initial value) 1 interrupt requested from the drum speed error detector (lock detection) bit 5 ? drum speed error detector (ovf, la tch) interrupt request bit (irrdrm1) bit 5 irrdrm1 description 0 no interrupt request from the drum speed error detector (ovf, latch) (initial value) 1 interrupt requested from the drum speed error detector (ovf, latch) bit 4 ? capstan phase error detector interrupt request bit (irrcap3) bit 4 irrcap3 description 0 no interrupt request from the capstan phase error detector (initial value) 1 interrupt requested from the capstan phase error detector bit 3 ? capstan speed error detector (lock detection) interrupt request bit (irrcap2) bit 3 irrcap2 description 0 no interrupt request from the capstan speed error detector (lock detection) (initial value) 1 interrupt requested from the drum speed error detector (lock detection) bit 2 ? capstan speed error detector (ovf, la tch) interrupt request bit (irrcap1) bit 2 irrcap1 description 0 no interrupt request from the capstan speed error detector (ovf, latch) (initial value) 1 interrupt requested from the capstan speed error detector (ovf, latch) section 28 servo circuits rev.3.00 jan. 10, 2007 page 799 of 1038 rej09b0328-0300 bit 1 ? hsw timing generator (counter clear, capture) interrupt permission bit (irrhsw2) bit 1 irrhsw2 description 0 no interrupt request from the hsw timing generator (counter clear, capture) (initial value) 1 interrupt requested from the hsw timing generator (counter clear, capture) bit 0 ? hsw timing generator (ovw, matching, strig) interrupt permission bit (irrhsw1) bit 0 irrhsw1 description 0 no interrupt request from the hsw timing generator (ovw, matching, strig) (initial value) 1 interrupt requested from the hsw timing generator (ovw, matching, strig) (4) servo interrupt request register 2 (sirqr2) 0 0 1 0 r/(w) * 2 3 4 5 6 1 7 ? ? ? ? ? ? ? ? ? ? ? ? r/(w) * irrsnc irrctl 11 11 1 note: * only 0 can be written to clear the flag. bit : initial value : r/w : sirqr2 displays an occurrence of an interrupt request of the servo section. if the interrupt request occurred, the corresponding bit is set to 1. sirqr2 is an 8-bit readable/writable register. writing 0 after reading 1 is allowed; no other writing is allowed. it is initialized to h'fc by a reset, stand-by or module stop. bits 7 to 2 ? reserved: no read or write is valid. if a read is attempted, an undetermined value is read out. section 28 servo circuits rev.3.00 jan. 10, 2007 page 800 of 1038 rej09b0328-0300 bit 1 ? vertical sync signal interrupt request bit (irrsnc) bit 1 irrsnc description 0 no interrupt request from the sync signal detector (vd, noise) (initial value) 1 interrupt requested from the sync signal detector (vd, noise) bit 0 ? ctl signal interrupt request bit (irrctl) bit 0 irrctl description 0 no interrupt request from ctl (initial value) 1 interrupt requested from ctl section 28 servo circuits rev.3.00 jan. 10, 2007 page 801 of 1038 rej09b0328-0300 28.17 module stop control reigster (mstpcr) 7 1 mstp15 r/w mstpcrh 6 1 mstp14 r/w 5 1 mstp13 r/w 4 1 mstp12 r/w 3 1 mstp11 r/w 2 1 mstp10 r/w 1 1 mstp9 r/w 0 1 mstp8 r/w 7 1 mstp7 r/w 6 1 mstp6 r/w 5 1 mstp5 r/w 4 1 mstp4 r/w 3 1 mstp3 r/w 2 1 mstp2 r/w 1 1 mstp1 r/w 0 1 mstp0 r/w mstpcrl bit : initial value : r/w : mstpcr comprises two 8-bit readable/writable registers, that perform module stop mode control. when the mstp1 bit is set to 1, servo circuit and 12-bit pwm stop the operation at the end of the bus cycle and enter to the module stop mode. for details, see 4.5 module stop mode. mstpcr is initialized to h'ffff by a reset. bit 1 ? module stop 1 (mstp1): this bit specifies module stop mode of the servo circuit and 12- bit pwm. mstpcrl bit 1 mstp1 description 0 clear the module stop mode of the servo circuit and 12-bit pwm 1 set the module stop mode of the servo circuit and 12-bit pwm (initial value) section 28 servo circuits rev.3.00 jan. 10, 2007 page 802 of 1038 rej09b0328-0300 section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 803 of 1038 rej09b0328-0300 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 vcc ? 0.3 to +7.0 v input voltage (ports other than port 0) vin ? 0.3 to vcc +0.3 v input voltage (port 0) vin ? 0.3 to avcc +0.3 v a/d converter power supply voltage avcc ? 0.3 to +7.0 v a/d converter input voltage avin ? 0.3 to avcc +0.3 v servo power supply voltage svcc ? 0.3 to +7.0 v servo amplifier input voltage vin ? 0.3 to svcc +0.3 v operating temperature topr ? 20 to +75 c operating temperature (at flash memory program/erase) topr 0 to +75 c storage temperature tstr ? 55 to +125 c notes: 1. permanent damage may occur to the chip if absolute maximum ratings are exceeded. normal operation should be under the conditions specified in electrical characteristics. exceeding these values can result in incorrect operation and reduced reliability. 2. all voltages are relative to vss = svss = avss = 0.0 v. section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 804 of 1038 rej09b0328-0300 29.2 electrical characteristics of HD64F2194 29.2.1 dc characteristics of HD64F2194 table 29.2 dc characteristics of HD64F2194 and HD64F2194c (conditions: vcc = avcc = 4.0 v to 5.5 v, vss = 0.0 v, ta = ?20 to +75 c unless otherwise specified.) values item symbol applicable pins test conditions min typ max unit notes md0 vcc = 2.7 v to 5.5 v 0.9 vcc ? vcc +0.3 0.8 vcc ? vcc +0.3 res , nmi , fwe, ic , irq0 to irq5 vcc = 2.7 v to 5.5 v 0.9 vcc ? vcc +0.3 sck1, sck2, si1, si2, cs , ftia, ftib, ftic, ftid, trig, tmbi, adtrg 0.8 vcc ? vcc +0.3 vcc ?0.5 ? vcc +0.3 osc1, x1 vcc = 2.7 v to 5.5 v vcc ?0.3 ? vcc +0.3 0.7 vcc ? vcc +0.3 p00 to p07, p10 to p17, p20 to p27, p30 to p37, p40 to p47, p50 to p57, p60 to p67, p70 to p77, p80 to p87, ps0 to ps4 vcc = 2.7 v to 5.5 v 0.8 vcc ? vcc +0.3 input high voltage v ih csync 0.7 vcc ? vcc +0.3 v section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 805 of 1038 rej09b0328-0300 values item symbol applicable pins test conditions min typ max unit notes md0 vcc = 2.7 v to 5.5 v ?0.3 ? 0.1 vcc ? 0.3 ? 0.2 vcc res , nmi , fwe, ic , irq0 to irq5 vcc = 2.7 v to 5.5 v ? 0.3 ? 0.1 vcc sck1, sck2, si1, si2, cs , ftia, ftib, ftic, ftid, trig, tmbi, adtrg ? 0.3 ? 0.2 vcc ? 0.3 ? 0.5 osc1, x1 vcc = 2.7 v to 5.5 v ? 0.3 ? 0.3 ? 0.3 ? 0.3 vcc p00 to p07, p10 to p17, p20 to p27, p30 to p37, p40 to p47, p50 to p57, p60 to p67, p70 to p77, p80 to p87, ps0 to ps4 vcc = 2.7 v to 5.5 v ? 0.3 ? 0.2 vcc input low voltage v il csync ? 0.3 ? 0.2 vcc v ? i oh = 1.0 ma vcc ?1.0 ? ? v ? i oh = 0.5 ma ? vcc ?0.5 ? v reference value output high voltage v oh so1, so2, sck1, sck2, pwm1, pwm2, pwm3, pwm4, pwm14, strb, buzz, tmo, tmow, ftoa, ftob, ppg70 to ppg77, rp0 to rp7, p10 to p17, p20 to p27, p30 to p37, p40 to p47, p50 to p57, p60 to p67, p70 to p77, p80 to p87, ps0 to ps4 ? i oh = 0.1 ma vcc = 2.7 v to 5.5 v vcc ?0.5 ? ? v section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 806 of 1038 rej09b0328-0300 values item symbol applicable pins test conditions min typ max unit notes i ol = 1.6 ma ? ? 0.6 v so1, so2, sck1, sck2, pwm1, pwm2, pwm3, pwm4, pwm14, strb, buzz, tmo, tmow, ftoa, ftob, ppg70 to ppg77, rp0 to rp7, p10 to p17, p20 to p27, p30 to p37, p40 to p47, p50 to p57, p60 to p67, p70 to p77, ps0 to ps4 i ol = 0.4 ma vcc = 2.7 v to 5.5 v ? ? 0.4 i ol = 20 ma ? ? 1.5 i ol = 1.6 ma ? ? 0.6 output low voltage v ol p80 to p87, i ol = 0.4 ma vcc = 2.7 v to 5.5 v ? ? 0.4 md0, osc1 res , nmi , fwe, irq0 to irq5 , ic vin = 0.5 v to vcc ?0.5 v ? ? 1.0 sck1, sck2, si1, si2, cs , ftia, ftib, ftic, ftid, trig, tmbi, adtrg vin = 0.5 to vcc ?0.5 v ? ? 1.0 p10 to p17, p20 to p27, p30 to p37, p40 to p47, p50 to p53, p60 to p67, p70 to p77, p80 to p87, ps0 to ps4 vin = 0.5 to vcc ?0.5 v ? ? 1.0 input/output leakage current ? i il ? p00 to p07, an8 to anb vin = 0.5 to avcc ?0.5 v ? ? 1.0 a section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 807 of 1038 rej09b0328-0300 values item symbol applicable pins test conditions min typ max unit notes pull-up mos current ? ip p10 to p17, p20 to p27, p30 to p37, vcc = 5.0 v, vin = 0 v 50 ? 300 a note 1 all input pins except power supply, p13, p23, p24 and analog system pins fin = 1 mhz, vin = 0 v, ta = 25 c ? ? 15 pf input capaci- tance cin p13, p23, p24 fin = 1 mhz, vin = 0 v, ta = 25 c ? ? 20 vcc = 5 v, f osc = 10-mhz, high-speed mode ? 50 70 ma note 2 active mode current dissipation (cpu operating) i ope vcc vcc = 5 v, f osc = 10-mhz, medium-speed mode (1/64) ? 35 ? reference value active mode current dissipation (reset) i res vcc vcc = 5 v, f osc = 10 mhz ? 30 45 ma note 2 sleep mode current dissipa-tion i sleep vcc vcc = 5 v, f osc =10-mhz high-speed mode ? 20 30 vcc = 2.7 v, with 32-khz crystal oscillator ( sub = w/2) ? 90 150 note 2 subactive mode current dissipation i sub vcc vcc = 2.7 v, with 32-khz crystal oscillator ( sub = w/8) ? 40 ? a reference value, note 2 vcc = 2.7 v, with 32-khz crystal oscillator ( sub = w/2) ? 15 30 note 2 subsleep mode current dissipation i subslp vcc vcc = 2.7 v, with 32-khz crystal oscillator ( sub = w/8) ? 10 ? a reference value, note 2 section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 808 of 1038 rej09b0328-0300 values item symbol applicable pins test conditions min typ max unit notes vcc = 2.7 v, with 32-khz crystal oscillator ? 5 10 a note 2 watch mode current dissipation i watch vcc vcc = 5.0 v, with 32-khz crystal oscillator ? 10 ? reference value, note 2 standby mode current dissipation i stby vcc x1 = vcc, without 32-khz crystal oscillator ? ? 5 note 2 ram data retaining voltage in standby mode v stby 2.0 ? ? v notes: do not open the avcc and avss pin even when the a/d converter is not in use. 1. current value when the relevant bit of the pull-up mos select register (pur1 to pur3) is set to 1. 2. the current on the pull-up mos or the output buffer excluded. table 29.3 pin status at cu rrent dissipation measurement mode res pin internal state pin oscillator pin active mode high-speed, medium- speed vcc operating vcc sleep mode high-speed, medium- speed vcc cpu and servo circuits stopped. vcc reset vss reset vcc standby mode vcc all stopped vcc main clock: crystal oscillator sub clock: x1 pin = vcc subactive mode vcc cpu and timer a operating vcc subsleep mode vcc timer a operating vcc watch mode vcc timer a operating vcc main clock: crystal oscillator sub clock: crystal oscillator section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 809 of 1038 rej09b0328-0300 table 29.4 bus drive characteristics of HD64F2194 and HD64F2194c (conditions: vcc = avcc = 4.0 v to 5.5 v, vss = 0.0 v, ta = ?20 to +75 c unless otherwise specified.) applicable pin: scl, sda values item symbol applicable pins test conditions min typ max unit v t ? 0.2 vcc ? ? v v t + ? ? 0.7 vcc v schmidt trigger input voltage v t + ?v t ? scl, sda 0.05 vcc ? ? v input high voltage v ih scl, sda 0.7 vcc ? vcc +0.5 v input low voltage v il scl, sda ? 0.5 ? 0.2 vcc v i ol = 8 ma ? ? 0.5 output low voltage v ol scl, sda i ol = 3 ma ? ? 0.4 v scl and sda output fall time t of scl, sda 20 + 0.1cb ? 250 ns section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 810 of 1038 rej09b0328-0300 29.2.2 allowable output currents of HD64F2194 and HD64F2194c the specifications for the digital pins are shown below. table 29.5 allowable output currents of HD64F2194 and HD64F2194c (conditions: vcc = 2.7 v to 5.5 v, vss = 0.0 v, ta = ?20 to +75 c) item symbol value unit notes allowable input current (to chip) i o 2 ma 1 allowable input current (to chip) i o 22 ma 2 allowable input current (to chip) i o 10 ma 3 allowable output current (from chip) ? i o 2 ma 4 total allowable input current (to chip) i o 80 ma 5 total allowable output current (from chip) ? i o 50 ma 6 notes: 1. the allowable input current is the maximum value of the current flowing from each i/o pin to v ss (except for port 8, scl and sda). 2. the allowable input current is the maximum value of the current flowing from each i/o pin to v ss . this applies to port 8. 3. the allowable input current is the maximum value of the current flowing from each i/o pin to v ss . this applies to scl and sda. 4. the allowable output current is the maximum value of the current flowing from v cc to each i/o pin. 5. the total allowable input current is the sum of the currents flowing from all i/o pins to v ss simultaneously. 6. the total allowable output current is the sum of the currents flowing from v cc to all i/o pins. section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 811 of 1038 rej09b0328-0300 29.2.3 ac characteristics of HD64F2194 and HD64F2194c table 29.6 ac characteristics of HD64F2194 and HD64F2194c (conditions: vcc = avcc = 4.0 v to 5.5 v, vss = avss = 0.0 v, ta = ?20 to +75 c unless otherwise specified.) values item symbol applicable pins test conditions min typ max unit notes clock oscillation frequency f osc osc1, osc2 8 ? 10 mhz clock cycle time t cyc osc1, osc2 100 ? 125 ns figure 29.1 subclock oscillation frequency f x x1, x2 vcc = 2.7 v to 5.5 v ? 32.768 ? khz subclock cycle time t subcyc x1, x2 vcc = 2.7 v to 5.5 v ? 30.518 ? s figure 29.2 osc1, osc2 crystal oscillator ? ? 10 ms oscillation stabilization time t rc x1, x2 32-khz crystal oscillator vcc = 2.7 v to 5.5 v ? ? 2 s external clock high width t cph osc1 40 ? ? ns external clock low width t cpl osc1 40 ? ? ns external clock rise time t cpr osc1 ? ? 10 ns external clock fall time t cpf osc1 ? ? 10 ns figure 29.1 external clock stabilization delay time t dext osc1 500 ? ? s figure 29.3 subclock input low level pulse width t excll x1 vcc = 2.7 v to 5.5 v ? 15.26 ? s figure 29.2 subclock input high level pulse width t exclh x1 vcc = 2.7 v to 5.5 v ? 15.26 ? s section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 812 of 1038 rej09b0328-0300 values item symbol applicable pins test conditions min typ max unit notes subclock input rise time t exclr x1 vcc = 2.7 v to 5.5 v ? ? 10 ns figure 29.2 subclock input fall time t ecxlf x1 vcc = 2.7 v to 5.5 v ? ? 10 ns res pin low level width t rel res vcc = 2.7 v to 5.5 v 20 ? ? t cyc figure 29.4 input pin high level width t ih irq0 to irq5 , nmi , ic , adtrg , tmbi, ftia, ftib, ftic, ftid, trig vcc = 2.7 v to 5.5 v 2 ? ? t cyc t subcyc input pin low level width t il irq0 to irq5 , nmi , ic , adtrg , tmbi, ftia, ftib, ftic, ftid, trig vcc = 2.7 v to 5.5 v 2 ? ? t cyc t subcyc figure 29.5 t cyc t cph v il v ih osc1 t cpl t cpf t cpr figure 29.1 system clock timing section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 813 of 1038 rej09b0328-0300 t exclf t subcyc t exclh t excll t exclr v il v ih x1 vcc 0.5 figure 29.2 subclock input timing vcc osc1 t dext * res (internal) 4.0 v the t dext includes the res pin low level width 20 t cyc . note: * figure 29.3 external clock stabilization delay timing section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 814 of 1038 rej09b0328-0300 res v il t rel figure 29.4 reset input timing t il t ih v ih irq0 to irq5 , nmi , ic , adtrg , tmbi, ftia, ftib, ftic, ftid, trig v il figure 29.5 input timing section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 815 of 1038 rej09b0328-0300 29.2.4 serial interface timing of HD64F2194 and HD64F2194c table 29.7 serial interface timing of HD64F2194 and HD64F2194c (conditions: vcc = avcc = 4.0 v to 5.5 v, vss = avss = 0.0 v, ta = ?20 to +75 c unless otherwise specified.) values item symbol applicable pins test conditions min typ max unit figure asynchroniza- tion 4 ? ? sck1 clock synchronization 6 ? ? input clock cycle t scyc sck2 2 ? ? t cyc input clock pulse width t sckw sck1, sck2 0.4 ? 0.6 t scyc sck1 ? ? 1.5 t cyc input clock rise time t sckr sck2 ? ? 60 ns sck1 ? ? 1.5 t cyc input clock fall time t sckf sck2 ? ? 60 ns figure 29.6 transmit data delay time (clock sync) t txd so1 ? ? 100 ns receive data setup time (clock sync) t rxs si1 100 ? ? ns receive data hold time (clock sync) t rxh si1 100 ? ? ns figure 29.7 transmit data output delay time t txd so2 ? ? 200 ns receive data setup time (clock sync) t rxs si2 180 ? ? ns receive data hold time (clock sync) t rxh si2 180 ? ? ns figure 29.7 cs setup time t css cs 1 ? ? t scyc cs hold time t csh cs 1 ? ? t scyc figure 29.8 section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 816 of 1038 rej09b0328-0300 t sckf t sckr v il or v ol v ih or v oh sck1 t sckw t scyc figure 29.6 sck1 clock timing v il v ih t txd sck1, sck2 so1, so2 si1, si2 t rxs t rxh figure 29.7 sci i/o timing/clock synchronization mode v ih v ih v il cs sck2 t csh t css figure 29.8 sci2 chip select timing section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 817 of 1038 rej09b0328-0300 lsi output pin timing reference level v oh : 2.0 v v ol : 0.8 v 30 pf 12 k 2.4 k vcc figure 29.9 output load conditions section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 818 of 1038 rej09b0328-0300 table 29.8 i 2 c bus interface timing of HD64F2194 and HD64F2194c (conditions: vcc = avcc = 4.0 v to 5.5 v, vss = avss = 0.0 v, ta = ?20 to +75 c unless otherwise specified.) values item symbol test conditions min typ max unit figure scl input cycle time t scl 12 ? ? t cyc scl input high pulse width t sclh 3 ? ? t cyc scl input low pulse width t scll 5 ? ? t cyc scl, sda input rise time t sr ? ? 7.5 * t cyc scl, sda input fall time t sf ? ? 300 ns scl, sda input spike pulse removal time t sp ? ? 1 t cyc sda input bus free time t buf 5 ? ? t cyc start condition input hold time t stah 3 ? ? t cyc re-transmit start condition input setup time t stas 3 ? ? t cyc stop condition input setup time t stos 3 ? ? t cyc data input setup time t sdas 0.5 ? ? t cyc data input hold time t sdah 0 ? ? ns scl, sda capacity load c b ? ? 400 pf figure 29.10 note: * can also be set to 17.5 t cyc depending on the selection of clock to be used by the i 2 c module. section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 819 of 1038 rej09b0328-0300 t stah t sr t sdah t scl t scll t sclh t sf t stas t sp t stos t sdas v il v ih sda scl p * s * sr * p * s, p, and sr denote the following: s : start conditions p : stop conditions sr: re-transmit start conditions note: * t buf figure 29.10 i 2 c bus interface i/o timing section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 820 of 1038 rej09b0328-0300 29.2.5 a/d converter characteristics of HD64F2194 and HD64F2194c table 29.9 a/d converter characteristics of HD64F2194 and HD64F2194c (conditions: vcc = avcc = 4.0 v to 5.5 v, vss = avss = 0.0 v, ta = ?20 to +75 c unless otherwise specified.) values item symbol applicable pins test conditions min typ max unit analog power supply voltage avcc avcc vcc ?0.3 vcc vcc +0.3 v analog input voltage a vin an0 to an7, an8 to anb avss ? avcc v a icc avcc avcc = 5.0 v ? ? 2.0 ma analog power supply current a istop avcc vcc = 2.7 to 5.5 v, at reset and in power-down mode ? ? 10 a analog input capacitance c ain an0 to an7, an8 to anb ? ? 30 pf allowable signal source impedance r ain an0 to an7, an8 to anb ? ? 10 k resolution ? ? 10 bit absolute accuracy avcc = 5.0 v ? ? 4 lsb conversion time 13.4 ? 26.6 s note: do not open the avcc and avss pin even when the a/d converter is not in use. set avcc = vcc and avss = vss. section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 821 of 1038 rej09b0328-0300 29.2.6 servo section electrical characteristics of HD64F2194 and HD64F2194c table 29.10 servo section electrical characteristics of HD64F2194 and HD64F2194c (reference values) (conditions: vcc = svcc = 5.0 v, vss = svss = 0.0 v, ta = 25 c unless otherwise specified.) reference values item symbol applicable pins test conditions min typ max unit ctlgr3 = 0, ctlgr2 = 0, ctlgr1 = 0, ctlgr0 = 0, f = 10 khz 32.0 34.0 36.0 ctlgr3 = 0, ctlgr2 = 0, ctlgr1 = 0, ctlgr0 = 1, f = 10 khz 34.5 36.5 38.5 ctlgr3 = 0, ctlgr2 = 0, ctlgr1 = 1, ctlgr0 = 0, f = 10 khz 37.0 39.0 41.0 ctlgr3 = 0, ctlgr2 = 0, ctlgr1 = 1, ctlgr0 = 1, f = 10 khz 39.5 41.5 43.5 ctlgr3 = 0, ctlgr2 = 1, ctlgr1 = 0, ctlgr0 = 0, f = 10 khz 42.0 44.0 46.0 ctlgr3 = 0, ctlgr2 = 1, ctlgr1 = 0, ctlgr0 = 1, f = 10 khz 44.5 46.5 48.5 ctlgr3 = 0, ctlgr2 = 1, ctlgr1 = 1, ctlgr0 = 0, f = 10 khz 47.0 49.0 51.0 ctlgr3 = 0, ctlgr2 = 1, ctlgr1 = 1, ctlgr0 = 1, f = 10 khz 49.5 51.5 53.5 ctlgr3 = 1, ctlgr2 = 0, ctlgr1 = 0, ctlgr0 = 0, f = 10 khz 52.0 54.0 56.0 ctlgr3 = 1, ctlgr2 = 0, ctlgr1 = 0, ctlgr0 = 1, f = 10 khz 54.5 56.5 58.5 ctlgr3 = 1, ctlgr2 = 0, ctlgr1 = 1, ctlgr0 = 0, f = 10 khz 57.0 59.0 61.0 ctlgr3 = 1, ctlgr2 = 0, ctlgr1 = 1, ctlgr0 = 1, f = 10 khz 59.5 61.5 63.5 ctlgr3 = 1, ctlgr2 = 1, ctlgr1 = 0, ctlgr0 = 0, f = 10 khz 62.0 64.0 66.0 ctlgr3 = 1, ctlgr2 = 1, ctlgr1 = 0, ctlgr0 = 1, f = 10 khz 64.5 66.5 68.5 ctlgr3 = 1, ctlgr2 = 1, ctlgr1 = 1, ctlgr0 = 0, f = 10 khz 67.0 69.0 71.0 pb-ctl input amplifier voltage gain ctl (+) ctlgr3 = 1, ctlgr2 = 1, ctlgr1 = 1, ctlgr0 = 1, f = 10 khz 69.5 71.5 73.5 db section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 822 of 1038 rej09b0328-0300 reference values item symbol applicable pins test conditions min typ max unit v+th ac coupling, c = 0.1 f typ (non pol) ? 250 ? pb-ctl schmidt input v ? th ctlsmt (i) ac coupling, c = 0.1 f typ (non pol) ? ? 250 ? mvp analog switch on resistance reb ? 150 ? ctl (+) ? 8 ? rec-ctl output current ictl ctl ( ? ) series resistance = 0 ? 8 ? ma rec-ctl inter-pin resistance rctl ? 10 ? k ctl reference output voltage ctlref ? 1/2 svcc ? v cfg pin bias voltage cfg ? 1/2 sv cc ? v cfg input level cfg ac coupling, c = 1 f typ, f = 1 khz 1.0 ? ? vpp cfg input impedance cfg ? 10 ? k v+thcf rise threshold level ? 2.25 ? cfg input threshold voltage v ? thcf cfg fall threshold level ? 2.75 ? v v+thdf rising edge schmidt level ? 1.95 ? dfg schmidt input v ? thdf dfg falling edge schmidt level ? 1.85 ? v v+thdp rising edge schmidt level ? 3.55 ? dpg schmidt input v ? thdp dpg falling edge schmidt level ? 3.45 ? v v oh ? i oh = 0.1 ma 4.0 ? ? v om no load, hi-z= 1 ? 2.5 ? 3-level output voltage v ol vpulse i ol = 0.1 ma ? ? 1.0 v 3-level output pin divided voltage resistance vpulse ? 15 ? k cfg duty cfg ac coupling, c = 1 f typ, f = 1 khz 48 ? 52 % section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 823 of 1038 rej09b0328-0300 table 29.11 servo section electrical characteristics of HD64F2194 and HD64F2194c (conditions: vcc = svcc = 5.0 v, vss = svss = 0.0 v, ta = 25 c unless otherwise specified.) values item symbol applicable pins test conditions min typ max unit digital input high voltage v ih 0.8 vcc ? vcc +0.3 digital input low voltage v il comp, exctl, excap, exttrg ? 0.3 ? 0.2 vcc v digital output high voltage v oh ? i oh = 1 ma vcc ?1.0 ? ? digital output low voltage v ol h.ampsw, c.rotary, videoff, audioff, drmpwm, cappwm, sv1, sv2 i ol = 1.6 ma ? ? 0.6 v current dissipationi ccsv svcc at no load ? 5 10 ma section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 824 of 1038 rej09b0328-0300 29.2.7 flash memory characteristics table 29.12 shows the flash memory characteristics. table 29.12 flash memory characteristics (preliminary) conditions: vcc = 5.0 v 10%, avcc = 5.0 v 10%, vss = avss = 0 v, ta = 0 to +75 c (operating temperature range at programming/erasing) item symbol min typ max unit test conditions programming time * 1 * 2 * 4 t p ? 10 200 ms/ 32 bytes erasing time * 1 * 3 * 5 t e ? 100 1200 ms/ block reprogramming count n wec 100 * 7 10000 * 8 ? times data retention time * 9 t drp 10 ? ? years wait time after swe-bit setting * 1 10 ? ? s ? wait time after psu-bit setting * 1 50 ? ? s ? wait time after p-bit setting * 1 * 4 150 ? 200 s 200 wait time after p-bit clearing * 1 10 ? ? s ? wait time after psu-bit clearing * 1 10 ? ? s ? wait time after pv-bit setting * 1 4 ? ? s ? wait time after dummy write * 1 2 ? ? s ? wait time after pv-bit clearing * 1 4 ? ? s ? at programming maximum no. of programmings * 1 * 4 * 5 ? ? 1000 times 1000 when z = 200 s wait time after swe-bit setting * 1 10 ? ? s ? wait time after esu-bit setting * 1 200 ? ? s ? wait time after e-bit setting * 1 * 6 5 ? 10 ms 10 wait time after e-bit clearing * 1 10 ? ? s ? wait time after esu-bit clearing * 1 10 ? ? s ? wait time after ev-bit setting * 1 20 ? ? s ? wait time after dummy write * 1 2 ? ? s ? wait time after ev-bit clearing * 1 5 ? ? s ? at erasing maximum no. of erasings * 1 * 6 120 ? 240 times 240 times section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 825 of 1038 rej09b0328-0300 notes: 1. perform each time setting according to the programming/erasing algorithm. 2. programming time per 32 bytes (total time of setting p-bit of the flash memory control register. programming verify time is not included). 3. time to erase 1 block (total time of setting e-bit of the flash memory control register. erasing verify time is not included). 4. maximum programming time (t p (max.)) = wait time after p-bit setting (z) maximum no. of programming (n) 5. no. of times when wait time after p-bit setting (z) = 200 s. set maximum no. of programming shall be set less than maximum programming time (t p (max.)) according to the actual setting (z). 6. relationship between wait time after e-bit setting (z) and maximum no. of erasing (n) for maximum erasing time (t e (max.)) is as follows: t e (max.) = wait time after e-bit setting maximum no. of erasing (n) set the (z) and (n) values so that they satisfy the above equation. (ex.) when z = 5 [ms], n = 240 times (ex.) when z = 10 [ms], n = 120 times 7. minimum number of times for which all ch aracteristics are guaranteed after rewriting (guarantee range is 1 to minimum value). 8. reference value for 25 c (as a guideline, rewriting should normally function up to this value). 9. data retention characteristic when rewriting is performed within the specification range, including the minimum value. 29.2.8 usage note the f-ztat version and the mask rom version satis fy the electrical charact eristics indicated in this manual, but the actual power value, operating margin, and noise margin may differ from those in this manual, due to the difference of production process, on-chip rom, layout pattern, etc. when executing the system examination using the f-ztat version, be sure to execute the same system examination using the mask rom version when changing to the mask rom version. section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 826 of 1038 rej09b0328-0300 29.3 electrical characteristics of hd6432194, hd6432193, hd6432192, hd6432191, hd6432194c, hd6432194b, and hd6432194a 29.3.1 dc characteristics of hd6432194, hd6432193, hd6432192, hd6432191, hd6432194c, hd6432194b, and hd6432194a table 29.13 dc characteristics of hd6432194, hd6432193, hd6432192, hd6432191, hd6432194c, hd6432194b, and hd6432194a (conditions: vcc = avcc = 4.0 v to 5.5 v, vss = avss = 0.0 v, ta = ?20 to +75 c unless otherwise specified.) values item symbol applicable pins test conditions min typ max unit notes md0 vcc = 2.5 v to 5.5 v 0.9 vcc ? vcc +0.3 0.8 vcc ? vcc +0.3 res , nmi , ic , irq0 to irq5 vcc = 2.5 v to 5.5 v 0.9 vcc ? vcc +0.3 sck1, sck2, si1, si2, cs , ftia, ftib, ftic, ftid, trig, tmbi, adtrg 0.8 vcc ? vcc +0.3 vcc ?0.5 ? vcc +0.3 osc1, x1 vcc = 2.5 v to 5.5 v vcc ?0.3 ? vcc +0.3 0.7 vcc ? vcc +0.3 p00 to p07, p10 to p17, p20 to p27, p30 to p37, p40 to p47, p50 to p57, p60 to p67, p70 to p77, p80 to p87, ps0 to ps4 vcc = 2.5 v to 5.5 v 0.8 vcc ? vcc +0.3 input high voltage v ih csync 0.7 vcc ? vcc +0.3 v section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 827 of 1038 rej09b0328-0300 values item symbol applicable pins test conditions min typ max unit notes md0 vcc = 2.5 v to 5.5 v ? 0.3 ? 0.1 vcc ? 0.3 ? 0.2 vcc res , nmi , ic , irq0 to irq5 vcc = 2.5 v to 5.5 v ? 0.3 ? 0.1 vcc sck1, sck2, si1, si2, cs , ftia, ftib, ftic, ftid, trig, tmbi, adtrg ? 0.3 ? 0.2 vcc ? 0.3 ? 0.5 osc1, x1 vcc = 2.5 v to 5.5 v ? 0.3 ? 0.3 ? 0.3 ? 0.3 vcc p00 to p07, p10 to p17, p20 to p27, p30 to p37, p40 to p47, p50 to p57, p60 to p67, p70 to p77, p80 to p87, ps0 to ps4 vcc = 2.5 v to 5.5 v ? 0.3 ? 0.2 vcc input low voltage v il csync ? 0.3 ? 0.2 vcc v ? i oh = 1.0 ma vcc ?1.0 ? ? v ? i oh = 0.5 ma ? vcc ?0.5 ? v referenc e value output high voltage v oh so1, so2, sck1, sck2, pwm1, pwm2, pwm3, pwm4, pwm14, strb, buzz, tmo, tmow, ftoa, ftob, ppg70 to ppg77, rp0 to rp7, p10 to p17, p20 to p27, p30 to p37, p40 to p47, p50 to p57, p60 to p67, p70 to p77, p80 to p87, ps0 to ps4 ? i oh = 0.1 ma vcc = 2.5 v to 5.5 v vcc ?0.5 ? ? v section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 828 of 1038 rej09b0328-0300 values item symbol applicable pins test conditions min typ max unit notes i ol = 1.6 ma ? ? 0.6 v so1, so2, sck1, sck2, pwm1, pwm2, pwm3, pwm4, pwm14, strb, buzz, tmo, tmow, ftoa, ftob, ppg70 to ppg77, rp0 to rp7, p10 to p17, p20 to p27, p30 to p37, p40 to p47, p50 to p57, p60 to p67, p70 to p77, ps0 to ps4 i ol = 0.4 ma vcc = 2.5 v to 5.5 v ? ? 0.4 i ol = 20 ma ? ? 1.5 i ol = 1.6 ma ? ? 0.6 output low voltage v ol p80 to p87 i ol = 0.4 ma vcc = 2.5 v to 5.5 v ? ? 0.4 md0, osc1 res , nmi , irq0 to irq5 , ic vin = 0.5 to vcc ?0.5 v ? ? 1.0 sck1, sck2, si1, si2, cs , ftia, ftib, ftic, ftid, trig, tmbi, adtrg vin = 0.5 to vcc ?0.5 v ? ? 1.0 p10 to p17, p20 to p27, p30 to p37, p40 to p47, p50 to p57, p60 to p67, p70 to p77, p80 to p87 ps0 to ps4 vin = 0.5 to vcc ?0.5 v ? ? 1.0 input/ output leakage current ? i il ? p00 to p07, an8 to anb vin = 0.5 to avcc ?0.5 v ? ? 1.0 a section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 829 of 1038 rej09b0328-0300 values item symbol applicable pins test conditions min typ max unit notes pull-up mos current ? ip p10 to p17, p20 to p27, p30 to p37 vcc = 5.0 v, vin = 0 v 50 ? 300 a note 1 input capacity cin all input pins except power supply, p23, p24 and analog system pins fin = 1 mhz, vin = 0 v, ta = 25 c ? ? 15 pf p23, p24 fin = 1 mhz, vin = 0 v, ta = 25 c ? ? 20 vcc = 5 v, f osc = 10-mhz high-speed mode ? 50 70 ma note 2 active mode current dissipa-tion (cpu operating) i ope vcc vcc = 5 v, f osc = 10-mhz medium-speed mode (1/64) ? 35 ? reference value active mode current dissipa-tion (reset) i res vcc vcc = 5 v, f osc = 10 mhz ? 25 45 ma note 2 sleep mode current dissipa-tion i sleep vcc vcc = 5 v, f osc = 10-mhz high- speed mode ? 20 30 vcc = 2.5 v, with 32-khz crystal oscillator ( sub = w/2) ? 40 100 note 2 subactive mode current dissipa-tion i sub vcc vcc = 2.5 v, with 32-khz crystal oscillator ( sub = w/8) ? 20 ? a reference value, note 2 vcc = 2.5 v, with 32-khz crystal oscillator ( sub = w/2) ? 15 30 note 2 subsleep mode current dissipa-tion i subslp vcc vcc = 2.5 v, with 32-khz crystal oscillator ( sub = w/8) ? 10 ? a reference value, note 2 section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 830 of 1038 rej09b0328-0300 values item symbol applicable pins test conditions min typ max unit notes vcc = 2.5 v, with 32-khz crystal oscillator ? 5 10 a note 2 watch mode current dissipa-tion i watch vcc vcc = 5.0 v, with 32-khz crystal oscillator ? 10 ? reference value, note 2 standby mode current dissipa-tion i stby vcc x1 = vcc, without 32-khz crystal oscillator ? ? 5 note 2 ram data retaining voltage in standby mode v stby vcc 2.0 ? ? v notes: do not open the avcc and avss pin even when the a/d converter is not in use. 1. current value when the relevant bit of the pull-up mos select register (pur1 to pur3) is set to 1. 2. the current on the pull-up mos or the output buffer excluded. table 29.14 pin status at cu rrent dissipation measurement mode res pin internal state pin oscillator pin active mode high-speed, medium- speed vcc operating vcc sleep mode high-speed, medium- speed vcc cpu and servo circuits stopped vcc reset vss reset vcc standby mode vcc all stopped vcc main clock: crystal oscillator sub clock: x1 pin = vcc subactive mode vcc cpu and timer a operating vcc subsleep mode vcc timer a operating vcc watch mode vcc timer a operating vcc main clock: crystal oscillator sub clock: crystal oscillator section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 831 of 1038 rej09b0328-0300 table 29.15 bus drive characteristics of hd6432194, hd6432193, hd6432192, hd6432191, hd6432194c, hd6432194b, and hd6432194a (conditions: vcc = avcc = 4.0 v to 5.5 v, vss = 0.0 v, ta = ?20 to +75 c unless otherwise specified.) applicable pin: scl, sda values item symbol applicable pins test conditions min typ max unit v t ? 0.2 vcc ? ? v v t + ? ? 0.7 vcc v schmidt trigger input voltage v t + ? v t ? scl, sda 0.05 vcc ? ? v input high voltage v ih scl, sda 0.7 vcc ? vcc +0.5 v input low voltage v il scl, sda ? 0.5 ? 0.2 vcc v i ol = 8 ma ? ? 0.5 output low voltage v ol scl, sda i ol = 3 ma ? ? 0.4 v scl and sda output fall time t of scl, sda 20 + 0.1cb ? 250 ns section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 832 of 1038 rej09b0328-0300 29.3.2 allowable output currents of hd 6432194, hd6432193, hd6432192, hd6432191, hd6432194c, hd6432194b, and hd6432194a the specifications for the digital pins are shown below. table 29.16 allowable output currents of hd6432194, hd6432193, hd6432192, hd6432191, hd6432194c, hd6432194b, and hd6432194a (conditions: vcc = 2.5 v to 5.5 v, vss = 0.0 v, ta = ?20 to +75 c) item symbol value unit notes allowable input current (to chip) i o 2 ma 1 allowable input current (to chip) i o 22 ma 2 allowable input current (to chip) i o 10 ma 3 allowable output current (from chip) ? i o 2 ma 4 total allowable input current (to chip) i o 80 ma 5 total allowable output current (from chip) ? i o 50 ma 6 notes: 1. the allowable input current is the maximum value of the current flowing from each i/o pin to v ss (except for port 8, scl and sda). 2. the allowable input current is the maximum value of the current flowing from each i/o pin to v ss . this applies to port 8. 3. the allowable input current is the maximum value of the current flowing from each i/o pin to v ss . this applies to scl and sda. 4. the allowable output current is the maximum value of the current flowing from v cc to each i/o pin. 5. the total allowable input current is the sum of the currents flowing from all i/o pins to v ss simultaneously. 6. the total allowable output current is the sum of the currents flowing from v cc to all i/o pins. section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 833 of 1038 rej09b0328-0300 29.3.3 ac characteristics of hd6432194, hd6432193, hd6432192, hd6432191, hd6432194c, hd6432194b, and hd6432194a table 29.17 ac characteristics of hd6432194, hd6432193, hd6432192, hd6432191, hd6432194c, hd6432194b, and hd6432194a (conditions: vcc = avcc = 4.0 v to 5.5 v, vss = avss = 0.0 v, ta = ?20 to +75 c unless otherwise specified.) values item symbol applicable pins test conditions min typ max unit notes clock oscillation frequency f osc osc1, osc2 8 ? 10 mhz clock cycle time t cyc osc1, osc2 100 ? 125 ns figure 29.11 subclock oscillation frequency f x x1, x2 vcc = 2.5 v to 5.5 v ? 32.768 ? khz subclock cycle time t subcyc x1, x2 vcc = 2.5 v to 5.5 v ? 30.518 ? s figure 29.12 osc1, osc2 crystal oscillator ? ? 10 ms oscillation stabilization time t rc x1, x2 32-khz crystal oscillator vcc = 2.5 v to 5.5 v ? ? 2 s external clock high width t cph osc1 40 ? ? ns external clock low width t cpl osc1 40 ? ? ns external clock rise time t cpr osc1 ? ? 10 ns external clock fall time t cpf osc1 ? ? 10 ns figure 29.11 external clock stabilization delay time t dext osc1 500 ? ? s figure 29.13 section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 834 of 1038 rej09b0328-0300 values item symbol applicable pins test conditions min typ max unit notes subclock input low level pulse width t excll x1 vcc = 2.5 v to 5.5 v ? 15.26 ? s subclock input high level pulse width t exclh x1 vcc = 2.5 v to 5.5 v ? 15.26 ? s figure 29.12 subclock input rise time t exclr x1 vcc = 2.5 v to 5.5 v ? ? 10 ns subclock input fall time t exclf x1 vcc = 2.5 v to 5.5 v ? ? 10 ns figure 29.12 res pin low level width t rel res vcc = 2.5 v to 5.5 v 20 ? ? t cyc figure 29.14 input pin high level width t ih irq0 to irq5 , nmi , ic , adtrg , tmbi, ftia, ftib, ftic, ftid, trig vcc = 2.5 v to 5.5 v 2 ? ? t cyc t subcyc input pin low level width t il irq0 to irq5 , nmi , ic , adtrg , tmbi, ftia, ftib, ftic, ftid, trig vcc = 2.5 v to 5.5 v 2 ? ? t cyc t subcyc figure 29.15 t cyc t cph v il v ih osc1 t cpl t cpf t cpr figure 29.11 system clock timing section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 835 of 1038 rej09b0328-0300 t exclf t subcyc t exclh t excll t exclr v il v ih x1 vcc 0.5 figure 29.12 subclock input timing vcc osc1 t dext * res (internal) 4.0 v the t dext includes the res pin low level width 20 t cyc . note: * figure 29.13 external clock stabilization delay timing section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 836 of 1038 rej09b0328-0300 res v il t rel figure 29.14 reset input timing t il t ih v ih irq0 to irq5 , nmi , ic , adtrg , tmbi, ftia, ftib, ftic, ftid, trig v il figure 29.15 input timing section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 837 of 1038 rej09b0328-0300 29.3.4 serial interface timing of hd6432194, hd6432193, hd6432192, hd6432191, hd6432194c, hd6432194b, and hd6432194a table 29.18 serial interface timing of hd6432194, hd6432193, hd6432192, hd6432191, hd6432194c, hd6432194b, and hd6432194a (conditions: vcc = avcc = 4.0 v to 5.5 v, vss = avss = 0.0 v, ta = ?20 to +75 c unless otherwise specified.) values item symbol applicable pins test conditions min typ max unit figure asynchroniza- tion 4 ? ? sck1 clock synchronization 6 ? ? input clock cycle t scyc sck2 2 ? ? t cyc input clock pulse width t sckw sck1, sck2 0.4 ? 0.6 t scyc sck1 ? ? 1.5 t cyc input clock rise time t sckr sck2 ? ? 60 ns sck1 ? ? 1.5 t cyc input clock fall time t sckf sck2 ? ? 60 ns figure 29.16 transmit data delay time (clock sync) t txd so1 ? ? 100 ns receive data setup time (clock sync) t rxs si1 100 ? ? ns receive data hold time (clock sync) t rxh si1 100 ? ? ns figure 29.17 transmit data output delay time t txd so2 ? ? 200 ns receive data setup time (clock sync) t rxs si2 180 ? ? ns receive data hold time (clock sync) t rxh si2 180 ? ? ns figure 29.17 cs setup time t css cs 1 ? ? t scyc cs hold time t csh cs 1 ? ? t scyc figure 29.18 section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 838 of 1038 rej09b0328-0300 t sckf t sckr v il or v ol v ih or v oh sck1 t sckw t scyc figure 29.16 sck1 clock timing v il v ih t txd sck1, sck2 so1, so2 si1, si2 t rxs t rxh figure 29.17 sci i/o timing/clock synchronization mode v ih v ih v il cs sck2 t csh t css figure 29.18 sci2 chip select timing section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 839 of 1038 rej09b0328-0300 lsi output pin timing reference level v oh : 2.0 v v ol : 0.8 v 30 pf 12 k 2.4 k vcc figure 29.19 output load conditions section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 840 of 1038 rej09b0328-0300 table 29.19 i 2 c bus interface timing of hd6432194, hd6432193, hd6432192, hd6432191, hd6432194c, hd6432194b, and hd6432194a (conditions: vcc = avcc = 4.0 v to 5.5 v, vss = avss = 0.0 v, ta = ?20 to +75 c unless otherwise specified.) values item symbol test conditions min typ max unit figure scl input cycle time t scl 12 ? ? t cyc scl input high pulse width t sclh 3 ? ? t cyc scl input low pulse width t scll 5 ? ? t cyc scl, sda input rise time t sr ? ? 7.5 * t cyc scl, sda input fall time t sf ? ? 300 ns scl, sda input spike pulse removal time t sp ? ? 1 t cyc sda input bus free time t buf 5 ? ? t cyc start condition input hold time t stah 3 ? ? t cyc re-transmit start condition input setup time t stas 3 ? ? t cyc stop condition input setup time t stos 3 ? ? t cyc data input setup time t sdas 0.5 ? ? t cyc data input hold time t sdah 0 ? ? ns scl, sda capacity load c b ? ? 400 pf figure 29.10 note: * can also be set to 17.5 t cyc depending on the selection of clock to be used by the i 2 c module. section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 841 of 1038 rej09b0328-0300 t stah t sr t sdah t scl t scll t sclh t sf t stas t sp t stos t sdas v il v ih sda scl p * s * sr * p * s, p, and sr denote the following: s : start conditions p : stop conditions sr: re-transmit start conditions note: * t buf figure 29.20 i 2 c bus interface i/o timing section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 842 of 1038 rej09b0328-0300 29.3.5 a/d converter characteristics of hd6432194, hd6432193, hd6432192, hd6432191, hd6432194c, hd6432194b, and hd6432194a table 29.20 a/d converter characteristics of hd6432194, hd6432193, hd6432192, hd6432191, hd6432194c, hd6432194b, and hd6432194a (conditions: vcc = avcc = 4.0 v to 5.5 v, vss = avss = 0.0 v, ta = ?20 to +75 c unless otherwise specified.) values item symbol applicable pins test conditions min typ max unit analog power supply voltage avcc avcc vcc ?0.3 vcc vcc +0.3 v analog input voltage a vin an0 to an7, an8 to anb avss ? avcc v a icc avcc avcc = 5.0 v ? ? 2.0 ma analog power supply current a istop avcc vcc = 2.5 v to 5.5 v, at reset and in power-down mode ? ? 10 a analog input capacitance c ain an0 to an7, an8 to anb ? ? 30 pf allowable signal source impedance r ain an0 to an7, an8 to anb ? ? 10 k resolution ? ? 10 bit absolute accuracy avcc = 5.0 v ? ? 4 lsb conversion time 13.4 ? 26.6 s note: do not open the avcc and avss pin even when the a/d converter is not in use. set avcc = vcc and avss = vss. section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 843 of 1038 rej09b0328-0300 29.3.6 servo section electrical characteristics of hd6432194, hd6432193, hd6432192, hd6432191, hd6432194c, hd6432194b, and hd6432194a table 29.21 servo section electrical characteristics of hd6432194, hd6432193, hd6432192, hd6432191, hd6432194c, hd6432194b, and hd6432194a (reference values) (conditions: vcc = svcc = 5.0 v, vss = svss = 0.0 v, ta = 25 c unless otherwise specified.) reference values item symbol applicable pins test conditions min typ max unit ctlgr3 =0, ctlgr2 = 0, ctlgr1 = 0, ctlgr0 = 0, f = 10 khz 32.0 34.0 36.0 ctlgr3 = 0, ctlgr2 = 0, ctlgr1 = 0, ctlgr0 = 1, f = 10 khz 34.5 36.5 38.5 ctlgr3 = 0, ctlgr2 = 0, ctlgr1 = 1, ctlgr0 = 0, f = 10 khz 37.0 39.0 41.0 ctlgr3 = 0, ctlgr2 = 0, ctlgr1 = 1, ctlgr0 = 1, f = 10 khz 39.5 41.5 43.5 ctlgr3 = 0, ctlgr2 = 1, ctlgr1 = 0, ctlgr0 = 0, f = 10 khz 42.0 44.0 46.0 ctlgr3 = 0, ctlgr2 = 1, ctlgr1 = 0, ctlgr0 = 1, f = 10 khz 44.5 46.5 48.5 ctlgr3 = 0, ctlgr2 = 1, ctlgr1 = 1, ctlgr0 = 0, f = 10 khz 47.0 49.0 51.0 ctlgr3 = 0, ctlgr2 = 1, ctlgr1 = 1, ctlgr0 = 1, f = 10 khz 49.5 51.5 53.5 ctlgr3 = 1, ctlgr2 = 0, ctlgr1 = 0, ctlgr0 = 0, f = 10 khz 52.0 54.0 56.0 ctlgr3 = 1, ctlgr2 = 0, ctlgr1 = 0, ctlgr0 = 1, f = 10 khz 54.5 56.5 58.5 ctlgr3 = 1, ctlgr2 = 0, ctlgr1 = 1, ctlgr0 = 0, f = 10 khz 57.0 59.0 61.0 ctlgr3 = 1, ctlgr2 = 0, ctlgr1 = 1, ctlgr0 = 1, f = 10 khz 59.5 61.5 63.5 ctlgr3 = 1, ctlgr2 = 1, ctlgr1 = 0, ctlgr0 = 0, f = 10 khz 62.0 64.0 66.0 ctlgr3 = 1, ctlgr2 = 1, ctlgr1 = 0, ctlgr0 = 1, f = 10 khz 64.5 66.5 68.5 ctlgr3 = 1, ctlgr2 = 1, ctlgr1 = 1, ctlgr0 = 0, f = 10 khz 67.0 69.0 71.0 pb-ctl input amplifier voltage gain ctl (+) ctlgr3 = 1, ctlgr2 = 1, ctlgr1 = 1, ctlgr0 = 1, f = 10 khz 69.5 71.5 73.5 db section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 844 of 1038 rej09b0328-0300 reference values item symbol applicable pins test conditions min typ max unit v+th ac coupling, c = 0.1 f typ (non pol) ? 250 ? pb-ctl schmidt input v ? th ctlsmt (i) ac coupling, c = 0.1 f typ (non pol) ? ? 250 ? mvp analog switch on resistance reb ? 150 ? ctl (+) ? 8 ? rec-ctl output current ictl ctl ( ? ) series resistance = 0 ? 8 ? ma rec-ctl inter-pin resistance rctl ? 10 ? k ctl reference output voltage ctlref ? 1/2 sv cc ? v cfg pin bias voltage cfg ? 1/2 sv cc ? v cfg input level cfg ac coupling, c = 1 f typ, f = 1 khz 1.0 ? ? vpp cfg input impedance cfg ? 10 ? k v+thcf rise threshold level ? 2.25 ? cfg input threshold value v ? thcf cfg fall threshold level ? 2.75 ? v v+thdf rising edge schmidt level ? 1.95 ? dfg schmidt input v ? thdf dfg falling edge schmidt level ? 1.85 ? v v+thdp rising edge schmidt level ? 3.55 ? dpg schmidt input v ? thdp dpg falling edge schmidt level ? 3.45 ? v v oh ? i oh = 0.1 ma 4.0 ? ? v om no load, hi-z = 1 ? 2.5 ? 3-level output voltage v ol vpulse i ol = 0.1 ma ? ? 1.0 v 3-level output pin divided voltage resistance vpulse ? 15 ? k cfg duty cfg ac coupling, c = 1 f typ, f = 1 khz 48 ? 52 % section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 845 of 1038 rej09b0328-0300 table 29.22 servo section electrical characteristics of hd6432194, hd6432193, hd6432192, hd6432191, hd6432194c, hd6432194b, and hd6432194a (conditions: vcc = svcc = 5.0 v, vss = svss = 0.0 v, ta = 25 c unless otherwise specified.) values item symbol applicable pins test conditions min typ max unit digital input high voltage v ih 0.8 vcc ? vcc +0.3 digital input low voltage v il comp, exctl, excap, exttrg ?0.3 ? 0.2 vcc v digital output high voltage v oh ? i oh = 1 ma vcc ?1.0 ? ? digital output low voltage v ol h.ampsw, c.rotary, videoff, audioff, drmpwm, cappwm, sv1, sv2 i ol = 1.6 ma ? ? 0.6 v current dissipationi ccsv svcc at no load ? 5 10 ma section 29 electrical characteristics rev.3.00 jan. 10, 2007 page 846 of 1038 rej09b0328-0300 appendix a instruction set rev.3.00 jan. 10, 2007 page 847 of 1038 rej09b0328-0300 appendix a instruction set a.1 instructions operation notation rd general register (destination) * 1 rs general register (source) * 1 rn general register * 1 ern general register (32-bit register) mac multiplication-addition register (32-bit register) * 2 (ead) destination operand (eas) source operand exr extend register ccr condition code register n n (negative flag) in ccr z z (zero) flag in ccr v v (overflow) flag in ccr c c (carry) flag in ccr pc program counter sp stack pointer #imm immediate data disp displacement + addition ? subtraction multiplication division logical and logical or exclusive logical or move from the left to the right logical complement ( ) <> contents of operand :8/:16/:24/:32 8-, 16-, 24-, 32-bit length appendix a instruction set rev.3.00 jan. 10, 2007 page 848 of 1038 rej09b0328-0300 notes: 1. general register is 8-bit (r0h to r7h, r0l to r7l), 16-bit (r0 to r7) or 32-bit (er0 to er7). 2. mac register cannot be used in this lsi. condition code notation symbol description modified according to the instruction result * not fixed (value not guaranteed) 0 always cleared to 0 1 always set to 1 ? not affected by the instruction execution result appendix a instruction set rev.3.00 jan. 10, 2007 page 849 of 1038 rej09b0328-0300 table a.1 list of instruction set (1) data transfer instruction mov.b #xx:8,rd mov.b rs,rd mov.b @ers,rd mov.b @(d:16,ers),rd mov.b @(d:32,ers),rd mov.b @ers+,rd mov.b @aa:8,rd mov.b @aa:16,rd mov.b @aa:32,rd mov.b rs,@erd mov.b rs,@(d:16,erd) mov.b rs,@(d:32,erd) mov.b rs,@-erd mov.b rs,@aa:8 mov.b rs,@aa:16 mov.b rs,@aa:32 mov.w #xx:16,rd mov.w rs,rd mov.w @ers,rd mov.w @(d:16,ers),rd mov.w @(d:32,ers),rd mov.w @ers+,rd mov.w @aa:16,rd mov.w @aa:32,rd mov.w rs,@erd mov.w rs,@(d:16,erd) mov.w rs,@(d:32,erd) mov.w rs,@-erd mov.w rs,@aa:16 mov.w rs,@aa:32 mov.l #xx:32,erd mov.l ers,erd mov.l @ers,erd mov.l @(d:16,ers),erd mov.l @(d:32,ers),erd mov.l @ers+,erd mov.l @aa:16,erd mov.l @aa:32,erd mov.l ers,@erd mov.l ers,@(d:16,erd) mov.l ers,@(d:32,erd) mov.l ers,@-erd mov.l ers,@aa:16 mov.l ers,@aa:32 pop.w rn pop.l ern push.w rn push.l ern ldm @sp+,(erm-ern) stm (erm-ern),@-sp movfpe @aa:16,rd movtpe rs,@aa:16 b b b b b b b b b b b b b b b b w w w w w w w w w w w w w w l l l l l l l l l l l l l l w l w l l l 2 4 6 2 2 2 2 2 2 2 4 4 4 8 4 8 4 8 4 8 6 10 6 10 2 2 2 2 4 4 2 4 6 2 4 6 4 6 4 6 6 8 6 8 mov pop push ldm stm movfpe movtpe mnemonic size addressing mode and instruction length (bytes) #xx rn @ern @(d,ern) @-ern/@ern+ @aa @(d,pc) @@aa #xx:8 rd8 rs8 rd8 @ers rd8 @(d:16,ers) rd8 @(d:32,ers) rd8 @ers rd8,ers32+1 ers32 @aa:8 rd8 @aa:16 rd8 @aa:32 rd8 rs8 @erd rs8 @(d:16,erd) rs8 @(d:32,erd) erd32-1 erd32,rs8 @erd rs8 @aa:8 rs8 @aa:16 rs8 @aa:32 #xx:16 rd16 rs16 rd16 @ers rd16 @(d:16,ers) rd16 @(d:32,ers) rd16 @ers rd16,ers32+2 ers32 @aa:16 rd16 @aa:32 rd16 rs16 @erd rs16 @(d:16,erd) rs16 @(d:32,erd) erd32-2 erd32,rs16 @erd rs16 @aa:16 rs16 @aa:32 #xx:32 erd32 ers32 erd32 @ers erd32 @(d:16,ers) erd32 @(d:32,ers) erd32 @ers erd32,ers32+4 ers32 @aa:16 erd32 @aa:32 erd32 ers32 @erd ers32 @(d:16,erd) ers32 @(d:32,erd) erd32-4 erd32,ers32 @erd ers32 @aa:16 ers32 @aa:32 @sp rn16,sp+2 sp @sp ern32,sp+4 sp sp-2 sp,rn16 @sp sp-4 sp,ern32 @sp (@sp ern32,sp+4 sp) repeat for the number of returns (sp-4 sp,ern32 @sp) repeat for the number of returns operation condition code no of execution states * 1 i hn zvc advanced mode 2 4 2 4 4 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ? ? 1 1 2 3 5 3 2 3 4 2 3 5 3 2 3 4 2 1 2 3 5 3 3 4 2 3 5 3 3 4 3 1 4 5 7 5 5 6 4 5 7 5 5 6 3 5 3 5 7/9/11 [1] 7/9/11 [1] [2] [2] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? cannot be used in this lsi ? ? ? ? ? appendix a instruction set rev.3.00 jan. 10, 2007 page 850 of 1038 rej09b0328-0300 (2) arithmetic instructions add.b #xx:8,rd add.b rs,rd add.w #xx:16,rd add.w rs,rd add.l #xx:32,erd add.l ers,erd addx #xx:8,rd addx rs,rd adds #1,erd adds #2,erd adds #4,erd inc.b rd inc.w #1,rd inc.w #2,rd inc.l #1,erd inc.l #2,erd daa rd sub.b rs,rd sub.w #xx:16,rd sub.w rs,rd sub.l #xx:32,erd sub.l ers,erd subx #xx:8,rd subx rs,rd subs #1,erd subs #2,erd subs #4,erd dec.b rd dec.w #1,rd dec.w #2,rd dec.l #1,erd dec.l #2,erd das rd mulxu.b rs,rd mulxu.w rs,erd mulxs.b rs,rd mulxs.w rs,erd divxu.b rs,rd divxu.w rs,erd divxs.b rs,rd divxs.w rs,erd cmp.b #xx:8,rd cmp.b rs,rd cmp.w #xx:16,rd cmp.w rs,rd cmp.l #xx:32,erd cmp.l ers,erd neg.b rd neg.w rd neg.l erd extu.w rd extu.l erd exts.w rd exts.l erd tas @erd mac @ern+,@erm+ clrmac ldmac ers,mach ldmac ers,macl stmac mach,erd stmac macl,erd b b w w l l b b l l l b w w l l b b w w l l b b l l l b w w l l b b w b w b w b w b b w w l l b w l w l w l b 2 4 6 2 4 6 2 2 4 6 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 4 4 2 2 4 4 2 2 2 2 2 2 2 2 2 2 add addx adds inc daa sub subx subs dec das mulxu mulxs divxu divxs cmp neg extu exts tas * 2 mac clrmac ldmac stmac mnemonic size #xx rn @ern @(d,ern) @-ern/@ern+ @aa @(d,pc) @@aa ? rd8+#xx:8 rd8 rd8+rs8 rd8 rd16+#xx:16 rd16 rd16+rs16 rd16 erd32+#xx:32 erd32 erd32+ers32 erd32 rd8+#xx:8+c rd8 rd8+rs8+c rd8 erd32+1 erd32 erd32+2 erd32 erd32+4 erd32 rd8+1 rd8 rd16+1 rd16 rd16+2 rd16 erd32+1 erd32 erd32+2 erd32 rd8 10 decimal adjust rd8 rd8-rs8 rd8 rd16-#xx:16 rd16 rd16-rs16 rd16 erd32-#xx:32 erd32 erd32-ers32 erd32 rd8-#xx:8-c rd8 rd8-rs8-c rd8 erd32-1 erd32 erd32-2 erd32 erd32-4 erd32 rd8-1 rd8 rd16-1 rd16 rd16-2 rd16 erd32-1 erd32 erd32-2 erd32 rd8 10 decimal adjust rd8 rd8 rs8 rd16(multiplication w/o sign) rd16 rs16 erd32 (multiplication w/o sign) rd8 rs8 rd16(multiplication w/o sign) rd16 rs16 erd32 (multiplication w/o sign) rd16 rs8 rd16 (rdh: rmainder, rdl: quatient)(division w/o sign) erd32 rs16 erd32 (ed:remainder, rd: quatient)(division with sign) rd16 rs8 rd16(rdh: rmainder, rdl: quatient)(division w/o sign) erd32 rs16 erd32 (ed:remainder, rd: quatient)(division with sign) rd8-#xx:8 rd8-rs8 rd16-#xx:16 rd16-rs16 erd32-#xx:32 erd32-ers32 0-rd8 rd8 0-rd16 rd16 0-erd32 erd32 0 ( appendix a instruction set rev.3.00 jan. 10, 2007 page 851 of 1038 rej09b0328-0300 (3) logic operations instructions and.b #xx:8,rd and.b rs,rd and.w #xx:16,rd and.w rs,rd and.l #xx:32,erd and.l ers,erd or.b #xx:8,rd or.b rs,rd or.w #xx:16,rd or.w rs,rd or.l #xx:32,erd or.l ers,erd xor.b #xx:8,rd xor.b rs,rd xor.w #xx:16,rd xor.w rs,rd xor.l #xx:32,erd xor.l ers,erd not.b rd not.w rd not.l erd b b w w l l b b w w l l b b w w l l b w l 2 4 6 2 4 6 2 4 6 2 2 4 2 2 4 2 2 4 2 2 2 and or xor not mnemonic size #xx rn @ern @(d,ern) @-ern/@ern+ @aa @(d,pc) @@aa ? rd8 #xx:8 rd8 rd8 rs8 rd8 rd16 #xx:16 rd16 rd16 rs16 rd16 erd32 #xx:32 erd32 erd32 ers32 erd32 rd8 #xx:8 rd8 rd8 rs8 rd8 rd16 #xx:16 rd16 rd16 rs16 rd16 erd32 #xx:32 erd32 erd32 ers32 erd32 rd8 #xx:8 rd8 rd8 rs8 rd8 rd16 #xx:16 rd16 rd16 rs16 rd16 erd32 #xx:32 erd32 erd32 ers32 erd32 ~rd8 rd8 ~rd16 rd16 ~erd32 erd32 operation condition code i hn zvc advanced mode 1 1 2 1 3 2 1 1 2 1 3 2 1 1 2 1 3 2 1 1 1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? addressing mode and instruction length (bytes) no of execution states * 1 appendix a instruction set rev.3.00 jan. 10, 2007 page 852 of 1038 rej09b0328-0300 (4) shift instructions shal.b rd shal.b #2,rd shal.w rd shal.w #2,rd shal.l erd shal.l #2,erd shar.b rd shar.b #2,rd shar.w rd shar.w #2,rd shar.l erd shar.l #2,erd shll.b rd shll.b #2,rd shll.w rd shll.w #2,rd shll.l erd shll.l #2,erd shlr.b rd shlr.b #2,rd shlr.w rd shlr.w #2,rd shlr.l erd shlr.l #2,erd rotxl.b rd rotxl.b #2,rd rotxl.w rd rotxl.w #2,rd rotxl.l erd rotxl.l #2,erd rotxr.b rd rotxr.b #2,rd rotxr.w rd rotxr.w #2,rd rotxr.l erd rotxr.l #2,erd rotl.b rd rotl.b #2,rd rotl.w rd rotl.w #2,rd rotl.l erd rotl.l #2,erd rotr.b rd rotr.b #2,rd rotr.w rd rotr.w #2,rd rotr.l erd rotr.l #2,erd b b w w l l b b w w l l b b w w l l b b w w l l b b w w l l b b w w l l b b w w l l b b w w l l 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 shal shar shll shlr rotxl rotxr rotl rotr mnemonic size #xx rn @ern @(d,ern) @-ern/@ern+ @aa @(d,pc) @@aa ? operation condition code i hn zvc advanced mode 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0 0 0 0 0 0 c 0 msb lsb c msb lsb c msb lsb c msb lsb c msb lsb c 0 msb lsb c 0 msb lsb c msb lsb addressing mode and instruction length (bytes) no of execution states * 1 appendix a instruction set rev.3.00 jan. 10, 2007 page 853 of 1038 rej09b0328-0300 (5) bit manipulation instructions bset #xx:3,rd bset #xx:3,@erd bset #xx:3,@aa:8 bset #xx:3,@aa:16 bset #xx:3,@aa:32 bset rn,rd bset rn,@erd bset rn,@aa:8 bset rn,@aa:16 bset rn,@aa:32 bclr #xx:3,rd bclr #xx:3,@erd bclr #xx:3,@aa:8 bclr #xx:3,@aa:16 bclr #xx:3,@aa:32 bclr rn,rd bclr rn,@erd bclr rn,@aa:8 bclr rn,@aa:16 bclr rn,@aa:32 bnot #xx:3,rd bnot #xx:3,@erd bnot #xx:3,@aa:8 bnot #xx:3,@aa:16 bnot #xx:3,@aa:32 bnot rn,rd bnot rn,@erd bnot rn,@aa:8 bnot rn,@aa:16 bnot rn,@aa:32 btst #xx:3,rd btst #xx:3,@erd btst #xx:3,@aa:8 btst #xx:3,@aa:16 btst #xx:3,@aa:32 btst rn,rd btst rn,@erd btst rn,@aa:8 btst rn,@aa:16 btst rn,@aa:32 bld #xx:3,rd bld #xx:3,@erd bld #xx:3,@aa:8 bld #xx:3,@aa:16 bld #xx:3,@aa:32 bild #xx:3,rd bild #xx:3,@erd bild #xx:3,@aa:8 bild #xx:3,@aa:16 bild #xx:3,@aa:32 bst #xx:3,rd bst #xx:3,@erd bst #xx:3,@aa:8 bst #xx:3,@aa:16 bst #xx:3,@aa:32 bist #xx:3,rd bist #xx:3,@erd bist #xx:3,@aa:8 bist #xx:3,@aa:16 bist #xx:3,@aa:32 band #xx:3,rd band #xx:3,@erd band #xx:3,@aa:8 band #xx:3,@aa:16 band #xx:3,@aa:32 b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b 2 2 2 2 2 2 2 2 2 2 2 2 2 4 4 4 4 4 4 4 4 4 4 4 4 4 4 6 8 4 6 8 4 6 8 4 6 8 4 6 8 4 6 8 4 6 8 4 6 8 4 6 8 4 6 8 4 6 8 4 6 8 4 6 8 bset bclr bnot btst bld bild bst bist band mnemonic size #xx rn @ern @(d,ern) @-ern/@ern+ @aa @(d,pc) @@aa ? (#xx:3 of rd8) 1 (#xx:3 of @erd) 1 (#xx:3 of @aa:8) 1 (#xx:3 of @aa:16) 1 (#xx:3 of @aa:32) 1 (rn8 of rd8) 1 (rn8 of @erd) 1 (rn8 of @aa:8) 1 (rn8 of @aa:16) 1 (rn8 of @aa:32) 1 (#xx:3 of rd8) 0 (#xx:3 of @erd) 0 (#xx:3 of @aa:8) 0 (#xx:3 of @aa:16) 0 (#xx:3 of @aa:32) 0 (rn8 of rd8) 0 (rn8 of @erd) 0 (rn8 of @aa:8) 0 (rn8 of @aa:16) 0 (rn8 of @aa:32) 0 (#xx:3 of rd8) [~(#xx:3 of rd8)] (#xx:3 of @erd) [~(#xx:3 of @erd)] (#xx:3 of @aa:8) [~(#xx:3 of @aa:8)] (#xx:3 of @aa:16) [~(#xx:3 of @aa:16)] (#xx:3 of @aa:32) [~(#xx:3 of @aa:32)] (rn8 of rd8) [~(rn8 of rd8)] (rn8 of @erd) [~(rn8 of @erd)] (rn8 of @aa:8) [~(rn8 of @aa:8)] (rn8 of @aa:16) [~(rn8 of @aa:16)] (rn8 of @aa:32) [~(rn8 of @aa:32)] ~(#xx:3 of rd8) z ~(#xx:3 of @erd) z ~(#xx:3 of @aa:8) z ~(#xx:3 of @aa:16) z ~(#xx:3 of @aa:32) z ~(rn8 of rd8) z ~(rn8 of @erd) z ~(rn8 of @aa:8) z ~(rn8 of @aa:16) z ~(rn8 of @aa:32) z (#xx:3 of rd8) c (#xx:3 of @erd) c (#xx:3 of @aa:8) c (#xx:3 of @aa:16) c (#xx:3 of @aa:32) c ~(#xx:3 of rd8) c ~(#xx:3 of @erd) c ~(#xx:3 of @aa:8) c ~(#xx:3 of @aa:16) c ~(#xx:3 of @aa:32) c c (#xx:3 of rd8) c (#xx:3 of @erd) c (#xx:3 of @aa:8) c (#xx:3 of @aa:16) c (#xx:3 of @aa:32) ~c (#xx:3 of rd8) ~c (#xx:3 of @erd) ~c (#xx:3 of @aa:8) ~c (#xx:3 of @aa:16) ~c (#xx:3 of @aa:32) c (#xx:3 of rd8) c c (#xx:3 of @erd) c c (#xx:3 of @aa:8) c c (#xx:3 of @aa:16) c c (#xx:3 of @aa:32) c operation condition code i hn zvc advanced mode ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1 4 4 5 6 1 4 4 5 6 1 4 4 5 6 1 4 4 5 6 1 4 4 5 6 1 4 4 5 6 1 3 3 4 5 1 3 3 4 5 1 3 3 4 5 1 3 3 4 5 1 4 4 5 6 1 4 4 5 6 1 3 3 4 5 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? addressing mode and instruction length (bytes) no of execution states * 1 appendix a instruction set rev.3.00 jan. 10, 2007 page 854 of 1038 rej09b0328-0300 biand #xx:3,rd biand #xx:3,@erd biand #xx:3,@aa:8 biand #xx:3,@aa:16 biand #xx:3,@aa:32 bor #xx:3,rd bor #xx:3,@erd bor #xx:3,@aa:8 bor #xx:3,@aa:16 bor #xx:3,@aa:32 bior #xx:3,rd bior #xx:3,@erd bior #xx:3,@aa:8 bior #xx:3,@aa:16 bior #xx:3,@aa:32 bxor #xx:3,rd bxor #xx:3,@erd bxor #xx:3,@aa:8 bxor #xx:3,@aa:16 bxor #xx:3,@aa:32 bixor #xx:3,rd bixor #xx:3,@erd bixor #xx:3,@aa:8 bixor #xx:3,@aa:16 bixor #xx:3,@aa:32 b b b b b b b b b b b b b b b b b b b b b b b b b biand bor bior bxor bixor mnemonic size #xx rn @ern @(d,ern) @-ern/@ern+ @aa @(d,pc) @@aa ? c [~(#xx:3 of rd8)] c c [~(#xx:3 of @erd)] c c [~(#xx:3 of @aa:8)] c c [~(#xx:3 of @aa:16)] c c [~(#xx:3 of @aa:32)] c c (#xx:3 of rd8) c c (#xx:3 of @erd) c c (#xx:3 of @aa:8) c c (#xx:3 of @aa:16) c c (#xx:3 of @aa:32) c c [~(#xx:3 of rd8)] c c [~(#xx:3 of @erd)] c c [~(#xx:3 of @aa:8)] c c [~(#xx:3 of @aa:16)] c c [~(#xx:3 of @aa:32)] c c (#xx:3 of rd8) c c (#xx:3 of @erd) c c (#xx:3 of @aa:8) c c (#xx:3 of @aa:16) c c (#xx:3 of @aa:32) c c [~(#xx:3 of rd8)] c c [~(#xx:3 of @erd)] c c [~(#xx:3 of @aa:8)] c c [~(#xx:3 of @aa:16)] c c [~(#xx:3 of @aa:32)] c operation i hn zvc advanced mode 2 2 2 2 2 4 4 4 4 4 4 6 8 4 6 8 4 6 8 4 6 8 4 6 8 1 3 3 4 5 1 3 3 4 5 1 3 3 4 5 1 3 3 4 5 1 3 3 4 5 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? condition code addressing mode and instruction length (bytes) no of execution states * 1 appendix a instruction set rev.3.00 jan. 10, 2007 page 855 of 1038 rej09b0328-0300 (6) branch instructions bra d:8(bt d:8) bra d:16(bt d:16) brn d:8(bf d:8) brn d:16(bf d:16) bhi d:8 bhi d:16 bls d:8 bls d:16 bcc d:8(bhs d:8) bcc d:16(bhs d:16) bcs d:8(blo d:8) bcs d:16(blo d:16) bne d:8 bne d:16 beq d:8 beq d:16 bvc d:8 bvc d:16 bvs d:8 bvs d:16 bpl d:8 bpl d:16 bmi d:8 bmi d:16 bge d:8 bge d:16 blt d:8 blt d:16 bcc mnemonic size #xx rn @ern @(d,ern) @-ern/@ern+ @aa @(d,pc) @@aa ? operation i branch condition hn zvc advanced mode 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 always never c z=0 c z=1 c=0 c=1 z=0 z=1 v=0 v=1 n=0 n=1 n v=0 n v=1 if condition is true then pc pc+d else next; 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? operation code bgt d:8 bgt d:16 ble d:8 ble d:16 jmp @ern jmp @aa:24 jmp @@aa:8 bsr d:8 bsr d:16 jsr @ern jsr @aa:24 jsr @@aa:8 rts jmp bsr jsr rts pc ern pc aa:24 pc @aa:8 pc @-sp,pc pc+d:8 pc @-sp,pc pc+d:16 pc @-sp,pc ern pc @-sp,pc aa:24 pc @-sp,pc @aa:8 pc @sp+ 2 2 4 4 2 4 2 4 2 4 2 2 2 2 3 2 3 2 3 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? z (n v)=0 z (n v)=1 5 4 5 4 5 6 5 addressing mode and instruction length (bytes) no of execution states * 1 appendix a instruction set rev.3.00 jan. 10, 2007 page 856 of 1038 rej09b0328-0300 (7) system cont rol instructions trapa #xx:2 rte sleep ldc #xx:8,ccr ldc #xx:8,exr ldc rs,ccr ldc rs,exr ldc @ers,ccr ldc @ers,exr ldc @(d:16,ers),ccr ldc @(d:16,ers),exr ldc @(d:32,ers),ccr ldc @(d:32,ers),exr ldc @ers+,ccr ldc @ers+,exr ldc @aa:16,ccr ldc @aa:16,exr ldc @aa:32,ccr ldc @aa:32,exr stc ccr,rd stc exr,rd stc ccr,@erd stc exr,@erd stc ccr,@(d:16,erd) stc exr,@(d:16,erd) stc ccr,@(d:32,erd) stc exr,@(d:32,erd) stc ccr,@-erd stc exr,@-erd stc ccr,@aa:16 stc exr,@aa:16 stc ccr,@aa:32 stc exr,@aa:32 andc #xx:8,ccr andc #xx:8,exr orc #xx:8,ccr orc #xx:8,exr xorc #xx:8,ccr xorc #xx:8,exr nop ? ? ? b b b b w w w w w w w w w w w w b b w w w w w w w w w w w w b b b b b b ? trapa rte sleep ldc stc andc orc xorc nop mnemonic size #xx rn @ern @(d,ern) @-ern/@ern+ @aa @(d,pc) @@aa ? pc @-sp,ccr @-sp, exr @-sp, appendix a instruction set rev.3.00 jan. 10, 2007 page 857 of 1038 rej09b0328-0300 (8) block transfer instructions eepmov.b eepmov.w ? ? eepmov mnemonic size #xx rn @ern @(d,ern) @-ern/@ern+ @aa @(d,pc) @@aa ? operation i hn zvc advanced mode 4 4 4+2n * 3 4+2n * 3 ? ? ? ? ? ? ? ? ? ? ? ? condition code if r4l 0 repeat @er5 @er6 er5+1 er5 er6+1 er6 r4l-1 r4l until r4l=0 else next; if r4 0 repeat @er5 @er6 er5+1 er5 er6+1 er6 r4-1 r4 until r4=0 else next; addressing mode and instruction length (bytes) no of execution states * 1 notes: 1. the values indicated in the column of number of execution states apply when instruction code and operand exist in the on-chip memory. 2. only register er0, er1, er4, or er5 should be used when using the tas instruction. 3. n is the initial setting value of r4l or r4. [1] 7 states when the number of return/retract registers is 2, 9 states when the number of registers is 3, and 11 states when the number of registers is 4. [2] cannot be used in this lsi. [3] set to 1 when a carry or borrow occurs at bit 11, otherwise cleared to 0. [4] set to 1 when a carry or borrow occurs at bit 27, otherwise cleared to 0. [5] retains the value before computation when the computation result is 0, otherwise cleared to 0. [6] set to 1 when the divisor is negative, otherwise cleared to 0. [7] set to 1 when the divisor is 0, otherwise cleared to 0. [8] set to 1 when the quotient is negative, otherwise cleared to 0. [9] 1 is added to the number of execution states when exr is valid. appendix a instruction set rev.3.00 jan. 10, 2007 page 858 of 1038 rej09b0328-0300 a.2 instruction codes add adds addx and andc band bcc add.b #xx:8,rd add.b rs,rd add.w #xx:16,rd add.w rs,rd add.l #xx:32,erd add.l ers,erd adds #1,erd adds #2,erd adds #4,erd addx #xx:8,rd addx rs,rd and.b #xx:8,rd and.b rs,rd and.w #xx:16,rd and.w rs,rd and.l #xx:32,erd and.l ers,erd andc #xx:8,ccr andc #xx:8,exr band #xx:3,rd band #xx:3,@erd band #xx:3,@aa:8 band #xx:3,@aa:16 band #xx:3,@aa:32 bra d:8 (bt d:8) bra d:16 (bt d:16) brn d:8 (bf d:8) brn d:16 (bf d:16) bhi d:8 bhi d:16 bls d:8 bls d:16 bcc d:8 (bhs d:8) bcc d:16 (bhs d:16) bcs d:8 (blo d:8) bcs d:16 (blo d:16) bne d:8 bne d:16 beq d:8 beq d:16 bvc d:8 bvc d:16 bvs d:8 bvs d:16 mnemonic instruction format 1st byte b b w w l l l l l b b b b w w l l b b b b b b b ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 8 0 7 0 7 0 0 0 0 9 0 e 1 7 6 7 0 0 0 7 7 7 6 6 4 5 4 5 4 5 4 5 4 5 4 5 4 5 4 5 4 5 4 5 rd 8 9 9 a a b b b rd e rd 6 9 6 a 1 6 1 6 c e a a 0 8 1 8 2 8 3 8 4 8 5 8 6 8 7 8 8 8 9 8 rs 1 rs 1 1 ers 0 8 9 rs rs 6 rs 6 f 4 0 imm 0 erd 1 3 0 1 2 3 4 5 6 7 8 9 imm imm imm imm abs disp disp disp disp disp disp disp disp disp disp rd rd rd 0 erd 0 erd 0 erd 0 erd 0 erd rd rd rd rd 0 erd 0 1 rd 0 0 0 0 0 0 0 0 0 0 0 0 0 0 imm 0 imm 0 0 6 0 7 7 imm imm abs disp disp disp disp disp disp disp disp disp disp imm imm abs 6 6 6 6 0 imm 0 7 6 0 imm 0 7 6 2nd byte 3rd byte 4th byte 5th byte 6th byte 7the byte 8th byte 9th byte 10th byte size instruction 0 ers 0 erd imm appendix a instruction set rev.3.00 jan. 10, 2007 page 859 of 1038 rej09b0328-0300 bcc (cont.) bclr biand bild bior bist bpl d:8 bpl d:16 bmi d:8 bmi d:16 bge d:8 bge d:16 blt d:8 blt d:16 bgt d:8 bgt d:16 ble d:8 ble d:16 bclr #xx:3,rd bclr #xx:3,@erd bclr #xx:3,@aa:8 bclr #xx:3,@aa:16 bclr #xx:3,@aa:32 bclr rn,rd bclr rn,@erd bclr rn,@aa:8 bclr rn,@aa:16 bclr rn,@aa:32 biand #xx:3,rd biand #xx:3,@erd biand #xx:3,@aa:8 biand #xx:3,@aa:16 biand #xx:3,@aa:32 bild #xx:3,rd bild #xx:3,@erd bild #xx:3,@aa:8 bild #xx:3,@aa:16 bild #xx:3,@aa:32 bior #xx:3,rd bior #xx:3,@erd bior #xx:3,@aa:8 bior #xx:3,@aa:16 bior #xx:3,@aa:32 bist #xx:3,rd bist #xx:3,@erd bist #xx:3,@aa:8 bist #xx:3,@aa:16 bist #xx:3,@aa:32 mnemonic instruction format 1st byte ? ? ? ? ? ? ? ? ? ? ? ? b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b 4 5 4 5 4 5 4 5 4 5 4 5 7 7 7 6 6 6 7 7 6 6 7 7 7 6 6 7 7 7 6 6 7 7 7 6 6 6 7 7 6 6 a 8 b 8 c 8 d 8 e 8 f 8 2 d f a a 2 d f a a 6 c e a a 7 c e a a 4 c e a a 7 d f a a a b c d e f 0 imm 0 erd 1 3 rn 0 erd 1 3 1 imm 0 erd 1 3 1 imm 0 erd 1 3 1 imm 0 erd 1 3 1 imm 0 erd 1 3 disp disp disp disp disp disp abs abs abs abs abs abs 0 0 0 0 0 0 rd 0 8 8 rd 0 8 8 rd 0 0 0 rd 0 0 0 rd 0 0 0 rd 0 8 8 7 7 6 6 7 7 7 7 7 7 6 6 disp disp disp disp disp disp 2 2 abs 2 2 abs 6 6 abs 7 7 abs 4 4 abs 7 7 abs 0 imm 0 imm rn rn 1 imm 1 imm 1 imm 1 imm 1 imm 1 imm 1 imm 1 imm 0 0 abs 0 0 abs 0 0 abs 0 0 abs 0 0 abs 0 0 abs 7 6 7 7 7 6 2 2 6 7 4 7 0 imm rn 1 imm 1 imm 1 imm 1 imm 0 0 0 0 0 0 7 6 7 7 7 6 2 2 6 7 4 7 0 imm rn 1 imm 1 imm 1 imm 1 imm 0 0 0 0 0 0 2nd byte 3rd byte 4th byte 5th byte 6th byte 7th byte 8th byte 9th byte 10th byte size instruction appendix a instruction set rev.3.00 jan. 10, 2007 page 860 of 1038 rej09b0328-0300 bixor bld bnot bor bset bsr bst bixor #xx:3,rd bixor #xx:3,@erd bixor #xx:3,@aa:8 bixor #xx:3,@aa:16 bixor #xx:3,@aa:32 bld #xx:3,rd bld #xx:3,@erd bld #xx:3,@aa:8 bld #xx:3,@aa:16 bld #xx:3,@aa:32 bnot #xx:3,rd bnot #xx:3,@erd bnot #xx:3,@aa:8 bnot #xx:3,@aa:16 bnot #xx:3,@aa:32 bnot rn,rd bnot rn,@erd bnot rn,@aa:8 bnot rn,@aa:16 bnot rn,@aa:32 bor #xx:3,rd bor #xx:3,@erd bor #xx:3,@aa:8 bor #xx:3,@aa:16 bor #xx:3,@aa:32 bset #xx:3,rd bset #xx:3,@erd bset #xx:3,@aa:8 bset #xx:3,@aa:16 bset #xx:3,@aa:32 bset rn,rd bset rn,@erd bset rn,@aa:8 bset rn,@aa:16 bset rn,@aa:32 bsr d:8 bsr d:16 bst #xx:3,rd bst #xx:3,@erd bst #xx:3,@aa:8 bst #xx:3,@aa:16 bst #xx:3,@aa:32 mnemonic instruction format 1st byte b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b ? ? b b b b b 7 7 7 6 6 7 7 7 6 6 7 7 7 6 6 6 7 7 6 6 7 7 7 6 6 7 7 7 6 6 6 7 7 6 6 5 5 6 7 7 6 6 5 c e a a 7 c e a a 1 d f a a 1 d f a a 4 c e a a 0 d f a a 0 d f a a 5 c 7 d f a a 1 imm 0 erd abs 1 3 0 imm 0 erd abs 1 3 0 imm 0 erd abs 1 3 rn 0 erd abs 1 3 0 imm 0 erd abs 1 3 0 imm 0 erd abs 1 3 rn 0 erd abs 1 3 disp 0 0 imm 0 erd abs 1 3 rd 0 0 0 rd 0 0 0 rd 0 8 8 rd 0 8 8 rd 0 0 0 rd 0 8 8 rd 0 8 8 0 rd 0 8 8 7 7 7 7 7 7 6 6 7 7 7 7 6 6 6 6 5 5 abs 7 7 abs 1 1 abs 1 1 abs 4 4 abs 0 0 abs 0 0 abs disp 7 7 abs 1 imm 1 imm 0 imm 0 imm 0 imm 0 imm rn rn 0 imm 0 imm 0 imm 0 imm rn rn 0 imm 0 imm 0 0 abs 0 0 abs 0 0 abs 0 0 abs 0 0 abs 0 0 abs 0 0 abs 0 0 abs 7 7 7 6 7 7 6 6 5 7 1 1 4 0 0 7 1 imm 0 imm 0 imm rn 0 imm 0 imm rn 0 imm 0 0 0 0 0 0 0 0 7 7 7 6 7 7 6 6 5 7 1 1 4 0 0 7 1 imm 0 imm 0 imm rn 0 imm 0 imm rn 0 imm 0 0 0 0 0 0 0 0 2nd byte 3rd byte 4th byte 5th byte 6th byte 7th byte 8th byte 9th byte 10th byte size instruction appendix a instruction set rev.3.00 jan. 10, 2007 page 861 of 1038 rej09b0328-0300 btst bxor clrmac cmp daa das dec divxs divxu eepmov exts extu btst #xx:3,rd btst #xx:3,@erd btst #xx:3,@aa:8 btst #xx:3,@aa:16 btst #xx:3,@aa:32 btst rn,rd btst rn,@erd btst rn,@aa:8 btst rn,@aa:16 btst rn,@aa:32 bxor #xx:3,rd bxor #xx:3,@erd bxor #xx:3,@aa:8 bxor #xx:3,@aa:16 bxor #xx:3,@aa:32 clrmac cmp.b #xx:8,rd cmp.b rs,rd cmp.w #xx:16,rd cmp.w rs,rd cmp.l #xx:32,erd cmp.l ers,erd daa rd das rd dec.b rd dec.w #1,rd dec.w #2,rd dec.l #1,erd dec.l #2,erd divxs.b rs,rd divxs.w rs,erd divxu.b rs,rd divxu.w rs,erd eepmov.b eepmov.w exts.w rd exts.l erd extu.w rd extu.l erd mnemonic instruction format 1st byte cannot be used in this lsi b b b b b b b b b b b b b b b ? b b w w l l b b b w w l l b w b w ? ? w l w l 7 7 7 6 6 6 7 7 6 6 7 7 7 6 6 a 1 7 1 7 1 0 1 1 1 1 1 1 0 0 5 5 7 7 1 1 1 1 3 c e a a 3 c e a a 5 c e a a rd c 9 d a f f f a b b b b 1 1 1 3 b b 7 7 7 7 0 imm 0 erd abs 1 3 rn 0 erd abs 1 3 0 imm 0 erd abs 1 3 imm rs 2 rs 2 1 ers 0 0 0 5 d 7 f d d rs rs 5 d d f 5 7 rd 0 0 0 rd 0 0 0 rd 0 0 0 rd rd rd 0 erd 0 erd rd rd rd rd rd 0 erd 0 erd 0 0 rd 0 erd c 4 rd 0 erd rd 0 erd 7 7 6 6 7 7 5 5 5 5 3 3 abs 3 3 abs 5 5 abs imm 1 3 9 9 0 imm 0 imm rn rn 0 imm 0 imm rs rs 8 8 0 0 abs 0 0 abs 0 0 abs imm rd 0 erd f f 7 6 7 3 3 5 0 imm rn 0 imm 0 0 0 7 6 7 3 3 5 0 imm rn 0 imm 0 0 0 2nd byte 3rd byte 4th byte 5th byte 6th byte 7th byte 8th byte 9th byte 10th byte size instruction appendix a instruction set rev.3.00 jan. 10, 2007 page 862 of 1038 rej09b0328-0300 inc jmp jsr ldc ldm ldmac mac mov inc.b rd inc.w #1,rd inc.w #2,rd inc.l #1,erd inc.l #2,erd jmp @ern jmp @aa:24 jmp @@aa:8 jsr @ern jsr @aa:24 jsr @@aa:8 ldc #xx:8,ccr ldc #xx:8,exr ldc rs,ccr ldc rs,exr ldc @ers,ccr ldc @ers,exr ldc @(d:16,ers),ccr ldc @(d:16,ers),exr ldc @(d:32,ers),ccr ldc @(d:32,ers),exr ldc @ers+,ccr ldc @ers+,exr ldc @aa:16,ccr ldc @aa:16,exr ldc @aa:32,ccr ldc @aa:32,exr ldm.l @sp+, (ern-ern+1) ldm.l @sp+, (ern-ern+2) ldm.l @sp+, (ern-ern+3) ldmac ers,mach ldmac ers,macl mac @ern+,@erm+ mov.b #xx:8,rd mov.b rs,rd mov.b @ers,rd mov.b @(d:16,ers),rd mov.b @(d:32,ers),rd mov.b @ers+,rd mov.b @aa:8,rd mov.b @aa:16,rd mov.b @aa:32,rd mov.b rs,@erd mov.b rs,@(d:16,erd) mov.b rs,@(d:32,erd) mnemonic instruction format cannot be used in this lsi 1st byte b w w l l ? ? ? ? ? ? b b b b w w w w w w w w w w w w l l l l l ? b b b b b b b b b b b b 0 0 0 0 0 5 5 5 5 5 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 f 0 6 6 7 6 2 6 6 6 6 7 a b b b b 9 a b d e f 7 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 rd c 8 e 8 c rd a a 8 e 8 0 5 d 7 f 0 ern abs 0 ern abs imm 4 0 1 4 4 4 4 4 4 4 4 4 4 4 4 1 2 3 imm rs 0 ers 0 ers 0 ers 0 ers abs 0 2 1 erd 1 erd 0 erd rd rd rd 0 erd 0 erd 0 0 1 rs rs 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 rd rd rd 0 rd rd rd rs rs 0 abs abs 0 6 6 6 6 7 7 6 6 6 6 6 6 6 6 6 6 6 7 9 9 f f 8 8 d d b b b b d d d disp a abs disp a imm 0 ers 0 ers 0 ers 0 ers 0 ers 0 ers 0 ers 0 ers 0 0 2 2 7 7 7 2 a 0 0 0 0 0 0 0 0 0 0 0 0 0 ern+1 0 ern+2 0 ern+3 rd abs rs 6 6 disp disp b b abs abs 2 2 0 0 abs abs disp disp disp disp 2nd byte 3rd byte 4th byte 5th byte 6th byte 7th byte 8th byte 9th byte 10 byte size instruction appendix a instruction set rev.3.00 jan. 10, 2007 page 863 of 1038 rej09b0328-0300 mov (cont.) movfpe movtpe mulxs mulxu neg nop mov.b rs,@-erd mov.b rs,@aa:8 mov.b rs,@aa :16 mov.b rs,@aa:32 mov.w #xx:16,rd mov.w rs,rd mov.w @ers,rd mov.w @(d:16,ers),rd mov.w @(d:32,ers),rd mov.w @ers+,rd mov.w @aa:16,rd mov.w @aa:32,rd mov.w rs,@erd mov.w rs,@(d:16,erd) mov.w rs,@(d:32,erd) mov.w rs,@-erd mov.w rs,@aa:16 mov.w rs,@aa:32 mov.l #xx:32,rd mov.l ers,erd mov.l @ers,erd mov.l @(d:16,ers),erd mov.l @(d:32,ers),erd mov.l @ers+,erd mov.l @aa:16 ,erd mov.l @aa:32 ,erd mov.l ers,@erd mov.l ers,@(d:16,erd) mov.l ers,@(d:32,erd) * 1 mov.l ers,@-erd mov.l ers,@aa:16 mov.l ers,@aa:32 movfpe @aa:16,rd movtpe rs,@aa:16 mulxs.b rs,rd mulxs.w rs,erd mulxu.b rs,rd mulxu.w rs,erd neg.b rd neg.w rd neg.l erd nop mnemonic instruction format 1st byte cannot be used in this lsi b b b b w w w w w w w w w w w w w w w l l l l l l l l l l l l l b b b w b w b w l ? 6 3 6 6 7 0 6 6 7 6 6 6 6 6 7 6 6 6 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 5 1 1 1 0 c rs a a 9 d 9 f 8 d b b 9 f 8 d b b a f 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 2 7 7 7 0 1 erd abs 8 a 0 rs 0 ers 0 ers 0 ers 0 ers 0 2 1 erd 1 erd 0 erd 1 erd 8 a 0 1 ers 0 0 0 0 0 0 0 0 0 0 0 0 c c rs rs 8 9 b 0 rs rs rs rd rd rd rd 0 rd rd rd rs rs 0 rs rs rs 0 erd 0 erd 0 0 0 0 0 0 0 0 0 0 0 0 0 0 rd 0 erd rd rd 0 erd 0 6 6 6 6 7 6 6 6 6 6 7 6 6 6 5 5 abs imm disp b abs disp b abs 9 f 8 d b b 9 f 8 d b b 0 2 2 a 0 ers 0 ers 0 ers 0 ers 0 2 1 erd 1 erd 0 erd 1 erd 8 a rs rs abs rd abs rs abs imm 0 erd 0 erd 0 0 erd 0 erd 0 erd 0 ers 0 ers 0 0 ers 0 ers 0 ers rd 0 erd 6 6 disp b abs disp b abs 2 a disp disp 0 erd abs 0 ers abs disp disp 2nd byte 3rd byte 4th byte 5th byte 6th byte 7th byte 8th byte 9th byte 10th byte size instruction appendix a instruction set rev.3.00 jan. 10, 2007 page 864 of 1038 rej09b0328-0300 not or orc pop push rotl rotr rotxl rotxr rte rts not.b rd not.w rd not.l erd or.b #xx:8,rd or.b rs,rd or.w #xx:16,rd or.w rs,rd or.l #xx:32,erd or.l ers,erd orc #xx:8,ccr orc #xx:8,exr pop.w rn pop.l ern push.w rn push.l ern rotl.b rd rotl.b #2, rd rotl.w rd rotl.w #2, rd rotl.l erd rotl.l #2, erd rotr.b rd rotr.b #2, rd rotr.w rd rotr.w #2, rd rotr.l erd rotr.l #2, erd rotxl.b rd rotxl.b #2, rd rotxl.w rd rotxl.w #2, rd rotxl.l erd rotxl.l #2, erd rotxr.b rd rotxr.b #2, rd rotxr.w rd rotxr.w #2, rd rotxr.l erd rotxr.l #2, erd rte rts mnemonic instruction format 1st byte b w l b b w w l l b b w l w l b b w w l l b b w w l l b b w w l l b b w w l l ? ? 1 1 1 c 1 7 6 7 0 0 0 6 0 6 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 5 5 7 7 7 rd 4 9 4 a 1 4 1 d 1 d 1 2 2 2 2 2 2 3 3 3 3 3 3 2 2 2 2 2 2 3 3 3 3 3 3 6 4 0 1 3 imm rs 4 rs 4 f imm 4 7 0 f 0 8 c 9 d b f 8 c 9 d b f 0 4 1 5 3 7 0 4 1 5 3 7 7 7 rd rd 0 erd rd rd rd 0 erd 0 1 rn 0 rn 0 rd rd rd rd 0 erd 0 erd rd rd rd rd 0 erd 0 erd rd rd rd rd 0 erd 0 erd rd rd rd rd 0 erd 0 erd 0 0 6 0 6 6 imm 4 4 d d 0 ers imm 7 f imm 0 erd 0 ern 0 ern 2nd byte 3rd byte 4th byte 5th byte 6th byte 7th byte 8th byte 9th byte 10th byte size instruction appendix a instruction set rev.3.00 jan. 10, 2007 page 865 of 1038 rej09b0328-0300 shal shar shll shlr sleep stc stm stmac shal.b rd shal.b #2, rd shal.w rd shal.w #2, rd shal.l erd shal.l #2, erd shar.b rd shar.b #2, rd shar.w rd shar.w #2, rd shar.l erd shar.l #2, erd shll.b rd shll.b #2, rd shll.w rd shll.w #2, rd shll.l erd shll.l #2, erd shlr.b rd shlr.b #2, rd shlr.w rd shlr.w #2, rd shlr.l erd shlr.l #2, erd sleep stc.b ccr,rd stc.b exr,rd stc.w ccr,@erd stc.w exr,@erd stc.w ccr,@(d:16,erd) stc.w exr,@(d:16,erd) stc.w ccr,@(d:32,erd) stc.w exr,@(d:32,erd) stc.w ccr,@-erd stc.w exr,@-erd stc.w ccr,@aa:16 stc.w exr,@aa:16 stc.w ccr,@aa:32 stc.w exr,@aa:32 stm.l(ern-ern+1) , @-sp stm.l (ern-ern+2) , @-sp stm.l (ern-ern+3) , @-sp stmac mach,erd stmac macl,erd mnemonic instruction format 1st byte b b w w l l b b w w l l b b w w l l b b w w l l ? b b w w w w w w w w w w w w l l l l l 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1 1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 8 c 9 d b f 8 c 9 d b f 0 4 1 5 3 7 0 4 1 5 3 7 8 0 1 4 4 4 4 4 4 4 4 4 4 4 4 1 2 3 rd rd rd rd 0 erd 0 erd rd rd rd rd 0 erd 0 erd rd rd rd rd 0 erd 0 erd rd rd rd rd 0 erd 0 erd 0 rd rd 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 6 6 6 6 7 7 6 6 6 6 6 6 6 6 6 9 9 f f 8 8 d d b b b b d d d 1 erd 1 erd 1 erd 1 erd 0 erd 0 erd 1 erd 1 erd 8 8 a a f f f 0 0 0 0 0 0 0 0 0 0 0 0 0 ern 0 ern 0 ern 6 6 disp disp b b abs abs a a 0 0 abs abs disp disp 2nd byte 3rd byte 4th byte 5th byte 6th byte 7th byte 8th byte 9th byte 10th byte size instruction cannot be used in this lsi appendix a instruction set rev.3.00 jan. 10, 2007 page 866 of 1038 rej09b0328-0300 sub subs subx tas * 2 trapa xor xorc sub.b rs,rd sub.w #xx:16,rd sub.w rs,rd sub.l #xx:32,erd sub.l ers,erd subs #1,erd subs #2,erd subs #4,erd subx #xx:8,rd subx rs,rd tas @erd trapa #x:2 xor.b #xx:8,rd xor.b rs,rd xor.w #xx:16,rd xor.w rs,rd xor.l #xx:32,erd xor.l ers,erd xorc #xx:8,ccr xorc #xx:8,exr mnemonic instruction format 1st byte b w w l l l l l b b b ? b b w w l l b b 1 7 1 7 1 1 1 1 b 1 0 5 d 1 7 6 7 0 0 0 8 9 9 a a b b b rd e 1 7 rd 5 9 5 a 1 5 1 rs 3 rs 3 1 ers 0 8 9 imm rs e imm imm rs 5 rs 5 f imm 4 rd rd rd 0 erd 0 erd 0 erd 0 erd 0 erd rd 0 0 rd rd rd 0 erd 0 1 7 6 0 imm b imm 5 5 0 erd 0 ers imm imm c imm 0 erd 2nd byte 3rd byte 4th byte 5th byte 6th byte 7th byte 8th byte 9th byte 10th byte size instruction notes: 1. either 1 or 0 can be set to bit 7 in 4th byte of mov.l ers, @(d: 32, erd) instruction. 2. only register er0,er1,er4, or er5 should be used when using the tas instruction. 00 appendix a instruction set rev.3.00 jan. 10, 2007 page 867 of 1038 rej09b0328-0300 legend: imm: immediate data (2, 3, 8, 16, 32 bits) abs: absolute address (8, 16, 24, 32 bits) disp: displacement (8, 16, 32 bits) rs, rd, rn: register fields (8-bit register or 16-bit register is selected in 4 bits. rs, rd and rn correspond to the operand type rs, rd, and rn respectively.) ers, erd, ern, erm: register fields (address register or 32-bit register is selected in 3 bits. ers, erd ern and erm correspond to the operand type ers, erd, ern and rm respectively.) the following table shows the correspondence between the register field and the general register. address register, 32-bit register 16-bit register 8-bit register register field general register register field general register register field general register 000 001 : : : : 111 er0 er1 : : : : er7 0000 0001 : : : : 0111 1000 1001 : : : : 1111 r0 r1 : : : : r7 e0 e1 : : : : e7 0000 0001 : : : : 0111 1000 1001 : : : : 1111 r0h r1h : : : : r7h r0l r1l : : : : r7l appendix a instruction set rev.3.00 jan. 10, 2007 page 868 of 1038 rej09b0328-0300 a.3 operation code map table a.3 shows an operation code map. table a.3 operation code map instruction code: 1st byte 2nd byte ah al bh bl bh highest bit is set to 0 bh highest bit is set to 1 0 nop bra mulxu bset ah al 0 1 2 3 4 5 6 7 8 9 a b c d e f 1 brn divxu bnot 2 bhi mulxu bclr 3 bls divxu btst stc stmac ldc ldmac 4 orc or bcc rts or bor bior 6 andc and bne rte and 5 xorc xor bcs bsr xor bxor bixor band biand 7 ldc beq trapa bst bist bld bild 8 bvc mov 9 bvs a bpl jmp b bmi eepmov c bge bsr d blt mov e addx subx bgt jsr f ble mov.b add addx cmp subx or xor and mov add sub mov mov cmp table a.3(3) ** note: * cannot be used in this lsi. table a.3(2) table a.3(2) table a.3(2) table a.3(2) table a.3(2) table a.3(2) table a.3(2) table a.3(2) table a.3(2) table a.3(2) table a.3(2) table a.3(2) table a.3(2) table a.3(2) table a.3(2) appendix a instruction set rev.3.00 jan. 10, 2007 page 869 of 1038 rej09b0328-0300 instruction code: 1st byte 2nd byte ah al bh bl 01 0a 0b 0f 10 11 12 13 17 1a 1b 1f 58 6a 79 7a 0 mov inc adds daa dec subs das bra mov mov mov shll shlr rotxl rotxr not 1 ldm brn add add 2 bhi mov cmp cmp 3 stm not bls sub sub 4 shll shlr rotxl rotxr bcc movfpe or or 5 inc extu dec bcs xor xor 6 mac bne and and 7 inc shll shlr rotxl rotxr extu dec beq ldc stc 8 sleep bvc mov adds shal shar rotl rotr neg subs 9 bvs a clrmac bpl mov b neg bmi add mov sub cmp c shal shar rotl rotr bge movtpe d inc exts dec blt e tas bgt f inc shal shar rotl rotr exts dec ble bh ah al * * note: * cannot be used in this lsi. * * table a.3(4) table a.3(3) table a.3(3) table a.3(3) table a.3(4) appendix a instruction set rev.3.00 jan. 10, 2007 page 870 of 1038 rej09b0328-0300 instruction code: 1st byte 2nd byte ah al bh bl 3rd byte 4th byte ch cl dh dl r is the register specification section. absolute address is set at aa. dh highest bit is set to 0 dh highest bit is set to 1 notes: ah al bh bl ch cl 01c05 01d05 01f06 7cr06 * 1 7cr07 * 1 7dr06 * 1 7dr07 * 1 7eaa6 * 2 7eaa7 * 2 7faa6 * 2 7faa7 * 2 0 mulxs bset bset bset bset 1 divxs bnot bnot bnot bnot 2 mulxs bclr bclr bclr bclr 3 divxs btst btst btst btst 4 or 5 xor 6 and 789abcdef 1. 2. bor bior bxor bixor band biand bld bild bst bist bor bior bxor bixor band biand bld bild bst bist appendix a instruction set rev.3.00 jan. 10, 2007 page 871 of 1038 rej09b0328-0300 instruction code: 1st byte 2nd byte ah al bh bl 3th byte 4th byte ch cl dh dl fh highest bit is set to 0 fh highest bit is set to 1 5th byte 6th byte eh el fh fl instruction code: 1st byte 2nd byte ah al bh bl 3rd byte 4th byte ch cl dh dl hh highest bit is set to 0 hh highest bit is set to 1 note: * absolute address is set at aa. 5th byte 6th byte eh el fh fl 7th byte 8th byte gh gl hh hl 6a10aaaa6 * 6a10aaaa7 * 6a18aaaa6 * 6a18aaaa7 * ahalbhblchcldhdleh el 0 bset 1 bnot 2 bclr 3 btst bor bior bxor bixor band biand bld bild bst bist 456789abcdef 6a30aaaaaaaa6 * 6a30aaaaaaaa7 * 6a38aaaaaaaa6 * 6a38aaaaaaaa7 * ahalbhbl ... fhflgh gl 0 bset 1 bnot 2 bclr 3 btst bor bior bxor bixor band biand bld bild bst bist 456789abcdef appendix a instruction set rev.3.00 jan. 10, 2007 page 872 of 1038 rej09b0328-0300 a.4 number of ex ecution states this section explains execution st ate and how to calculate the number of execution states for each instruction of the h8s/2000 cpu. table a.5 indicates number of cycles of instruction fetch and data read/write during instruction execution, and table a.4 indica tes number of states require d for each instruction size. the number of execution states can be obtained from the equation below. number of execution states = i ? s i + j ? s j + k ? s k + l ? s l + m ? s m + n ? s n examples of execution state number calculation the conditions are as follows: in advanced mode, program and stack areas are set in the on-chip memory, a wait is inserted every 2 states in the on-chip supporting module access with 8-bit bus width. 1. bset #0, @ffffc7:8 from table a.5, i = l = 2, j = k = m = n = 0 from table a.4, s i = 1, s l = 2 number of execution states = 2 1 + 2 2 = 6 2. jsr @@30 from table a.5, i = j = k = 2, l = m = n = 0 from table a.4, s i = s j = s k = 1 number of execution states = 2 1 + 2 1 + 2 1 = 6 appendix a instruction set rev.3.00 jan. 10, 2007 page 873 of 1038 rej09b0328-0300 table a.4 number of states required for each execution status (cycle) target of access on-chip supporting module execution status (cycle) on-chip memory 8-bit bus 16-bit bus instruction fetch s i branch address read s j stack operation s k ? ? byte data access s l 2 2 word data access s m 1 4 2 internal operation s n 1 1 1 appendix a instruction set rev.3.00 jan. 10, 2007 page 874 of 1038 rej09b0328-0300 table a.5 instruction execution status (no. of cycles) instruction fetch branch address read stack operation byte data access word data access internal operation instruction mnemonic i j k l m n add add.b #xx:8,rd add.b rs, rd add.w #xx:16,rd add.w rs,rd add l #xx:32,erd add.l ers,erd 1 1 2 1 3 1 adds adds #1/2/4,erd 1 addx addx #xx:8,rd addx rs,rd 1 1 and and.b #xx:8,rd and.b rs,rd and.w #xx.16,rd and.w rs,rd and l #xx:32,erd and.l ers,erd 1 1 2 1 3 2 andc andc #xx:8,ccr andc #xx:8,exr 1 2 band band #xx:3,rd band #xx:3,@erd band #xx:3@aa:8 band #xx:3@aa:16 band #xx:3@aa:32 1 2 2 3 4 1 1 1 1 bcc bra d:8 (bt d:8) brn d:8 (bf d:8) bhi d:8 bls d:8 bcc d:8 (bhs d:8) bcs d:8 (blo d:8) bne d:8 beq d:8 bvc d:8 bvs d:8 bpl d:8 bmi d:8 bge d:8 blt d:8 bgt d:8 ble d:8 bra d:16 (bt d:16) brn d:16 (bf d:16) bhi d:16 bls d:16 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 appendix a instruction set rev.3.00 jan. 10, 2007 page 875 of 1038 rej09b0328-0300 instruction fetch branch address read stack operation byte data access word data access internal operation instruction mnemonic i j k l m n bcc bcc d:16 (bhs d:16) bcs d:16 (blo d:16) bne d:16 beq d:16 bvc d:16 bvs d:16 bpl d:16 bmi d:16 bge d:16 blt d:16 bgt d:16 ble d:16 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 bclr bclr #xx:3,rd bclr #xx:3,@erd bclr #xx:3,@aa:8 bclr #xx:3,@aa:16 bclr #xx:3,@aa:32 bclr rn,rd bclr rn,@erd bclr rn,@aa:8 bclr rn,@aa:16 bclr rn,@aa:32 1 2 2 3 4 1 2 2 3 4 2 2 2 2 2 2 2 2 biand biand #xx:3,rd biand #xx:3,@erd biand #xx:3,@aa:8 biand #xx:3,@aa:16 biand #xx:3,@aa:32 1 2 2 3 4 1 1 1 1 bild bild #xx:3,rd bild #xx:3,@erd bild #xx:3,@aa:8 bild #xx:3,@aa:16 bild #xx:3,@aa:32 1 2 2 3 4 1 1 1 1 bior bior #xx:8,rd bior #xx:8,@erd bior #xx:8,@aa:8 bior #xx:8,@aa:16 bior #xx:8,@aa:32 1 2 2 3 4 1 1 1 1 bist bist #xx:3,rd bist #xx:3,@erd bist #xx:3,@aa:8 bist #xx:3,@aa:16 bist #xx:3,@aa:32 1 2 2 3 4 2 2 2 2 appendix a instruction set rev.3.00 jan. 10, 2007 page 876 of 1038 rej09b0328-0300 instruction fetch branch address read stack operation byte data access word data access internal operation instruction mnemonic i j k l m n bixor bixor #xx:3,rd bixor #xx:3,@erd bixor #xx:3,@aa:8 bixor #xx:3,@aa:16 bixor #xx:3,@aa:32 1 2 2 3 4 1 1 1 1 bld bld #xx:3,rd bld #xx:3,@erd bld #xx:3,@aa:8 bld #xx:3,@aa:16 bld #xx:3,@aa:32 1 2 2 3 4 1 1 1 1 bnot bnot #xx:3,rd bnot #xx:3,@erd bnot #xx:3,@aa:8 bnot #xx:3,@aa:16 bnot #xx:3,@aa:32 bnot rn,rd bnot rn,@erd bnot rn,@aa:8 bnot rn,@aa:16 1 2 2 3 4 1 2 2 3 2 2 2 2 2 2 2 bnot bnot rn,@aa:32 4 2 bor bor #xx:3,rd bor #xx:3,@erd bor #xx:3,@aa:8 bor #xx:3,@aa:16 bor #xx:3,@aa:32 1 2 2 3 4 1 1 1 1 bset bset #xx:3,rd bset #xx:3,@erd bset #xx:3,@aa:8 bset #xx:3,@aa:16 bset #xx:3,@aa:32 bset rn,rd bset rn,@erd bset rn,@aa:8 bset rn,@aa:16 bset rn,@aa:32 1 2 2 3 4 1 2 2 3 4 2 2 2 2 2 2 2 2 bsr bsr d:8 2 2 bsr d:16 2 2 1 bst bst #xx:3,rd bst #xx:3,@erd bst #xx:3,@aa:8 bst #xx:3,@aa:16 bst #xx:3,@aa:32 1 2 2 3 4 2 2 2 2 appendix a instruction set rev.3.00 jan. 10, 2007 page 877 of 1038 rej09b0328-0300 instruction fetch branch address read stack operation byte data access word data access internal operation instruction mnemonic i j k l m n btst btst #xx:3,rd btst #xx:3,@erd btst #xx:3,@aa:8 btst #xx:3,@aa:16 btst #xx:3,@aa:32 btst rn,rd btst rn,@erd btst rn,@aa:8 btst rn,@aa:16 btst rn,@aa:32 1 2 2 3 4 1 2 2 3 4 1 1 1 1 1 1 1 1 bxor bxor #xx:3,rd bxor #xx:3,@erd bxor #xx:3,@aa:8 bxor #xx:3,@aa:16 bxor #xx:3,@aa:32 1 2 2 3 4 1 1 1 1 clrmac clrmac cannot be used in this lsi. cmp cmp.b #xx:8,rd cmp.b rs,rd cmp.w #xx:16,rd cmp.w rs,rd cmp.l #xx:32,erd cmp.l ers,erd 1 1 2 1 3 1 daa daa rd 1 das das rd 1 dec dec.b rd dec.w #1/2,rd dec.l #1/2 erd 1 1 1 divxs divxs.b rs,rd divxs.w rs,erd 2 2 11 19 divxu divxu.b rs,rd divxu.w rs,erd 1 1 11 19 eepmov eepmov.b eepmov.w 2 2 2n+2 * 2 2n+2 * 2 exts exts.w rd exts.l erd 1 1 extu extu.w rd extu.l erd 1 1 inc inc.b rd inc.w #1/2,rd inc.l #1/2,erd 1 1 1 appendix a instruction set rev.3.00 jan. 10, 2007 page 878 of 1038 rej09b0328-0300 instruction fetch branch address read stack operation byte data access word data access internal operation instruction mnemonic i j k l m n jmp jmp @ern jmp @aa:24 2 2 1 jmp @@aa:8 2 2 1 jsr jsr @ern 2 2 jsr @aa:24 2 2 1 jsr @@aa:8 2 2 2 lcd ldc #xx:8,ccr ldc #xx:8,exr ldc rs,ccr ldc rs,exr ldc @ers,ccr ldc @ers,exr ldc @(d:16,ers),ccr ldc @(d:16,ers),exr ldc @(d:32,ers),ccr ldc @(d:32,ers),exr ldc @ers+,ccr ldc @ers+,exr ldc @aa:16,ccr ldc @aa:16,exr ldc @aa:32,ccr ldc @aa:32,exr 1 2 1 1 2 2 3 3 5 5 2 2 3 3 4 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ldm ldm.l @sp+,(ern ? ern+1) ldm.l @sp+,(ern ? ern+2) ldm.l @sp+,(ern ? ern+3) 2 2 2 4 6 8 1 1 1 ldmac ldmac ers,mach ldmac ers,macl cannot be used in this lsi. mac mac @ern+,@erm+ appendix a instruction set rev.3.00 jan. 10, 2007 page 879 of 1038 rej09b0328-0300 instruction fetch branch address read stack operation byte data access word data access internal operation instruction mnemonic i j k l m n mov mov.b #xx:8,rd mov.b rs,rd mov.b @ers,rd mov.b @(d:16,ers),rd mov.b @(d:32,ers),rd mov.b @ers+,rd mov.b @aa:8,rd mov.b @aa:16,rd mov.b @aa:32,rd mov.b rs,@erd mov.b rs,@(d:16,erd) mov.b rs,@(d:32,erd) mov.b rs,@-erd mov.b rs,@aa:8 mov.b rs,@aa:16 mov.b rs,@aa:32 mov.w #xx:16,rd mov.w rs,rd mov.w @ers,rd mov.w @(d:16,ers),rd mov.w @(d:32,ers),rd mov.w @ers+,rd mov.w @aa:16,rd mov.w @aa:32,rd mov.w rs,@erd mov.w rs,@(d:16,erd) mov.w rs,@(d:32,erd) mov.w rs,@-erd mov.w rs,@aa:16 mov.w rs,@aa:32 mov.l #xx:32,erd mov.l ers,erd mov.l @ers,erd mov.l @(d:16,ers),erd mov.l @(d:32,ers),erd mov.l @ers+,erd mov.l @aa:16,erd mov.l @aa:32,erd mov.l ers,@erd mov.l ers,@(d:16,erd) mov.l ers,@(d:32,erd) mov.l ers,@-erd mov.l ers,@aa:16 mov.l ers,@aa:32 1 1 1 2 4 1 1 2 3 1 2 4 1 1 2 3 2 1 1 2 4 1 2 3 1 2 4 1 2 3 3 1 2 3 5 2 3 4 2 3 5 2 3 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 appendix a instruction set rev.3.00 jan. 10, 2007 page 880 of 1038 rej09b0328-0300 instruction fetch branch address read stack operation byte data access word data access internal operation instruction mnemonic i j k l m n movfpe movfpe @:aa:16,rd movtpe movtpe rs,@:aa:16 cannot be used in this lsi. mulxs mulxs.b rs,rd 2 11 mulxs.w rs,erd 2 19 mulxu mulxu.b rs,rd 1 11 mulxu.w rs,erd 1 19 neg neg.b rd neg.w rd neg.l erd 1 1 1 nop nop 1 not not.b rd not.w rd not.l erd 1 1 1 or or.b #xx:8,rd or.b rs,rd or.w #xx:16,rd or.w rs,rd or.l #xx:32,erd or.l ers,erd 1 1 2 1 3 2 orc orc #xx:8,ccr orc #xx:8,exr 1 2 pop pop.w rn pop.l ern 1 2 1 2 1 1 push push.w rn push.l ern 1 2 1 2 1 1 rotl rotl.b rd rotl.b #2,rd rotl.w rd rotl.w #2,rd rotl.l erd rotl.l #2,erd 1 1 1 1 1 1 rotr rotr.b rd rotr.b #2,rd rotr.w rd rotr.w #2,rd rotr.l erd rotr.l #2,erd 1 1 1 1 1 1 appendix a instruction set rev.3.00 jan. 10, 2007 page 881 of 1038 rej09b0328-0300 instruction fetch branch address read stack operation byte data access word data access internal operation instruction mnemonic i j k l m n rotxl rotxl.b rd rotxl.b #2,rd rotxl.w rd rotxl.w #2,rd rotxl.l erd rotxl.l #2,erd 1 1 1 1 1 1 rotxr rotxr.b rd rptxr.b #2,rd rotxr.w rd rotxr.w #2,rd rotxr.l erd rotxr.l #2,erd 1 1 1 1 1 1 rte rte 2 2/3 * 1 1 rts rts 2 2 1 shal shal.b rd shal.b #2,rd shal.w rd shal.w #2,rd shal.l erd shal.l #2,erd 1 1 1 1 1 1 shar shar.b rd shar.b #2,rd shar.w rd shar.w #2,rd shar.l erd shar.l #2,erd 1 1 1 1 1 1 shll shll.b rd shll.b #2,rd shll.w rd shll.w #2,rd shll.l erd shll.l #2,erd 1 1 1 1 1 1 shlr shlr.b rd shlr.b #2,rd shlr.w rd shlr.w #2,rd shlr.l erd shlr.l #2,erd 1 1 1 1 1 1 sleep sleep 1 1 appendix a instruction set rev.3.00 jan. 10, 2007 page 882 of 1038 rej09b0328-0300 instruction fetch branch address read stack operation byte data access word data access internal operation instruction mnemonic i j k l m n stc stc.b ccr.rd stc.b exr,rd stc.w ccr,@erd stc.w exr,@erd stc.w ccr,@(d:16,erd) stc.w exr,@(d:16,erd) stc.w ccr,@(d:32,erd) stc.w exr,@(d:32,erd) stc.w ccr,@-erd stc.w exr,@-erd stc.w ccr,@aa:16 stc.w exr,@aa:16 stc.w ccr,@aa:32 stc.w exr,@aa:32 1 1 2 2 3 3 5 5 2 2 3 3 4 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 stm stm.l (ern-ern+1), @-sp stm.l (ern-ern+2), @-sp stm.l (ern-ern+3), @-sp 2 2 2 4 6 8 1 1 1 stmac stmac mach,erd stmac macl,erd cannot be used in this lsi. sub sub.b rs,rd sub.w #xx:16,rd sub.w rs,rd sub.l #xx:32,erd sub.l ers,erd 1 2 1 3 1 subs subs #1/2/4,erd 1 subx subx #xx:8,rd subx rs,rd 1 1 tas tas @erd * 3 2 2 trapa trapa #x:2 2 2 2/3 * 1 2 xor xor.b #xx:8,rd xor.b rs,rd xor.w #xx:16,rd xor.w rs,rd xor.l #xx:32,erd xor.l ers,erd 1 1 2 1 3 2 xorc xorc #xx:8,ccr xorc #xx:8,exr 1 2 notes: 1. 3 applies when exr is valid, and 2 applies when invalid. 2. applies when the transfer data is n bytes. 3. only register er0, er1, er4, or er5 should be used when using the tas instruction. appendix a instruction set rev.3.00 jan. 10, 2007 page 883 of 1038 rej09b0328-0300 a.5 bus status during instruction execution table a.6 indicates execution status of each instru ction available in this lsi. for the number of states required for each execution status, see ta ble a.4, number of states required for each execution status (cycle). [how to see the table] instruction jmp@aa:24 r:w 2nd internal operation 1 state r:w ea 1 2345678 end of instruction order of execution effective address is read by word. read/write not executed the 2nd word of the instruction currently being executed is read by word. legend: r:b read by byte r:w read by word w:b write by byte w:w write by word :m bus not transferred immediately after this cycle 2nd address of the 2nd word (3rd and 4th bytes) 3rd address of the 3rd word (5th and 6th bytes) 4th address of the 4th word (7th and 8th bytes) 5th address of the 5th word (9th and 10th bytes) next the head address of the instruction immediately after the instruction currently being executed ea execution address vec vector address appendix a instruction set rev.3.00 jan. 10, 2007 page 884 of 1038 rej09b0328-0300 table a.6 instruction execution status instruction 1 2 3 4 5 6 7 8 9 add.b #xx:8,rd r:w next add.b rs,rd r:w next add.w #xx:16,rd r:w 2nd r:w next add.w rs,rd r:w next add.l #xx:32,erd r:w 2nd r:w 3rd r:w next add.l ers,erd r:w next adds #1/2/4,erd r:w next addx #xx:8,rd r:w next addx rs,rd r:w next and.b #xx:8,rd r:w next and.b rs,rd r:w next and.w #xx:16,rd r:w 2nd r:w next and.w rs,rd r:w next and.l #xx:32,erd r:w 2nd r:w 3rd r:w next and.l ers,erd r:w 2nd r:w next andc #xx:8,ccr r:w next andc #xx:8,exr r:w 2nd r:w next band #xx:3,rd r:w next band #xx:3,@erd r:w 2nd r:b ea r:w:m next band #xx:3,@aa:8 r:w 2nd r:b ea r:w:m next band #xx:3,@aa:16 r:w 2nd r:w 3rd r:b ea r:w:m next band #xx:3,@aa:32 r:w 2nd r:w 3rd r:w 4th bra d:8 (bt d:8) r:w next r:w ea brn d:8 (bt d:8) r:w next r:w ea bhi d:8 r:w next r:w ea bls d:8 r:w next r:w ea bcc d:8 (bhs d:8) r:w next r:w ea bcs d:8 (blo d:8) r:w next r:w ea bne d:8 r:w next r:w ea beq d:8 r:w next r:w ea bvc d:8 r:w next r:w ea bvs d:8 r:w next r:w ea bpl d:8 r:w next r:w ea bmi d:8 r:w next r:w ea bge d:8 r:w next r:w ea blt d:8 r:w next r:w ea bgt d:8 r:w next r:w ea ble d:8 r:w next r:w ea bra d:16 (bt d:16) r:w 2nd internal operation 1 state r:w ea appendix a instruction set rev.3.00 jan. 10, 2007 page 885 of 1038 rej09b0328-0300 instruction 1 2 3 4 5 6 7 8 9 brn d:16 (bf d:16) r:w 2nd internal operation 1 state r:w ea bhi d:16 r:w 2nd internal operation 1 state r:w ea bls d:16 r:w 2nd internal operation 1 state r:w ea bcc d:16 (bhs d:16) r:w 2nd internal operation 1 state r:w ea bcs d:16 (blo d:16) r:w 2nd internal operation 1 state r:w ea bne d:16 r:w 2nd internal operation 1 state r:w ea beq d:16 r:w 2nd internal operation 1 state r:w ea bvc d:16 r:w 2nd internal operation 1 state r:w ea bvs d:16 r:w 2nd internal operation 1 state r:w ea bpl d:16 r:w 2nd internal operation 1 state r:w ea bmi d:16 r:w 2nd internal operation 1 state r:w ea bge d:16 r:w 2nd internal operation 1 state r:w ea blt d:16 r:w 2nd internal operation 1 state r:w ea bgt d:16 r:w 2nd internal operation 1 state r:w ea ble d:16 r:w 2nd internal operation 1 state r:w ea bclr #xx:3,rd r:w next bclr #xx:3,@erd r:w 2nd r:b:m ea r:w:m next w:b ea bclr #xx:3,@aa:8 r:w 2nd r:b:m ea r:w:m next w:b ea bclr #xx:3,@aa:16 r:w 2nd r:w 3rd r:b:m ea r:w:m next w:b ea appendix a instruction set rev.3.00 jan. 10, 2007 page 886 of 1038 rej09b0328-0300 instruction 1 2 3 4 5 6 7 8 9 bclr #xx:3,@aa:32 r:w 2nd r:w 3rd r:w 4th r:b:m ea r:w:m next w:b ea bclr rn,rd r:w next bclr rn,@erd r:w 2nd r:b:m ea r:w:m next w:b ea bclr rn,@aa:8 r:w 2nd r:b:m ea r:w:m next w:b ea bclr rn,@aa:16 r:w 2nd r:w 3rd r:b:m ea r:w:m next w:b ea bclr rn,@aa:32 r:w 2nd r:w 3rd r:w 4th r:b:m ea r:w:m next w:b ea biand #xx:3,rd r:w next biand #xx:3,erd r:w 2nd r:b ea r:w:m next biand #xx:3,@aa:8 r:w 2nd r:b ea r:w:m next biand #xx:3,@aa:16 r:w 2nd r:w 3rd r:b ea r:w:m next biand #xx:3,@aa:32 r:w 2nd r:w 3rd r:w 4th r:b ea r:w:m next bild #xx:3,rd r:w next bild #xx:3,@erd r: w 2nd r:b ea r:w:m next bild #xx:3,@aa:8 r:w 2nd r:b ea r:w:m next bild #xx:3,@aa:16 r:w 2nd r:w 3rd r:b ea r:w:m next bild #xx:3,@aa:32 r:w 2nd r:w 3rd r:w 4th r:b ea r:w:m next bior #xx:3,rd r:w next bior #xx:3,@erd r:w 2nd r:b ea r:w:m next boir #xx:3,@aa:8 r:w 2nd r:b ea r:w:m next boir #xx:3,@aa:16 r:w 2nd r:w 3rd r:b ea r:w:m next boir #xx:3,@aa:32 r:w 2nd r:w 3rd r:w 4th r:b ea r:w:m next bist #xx:3,rd r:w next bist #xx:3,@erd r:w 2nd r:b:m ea r:w:m next w:b ea bist #xx:3,@aa:8 r:w 2nd r:b:m ea r:w:m next w:b ea bist #xx:3,@aa:16 r:w 2nd r:w 3rd r:b:m ea r:w:m next w:b ea bist #xx:3,@aa:32 r:w 2nd r:w 3rd r:w 4th r:b:m ea r:w:m next w:b ea appendix a instruction set rev.3.00 jan. 10, 2007 page 887 of 1038 rej09b0328-0300 instruction 1 2 3 4 5 6 7 8 9 bixor #xx:3,rd r:w next bixor #xx:3,@erd r: w 2nd r:b ea r:w:m next bixor #xx:3,@aa:8 r:w 2nd r:b ea r:w:m next bixor #xx:3,@aa:16 r:w 2nd r:w 3rd r:b ea r:w:m next bixor #xx:3,@aa:32 r:w 2nd r:w 3rd r:w 4th r:b ea r:w:m next bld #xx:3,rd r:w next bld #xx:3,@erd r:w 2nd r:b ea r:w:m next bld #xx:3,@aa:8 r:w 2nd r:b ea r:w:m next bld #xx:3,@aa:16 r:w 2nd r:w 3rd r:b ea r:w:m next bld #xx:3,@aa:32 r:w 2nd r:w 3rd r:w 4th r:b ea r:w:m next bnot #xx:3,rd r:w next bnot #xx:3,erd r:w 2nd r:b:m ea r:w:m next w:b ea bnot #xx:3,@aa:8 r:w 2nd r:b:m ea r:w:m next w:b ea bnot #xx:3,@aa:16 r:w 2nd r:w 3rd r:b:m ea r:w:m next w:b ea bnot #xx:3,@aa:32 r:w 2nd r:w 3rd r:w 4th r:b:m ea r:w:m next w:b ea bnot rn,rd r:w next bnot rn,@erd r:w 2nd r:b:m ea r:w:m next w:b ea bnot rn @aa:8 r:w 2nd r:b:m ea r:w:m next w:b ea bnot rn @aa:16 r:w 2nd r:w 3rd r:b:w ea r:w:m next w:b ea bnot rn @aa:32 r:w 2nd r:w 3rd r:w 4th r:b:m ea r:w:m next w:b ea bor #xx:3,rd r:w next bor #xx:3,erd r:w 2nd r:b ea r:w:m next bor #xx:3,@aa:8 r:w 2nd r:b ea r:w:m next bor #xx:3,@aa:16 r:w 2nd r:w 3rd r:b ea r:w:m next bor #xx:3,@aa:32 r:w 2nd r:w 3rd r:w 4th r:b ea r:w next appendix a instruction set rev.3.00 jan. 10, 2007 page 888 of 1038 rej09b0328-0300 instruction 1 2 3 4 5 6 7 8 9 bset #xx:3,rd r:w next bset #xx:3,@erd r:w 2nd r:b:m ea r:w:m next w:b ea bset #xx:3,@aa:8 r:w 2nd r:b:m ea r:w:m next w:b ea bset #xx:3,@aa:16 r:w 2nd r:w 3rd r:b:m ea r:w:m next w:b ea bset #xx:3,@aa:32 r:w 2nd r:w 3rd r:w 4th r:b:m ea r:w:m next w:b ea bset rn,rd r:w next bset rn,@erd r:w 2nd r:b:m ea r:w:m next w:b ea bset rn,@aa:8 r:w 2nd r:b:m ea r:w:m next w:b ea bset rn,@aa:16 r:w 2nd r:w 3rd r:b:m ea r:w:m next w:b ea bset rn,@aa:32 r:w 2nd r:w 3rd r:w 4th r:b:m ea r:w:m next w:b ea bsr d:8 r:w next r:w ea w:w:m stack(h) w:w stack(l) bsr d:16 r:w 2nd internal operation 1 state r:w ea w:w:m stack(h) w:w stack(l) bst #xx:3,rd r:w next bst #xx:3,@erd r:w 2nd r:b:m ea r:w:m next w:b ea bst #xx:3,@aa:8 r:w 2nd r:b:m ea r:w:m next w:b ea bst #xx:3,@aa:16 r:w 2nd r:w 3rd r:b:m ea r:w:m next w:b ea bst #xx:3,@aa:32 r:w 2nd r:w 3rd r:w 4th r:b:m ea r:w:m next w:b ea btst #xx:3,rd r:w next btst #xx:3,@erd r:w 2nd r:b ea r:w:m next btst #xx:3,@aa:8 r:w 2nd r:b ea r:w:m next btst #xx:3,@aa:16 r:w 2nd r:w 3rd r:b ea r:w:m next btst #xx:3,@aa:32 r:w 2nd r:w 3rd r:w 4th r:b ea r:w:m next btst rn,rd r:w next btst rn,@erd r:w 2nd r:b ea r:w:m next appendix a instruction set rev.3.00 jan. 10, 2007 page 889 of 1038 rej09b0328-0300 instruction 1 2 3 4 5 6 7 8 9 btst rn,@aa:8 r:w 2nd r:b ea r:w:m next btst rn,@aa:16 r:w 2nd r:w 3rd r:b ea r:w:m next btst rn,@aa:32 r:w 2nd r:w 3rd r:w 4th r:b ea r:w:m next boxr #xx:3,rd r:w next boxr #xx:3,@erd r:w 2nd r:b ea r:w:m next boxr #xx:3,@aa:8 r:w 2nd r:b ea r:w:m next boxr #xx:3,@aa:16 r:w 2nd r:w 3rd r:b ea r:w:m next boxr #xx:3,@aa:32 r:w 2nd r:w 3rd r:w 4th r:b ea r:w:m next clrmac cannot be used in this lsi. cmp.b #xx:8,rd r:w next cmp.b rs,rd r:w next cmp.w #xx:16,rd r:w 2nd r:w next cmp.w rs,rd r:w next cmp.l #xx:32,erd r:w 2nd r:w 3rd r:w next cmp.l ers,erd r:w next daa rd r:w next das rd r:w next dec.b rd r:w next dec.w #1/2,rd r:w next dec.w #1/2,erd r:w next divxs.b rs,rd r:w 2nd r:w next internal operation 11 state divxs.w rs,erd r:w 2nd r:w next internal operation 19 state divxu.b rs,rd r:w next internal operation 11 state divxu.w rs,erd r:w next internal operation 19 state eepmov.b r:w 2nd r:b eas * 1 r:b ead * 1 r:b eas * 2 w:b ead * 2 r:w next appendix a instruction set rev.3.00 jan. 10, 2007 page 890 of 1038 rej09b0328-0300 instruction 1 2 3 4 5 6 7 8 9 eepmov.w r:w 2nd r:b eas * 1 r:b ead * 1 r:b eas * 2 w:b ead * 2 r:w next exts.w rd r:w next repeat n times * 2 exts.l erd r:w next extu.w rd r:w next extu.l erd r:w next inc.b rd r:w next inc.w #1/2,rd r:w next inc.l #1/2,erd r:w next jmp @ern r:w next r:w ea jmp @aa:24 r:w 2nd internal operation 1 state r:w ea jmp @@aa:8 r:w next r:w:m aa:8 r:w:m aa:8 internal operation 1 state r:w ea jsr @ern r:w next r:w ea w:w:m stack(h) w:w stack (l) jsr @aa:24 r:w 2nd internal operation 1 state r:w ea w:w:m stack(h) w:w stack (l) jsr @@aa:8 r:w next r:w:m aa:8 r:w aa:8 w:w:m stack(h) w:w stack (l) r:w ea lcd #xx.8,ccr r:w next lcd #xx.8,exr r:w 2nd r:w next lcd rs,ccr r:w next lcd rs,exr r:w next lcd @ers,ccr r:w 2nd r:w next r:w ea lcd @ers,exr r:w 2nd r:w next r:w ea lcd @(d:16,ers),ccr r:w 2nd r:w 3rd r:w next r:w ea lcd @(d:16,ers),exr r:w 2nd r:w 3rd r:w next r:w ea lcd @(d:32,ers),ccr r:w 2nd r: w 3rd r:w 4th r:w 5th r:w next r:w ea lcd @(d:32,ers),exr r:w 2nd r:w 3rd r:w 4th r:w 5th r:w next r:w ea appendix a instruction set rev.3.00 jan. 10, 2007 page 891 of 1038 rej09b0328-0300 instruction 1 2 3 4 5 6 7 8 9 lcd @ers+,ccr r:w 2nd r:w next internal operation 1 state r:w ea lcd @ers+,exr r:w 2nd r:w next internal operation 1 state r:w ea lcd @aa:16,ccr r:w 2nd r:w 3rd r:w next r:w ea lcd @aa:16,exr r:w 2nd r:w 3rd r:w next r:w ea lcd @aa:32,ccr r:w 2nd r:w 3rd r:w 4th r:w next r:w ea lcd @aa:32,exr r:w 2nd r:w 3rd r:w 4th r:w next r:w ea ldm.l @sp+, (ern-ern+1) r:w 2nd r:w:m next internal operation 1 state r:w:m stack(h) * 3 r:w stack(l) * 3 ldm.l @sp+, (ern-ern+2) r:w 2nd r:w:m next internal operation 1 state r:w:m stack(h) * 3 r:w stack(l) * 3 ldm.l @sp+, (ern-ern+3) r:w 2nd r:w:m next internal operation 1 state r:w:m stack(h) * 3 r:w stack(l) * 3 ldmac ers,mach ldmac ers,macl mac @ern+,@erm+ cannot be used in this lsi. mov.b #xx:8,rd r:w next mov.b rs,rd r:w next mov.b @ers,rd r:w next r:b ea mov.b @(d:16,ers),rd r:w 2nd r:w next r:b ea mov.b @(d:32,ers),rd r:w 2nd r:w 3rd r:w 4th r:w next r:b ea mov.b @ers+,rd r:w next internal operation 1 state r:b ea mov.b @aa:8,rd r:w next r:b ea mov.b @aa:16,rd r:w 2nd r:w next r:b ea mov.b @aa:32,rd r:w 2nd r:w 3rd r:w next r:b ea mov.b rs,@erd r:w next w:b ea mov.b rs,@(d:16,erd) r:w 2nd r:w next w:b ea mov.b rs,@(d:32,erd) r:w 2nd r:w 3rd r:w 4th r:w next w:b ea appendix a instruction set rev.3.00 jan. 10, 2007 page 892 of 1038 rej09b0328-0300 instruction 1 2 3 4 5 6 7 8 9 mov.b rs,@-erd r:w next internal operation 1 state w:b ea mov.b rs,@aa:8 r:w next w:b ea mov.b rs,@aa:16 r:w 2nd r:w next w:b ea mov.b rs,@aa:32 r:w 2nd r:w 3rd r:w next w:b ea mov.w #xx:16,rd r:w 2nd r:w next mov.w rs,rd r:w next mov.w @ers,rd r:w next r:w ea mov.w @(d:16,ers),rd r:w 2nd r:w next r:w ea mov.w @(d:32,ers),rd r:w 2nd r:w 3rd r:w 4th r:w next r:w ea mov.w @ers+,rd r:w next internal operation 1 state r:w ea mov.w @aa:16,rd r:w 2nd r:w next r:w ea mov.w @aa:32,rd r:w 2nd r:w 3rd r:w next r:b ea mov.w rs,@erd r:w next w:w ea mov.w rs,@(d:16,erd) r:w 2nd r:w next w:w ea mov.w rs,@(d:32,erd) r:w 2nd r:w 3rd r:w 4th r:w next w:w ea mov.w rs,@-erd r:w next internal operation 1 state w:w ea mov.w rs,@aa:16 r:w 2nd r:w next w:w ea mov.w rs,@aa:32 r:w 2nd r:w 3rd r:w next w:w ea mov.l #xx:32,erd r:w 2nd r:w 3rd r:w next mov.l ers,erd r:w next mov.l @ers,erd r:w 2nd r:w:m next r:w:m ea r:w ea+2 mov.l @(d:16,ers),erd r:w 2nd r:w:m 3rd r:w next r:w:m ea r:w ea+2 mov.l @(d:32,ers),erd r:w 2nd r:w:m 3rd r:w:m 4th r:w 5th r:w next r:w:m ea r:w ea+2 mov.l @ers+,erd r:w 2nd r:w:m next internal operation 1 state r:w:m ea r:w ea+2 appendix a instruction set rev.3.00 jan. 10, 2007 page 893 of 1038 rej09b0328-0300 instruction 1 2 3 4 5 6 7 8 9 mov.l @aa:16,erd r:w 2nd r:w:m 3rd r:w next r:w:m ea r:w ea+2 mov.l @aa:32,erd r:w 2nd r:w:m 3rd r:w 4th r:w next r:w:m ea r:w ea+2 mov.l ers,@erd r:w 2nd r:w:m next w:w:m ea w:w ea+2 mov.l ers,@(d:16,erd) r:w 2nd r:w:m 3rd r:w next w:w:m ea w:w ea+2 mov.l ers,@(d:32,erd) r:w 2nd r:w:w 3rd r:w:m 4th r:w 5th r:w next w:w:m ea w:w ea+2 mov.l ers,@-erd r:w 2nd r:w:m next internal operation 1 state w:w:m ea w:w ea+2 mov.l ers,@aa:16 r:w 2nd r:w:m 3rd r:w next w:w:m ea w:w ea+2 mov.l ers,@aa:32 r:w 2nd r:w:m 3rd r:w 4th r:w next w:w:m ea w:w ea+2 movfpe @aa:16,rd movtpe rs,@aa:16 cannot be used in this lsi. mulxs.b rs,rd r:w 2nd r:w next internal operation 11 state mulxs.w rs,rd r:w 2nd r:w next internal operation 19 state mulxu.b rs,rd r:w next internal operation 11 state mulxu.w rs,rd r:w next internal operation 19 state neg.b rd r:w next neg.w rd r:w next neg.l erd r:w next nop r:w next not.b rd r:w next not.w rd r:w next not.l erd r:w next or.b #xx:8,rd r:w next or.b rs,rd r:w next or.w #xx:16,rd r:w 2nd r:w next or.w rs,rd r:w next or.l #xx:32,erd r:w 2nd r:w 3rd r:w next appendix a instruction set rev.3.00 jan. 10, 2007 page 894 of 1038 rej09b0328-0300 instruction 1 2 3 4 5 6 7 8 9 or.l ers,erd r:w 2nd r:w next orc #xx:8,ccr r:w next orc #xx:8,exr r:w 2nd r:w next pop.w rn r:w next internal operation 1 state r:w ea pop.l ern r:w 2nd r:w:m next internal operation 1 state r:w:m ea r:w ea+2 push.w rn r:w next internal operation 1 state w:w ea push.l ern r:w 2nd r:w:m next internal operation 1 state w:w:m ea w:w ea+2 rotl.b rd r:w next rotl.b #2,rd r:w next rotl.w rd r:w next rotl.w #2,rd r:w next rotl.l erd r:w next rotl.l #2, erd r:w next rotr.b rd r:w next rotr.b #2,rd r:w next rotr.w rd r:w next rotr.w #2,rd r:w next rotr.l erd r:w next rotr.l #2,erd r:w next rotxl.b rd r:w next rotxl.b #2.rd r:w next rotxl.w rd r:w next rotxl.w #2,rd r:w next rotxl.l erd r:w next appendix a instruction set rev.3.00 jan. 10, 2007 page 895 of 1038 rej09b0328-0300 instruction 1 2 3 4 5 6 7 8 9 rotxl.l #2,erd r:w next rotxr.b rd r:w next rotxr.b #2,rd r:w next rotxr.w rd r:w next rotxr.w #2,rd r:w next rotxr.l erd r:w next rotxr.l #2.erd r:w next rte r:w next r:w stack (exr) r:w stack(h) r:w stack(l) internal operation 1 state r:w * 4 rts r:w next r:w:m stack(h) r:w stack(l) internal operation 1 state r:w * 4 shal.b rd r:w next shal b #2,rd r:w next shal.w rd r:w next shal.w #2,rd r:w next shal.l erd r:w next shal.l #2,erd r:w next shar.b rd r:w next shar.b #2,rd r:w next shar.w rd r:w next shar.w #2,rd r:w next shar.l erd r:w next shar.l #2,erd r:w next shll.b rd r:w next shll.b #2,rd r:w next shll.w rd r:w next shll.w #2,rd r:w next appendix a instruction set rev.3.00 jan. 10, 2007 page 896 of 1038 rej09b0328-0300 instruction 1 2 3 4 5 6 7 8 9 shll.l erd r:w next shll.l #2,erd r:w next shlr.b rd r:w next shlr.b #2,rd r:w next shlr.w rd r:w next shlr.w #2,rd r:w next shlr.l erd r:w next shlr.l #2,erd r:w next sleep r:w next internal operation: m stc ccr,rd r:w next stc exr,rd r:w next stc ccr,@erd r:w 2nd r:w next w:w ea stc exr,@erd r:w 2nd r:w next w:w ea stc ccr,@(d:16,erd) r:w 2nd r:w 3rd r:w next w:w ea stc exr,@(d:16,erd) r:w 2nd r:w 3rd r:w next w:w ea stc ccr,@(d:32,erd) r:w 2nd r:w 3rd r:w 4th r:w 5th r:w next w:w ea stc exr,@(d:32,erd) r:w 2nd r:w 3rd r:w 4th r:w 5th r:w next w:w ea stc ccr,@-erd r:w 2nd r:w next internal operation 1 state w:w ea stc exr,@-erd r:w 2nd r:w next internal operation 1 state w:w ea stc ccr,@aa:16 r:w 2nd r:w 3rd r:w next w:w ea stc exr,@aa:16 r:w 2nd r:w 3rd r:w next w:w ea stc ccr,@aa:32 r:w 2nd r:w 3rd r:w 4th r:w next w:w ea stc exr,@aa:32 r:w 2nd r:w 3rd r:w 4th r:w next w:w ea stm.l (ern- ern+1),@-sp r:w 2nd r:w:m next internal operation 1 state w:w:m stack (h) * 3 w:w stack (l) * 3 appendix a instruction set rev.3.00 jan. 10, 2007 page 897 of 1038 rej09b0328-0300 instruction 1 2 3 4 5 6 7 8 9 stm.l (ern- ern+2),@-sp r:w 2nd r:w:m next internal operation 1 state w:w:m stack (h) * 3 w:w stack (l) * 3 stm.l (ern- ern+3),@-sp r:w 2nd r:w:m next internal operation 1 state w:w:m stack (h) * 3 w:w stack (l) * 3 stmac mach,erd stmac macl,erd cannot be used in this lsi. sub.b rs,rd r:w next sub.w #xx:16,rd r:w 2nd r:w next sub.w rs,rd r:w next sub.l #xx:32,erd r:w 2nd r:w 3nd r:w next sub.l ers,erd r:w next sub #1/2/4,erd r:w next subx #xx:8,rd r:w next subx rs,rd r:w next tas @erd * 8 r:w 2nd r:w next r:b:m ea w:b ea trapa #x:2 r:w next internal operation 1 state w:w stack(l) w:w stack(h) w:w stack (exr) r:w:m vec r:w vec+2 internal operation 1 state r:w * 7 xor.b #xx:8,rd r:w next xor.b rs,rd r:w next xor.w #xx:16,rd r:w 2nd r:w next xor.w rs,rd r:w next xor.l #xx:32,erd r:w 2nd r:w 3rd r:w next xor.l ers,erd r:w 2nd r:w next xorc #xx:8,ccr r:w next xorc #xx:8,exr r:w 2nd r:w next appendix a instruction set rev.3.00 jan. 10, 2007 page 898 of 1038 rej09b0328-0300 instruction 1 2 3 4 5 6 7 8 9 reset exception handling r:w:m vec r:w vec+2 internal operation 1 state r:w * 5 interrupt exception handling r:w * 6 internal operation 1 state w:w stack(l) w:w stack(h) w:w stack (exr) r:w:m vec r:w vec+2 internal operation 1 state r:w * 7 notes: 1. eas is the contents of er5, and ead is the contents of er6. 2. 1 is added to eas and ead after execution. n is the initial value of r4l or r4. when 0 is set to n, r4l or r4 is not executed. 3. repeated twice for 2-unit retract/return, three times for 3-unit retract/return, and four times for 4-retract/return. 4. head address after return. 5. start address of the program. 6. pre-fetch address obtained by adding 2 to the pc to be retracted. when returning from sleep mode, standby mode or watch mode, internal operation is executed instead of read operation. 7. head address of the interrupt process routine. 8. only register er0, er1, er4, or er5 should be used when using the tas instruction. appendix a instruction set rev.3.00 jan. 10, 2007 page 899 of 1038 rej09b0328-0300 a.6 change of condition codes this section explains change of condition codes after instruction execution of the cpu. legend of the following tables is as follows. m = 31: longword size m = 15: word size m = 7: byte size si: bit i of source operand di: bit i of destination operand ri: bit i of result dn: specified bit of destination operand ? : no affection : changes depending on execution result 0: always cleared to 0 1: always set to 1 *: value undetermined z': z flag before execution c': c flag before execution appendix a instruction set rev.3.00 jan. 10, 2007 page 900 of 1038 rej09b0328-0300 table a.7 change of condition code instruction h n z v c definition add h=sm-4 ? dm-4+dm-4 ? rm-4 +sm-4 ? rm-4 n=rm z= rm ? rm-1 ? ? ? ? ? ? ? ? r0 v=sm ? dm ? rm + sm ? dm ? rm c=sm ? dm+dm ? rm +sm ? rm adds ? ? ? ? ? addx h=sm-4 ? dm-4+dm-4 ? rm-4 +sm-4 ? rm-4 n=rm z=z' ? rm ? ? ? ? ? ? ? ? r0 v=sm ? dm ? rm + sm ? dm ? rm c=sm ? dm+dm ? rm +sm ? rm and ? 0 ? n=rm z= rm ? rm-1 ? ? ? ? ? ? ? ? r0 andc value in the bit corresponding to execution result is stored. no flag change when exr. band ? ? ? ? c=c' ? dn bcc ? ? ? ? ? bclr ? ? ? ? ? biand ? ? ? ? c=c' ? dn bild ? ? ? ? c= dn bior ? ? ? ? c=c'+ dn bist ? ? ? ? ? bixor ? ? ? ? c=c' ? dn+ c' ? dn bld ? ? ? ? c=dn bnot ? ? ? ? ? bor ? ? ? ? c=c'+dn bset ? ? ? ? ? bsr ? ? ? ? ? bst ? ? ? ? ? btst ? ? ? ? z= dn bxor ? ? ? ? c=c' ? dn + c' ? dn clrmac cannot be used in this lsi. appendix a instruction set rev.3.00 jan. 10, 2007 page 901 of 1038 rej09b0328-0300 instruction h n z v c definition cmp h=sm-4 ? dm-4 + dm-4 ? rm-4+sm-4 ? rm-4 n=rm z= rm ? rm-1 ? ? ? ? ? ? ? ? r0 v= sm ? dm ? rm +sm ? dm ? rm c=sm ? dm + dm ? rm+sm ? rm daa * * n=rm z= rm ? rm-1 ? ? ? ? ? ? ? ? r0 c: decimal addition carry das * * n=rm z= rm ? rm-1 ? ? ? ? ? ? ? ? r0 c: decimal subtraction borrow dec ? ? n=rm z= rm ? rm-1 ? ? ? ? ? ? ? ? r0 v=dm ? rm divxs ? ? ? n=sm ? dm + sm ? dm z= sm ? sm-1 ? ? ? ? ? ? ? ? s0 divxu ? ? ? n=sm z= sm ? sm-1 ? ? ? ? ? ? ? ? s0 eepmov ? ? ? ? ? exts ? 0 ? n=rm z= rm ? rm-1 ? ? ? ? ? ? ? ? r0 extu ? 0 0 ? z= rm ? rm-1 ? ? ? ? ? ? ? ? r0 inc ? ? n=rm z= rm ? rm-1 ? ? ? ? ? ? ? ? r0 v= dm ? rm jmp ? ? ? ? ? jsr ? ? ? ? ? ldc value in the bit corresponding to execution result is stored. no flag change when exr. ldm ? ? ? ? ? ldmac mac cannot be used in this lsi. mov ? 0 ? n=rm z= rm ? rm-1 ? ? ? ? ? ? ? ? r0 appendix a instruction set rev.3.00 jan. 10, 2007 page 902 of 1038 rej09b0328-0300 instruction h n z v c definition movfpe movtpe cannot be used in this lsi. mulxs ? ? ? n=r2m z= r2m ? r2m-1 ? ? ? ? ? ? ? ? r0 mulxu ? ? ? ? ? neg h=dm-4+rm-4 n=rm z= rm ? rm-1 ? ? ? ? ? ? ? ? r0 v=dm ? rm c=dm+rm nop ? ? ? ? ? not ? 0 ? n=rm z= rm ? rm-1 ? ? ? ? ? ? ? ? r0 or ? 0 ? n=rm z= rm ? rm-1 ? ? ? ? ? ? ? ? r0 orc value in the bit corresponding to execution result is stored. no flag change when exr. pop ? 0 ? n=rm z= rm ? rm-1 ? ? ? ? ? ? ? ? r0 push ? 0 ? n=rm z= rm ? rm-1 ? ? ? ? ? ? ? ? r0 rotl ? 0 n=rm z= rm ? rm-1 ? ? ? ? ? ? ? ? r0 c=dm(in case of 1 bit), c=dm-1(in case of 2 bits) rotr ? 0 n=rm z= rm ? rm-1 ? ? ? ? ? ? ? ? r0 c=d0 (in case of 1 bit) , c=d1 (in case of 2 bits) rotxl ? 0 n=rm z= rm ? rm-1 ? ? ? ? ? ? ? ? r0 c=dm (in case of 1 bit) , c=dm-1 (in case of 2 bits) rotxr ? 0 n=rm z= rm ? rm-1 ? ? ? ? ? ? ? ? r0 c=d0 (in case of 1 bit) , c=d1 (in case of 2 bits) rte value in the bit corresponding to execution result is stored. rts ? ? ? ? ? appendix a instruction set rev.3.00 jan. 10, 2007 page 903 of 1038 rej09b0328-0300 instruction h n z v c definition shal ? n=rm z= rm ? rm-1 ? ? ? ? ? ? ? ? r0 v = dm dm?1 + dm dm ? 1 (in case of 1-bit) v = dm dm?1 dm?2 dm dm ? 1 dm ? 2 (in case of 2-bit) c=dm (in case of 1 bit) , c=dm-1 (in case of 2 bits) shar ? 0 n=rm z= rm ? rm-1 ? ? ? ? ? ? ? ? r0 c=d0 (in case of 1 bit) , c=d1 (in case of 2 bits) shll ? 0 n=rm z= rm ? rm-1 ? ? ? ? ? ? ? ? r0 c=dm (in case of 1 bit) , c=dm-1 (in case of 2 bits) shlr ? 0 0 n=rm z= rm ? rm-1 ? ? ? ? ? ? ? ? r0 c=d0 (in case of 1 bit) , c=d1 (in case of 2 bits) sleep ? ? ? ? ? stc ? ? ? ? ? stm ? ? ? ? ? stmac cannot be used in this lsi. sub h=sm-4 ? dm-4 + dm-4 ? rm-4+sm-4 ? rm-4 n=rm z= rm ? rm-1 ? ? ? ? ? ? ? ? r0 v= sm ? dm ? rm +sm ? dm ? rm c=sm ? dm + dm ? rm+sm ? rm subs ? ? ? ? ? subx h=sm-4 ? dm-4 + dm-4 ? rm-4+sm-4 ? rm-4 n=rm z=z' ? rm ? ? ? ? ? ? ? ? r0 v= sm ? dm ? rm +sm ? dm ? rm c=sm ? dm + dm ? rm+sm ? rm tas ? 0 ? n=dm z= dm ? dm-1 ? ? ? ? ? ? ? ? d0 trapa ? ? ? ? ? xor ? 0 ? n=rm z= rm ? rm-1 ? ? ? ? ? ? ? ? r0 xorc value in the bit corresponding to execution result is stored. no flag change when exr. appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 904 of 1038 rej09b0328-0300 appendix b internal i/o registers b.1 addresses address * register name r/w access bus width 7 6 5 4 3 2 1 0 module name h'd000 dgkp15 dgkp14 dgkp13 dgkp12 dgkp11 dgkp10 dgkp9 dgkp8 h'd001 dgkp w 16 16 dgkp7 dgkp6 dgkp5 dgkp4 dgkp3 dgkp2 dgkp1 dgkp0 h'd002 dgks15 dgks14 dgks13 dgks12 dgks11 dgks10 dgks9 dgks8 h'd003 dgks w 16 16 dgks7 dgks6 dgks 5 dgks4 dgks3 dgks2 dgks1 dgks0 h'd004 dap15 dap14 dap13 dap12 dap11 dap10 dap9 dap8 h'd005 dap w 16 16 dap7 dap6 dap5 dap4 dap3 dap2 dap1 dap0 h'd006 dbp15 dbp14 dbp13 dbp12 dbp11 dbp10 dbp9 dbp8 h'd007 dbp w 16 16 dbp7 dbp6 dbp5 dbp4 dbp3 dbp2 dbp1 dbp0 h'd008 das15 das14 das13 das12 das11 das10 das9 das8 h'd009 das w 16 16 das7 das6 das5 das4 das3 das2 das1 das0 h'd00a dbs15 dbs14 dbs13 dbs12 dbs11 dbs10 dbs9 dbs8 h'd00b dbs w 16 16 dbs7 dbs6 dbs5 dbs4 dbs3 dbs2 dbs1 dbs0 h'd00c dofp15 dofp14 dofp13 dofp12 dofp11 dofp10 dofp9 dofp8 h'd00d dofp w 16 16 dofp7 dofp6 dofp5 dofp4 dofp3 dofp2 dofp1 dofp0 h'd00e dofs15 dofs14 dofs13 d ofs12 dofs11 dofs 10 dofs9 dofs8 h'd00f dofs w 16 16 dofs7 dofs6 dofs 5 dofs4 dofs3 d ofs2 dofs1 dofs0 drum digital filter h'd010 cgkp15 cgkp14 cgkp13 cgkp12 cgkp11 cgkp10 cgkp9 cgkp8 h'd011 cgkp w 16 16 cgkp7 cgkp6 cgkp5 cgkp4 cgkp3 cgkp2 cgkp1 cgkp0 h'd012 cgks15 cgks14 cgks13 cgks12 cgks11 cgks10 cgks9 cgks8 h'd013 cgks w 16 16 cgks7 cgks6 cgks 5 cgks4 cgks3 cgks2 cgks1 cgks0 h'd014 cap15 cap14 cap13 cap12 cap11 cap10 cap9 cap8 h'd015 cap w 16 16 cap7 cap6 cap5 cap4 cap3 cap2 cap1 cap0 h'd016 cbp15 cbp14 cbp13 cbp12 cbp11 cbp10 cbp9 cbp8 h'd017 cbp w 16 16 cbp7 cbp6 cbp5 cbp4 cbp3 cbp2 cbp1 cbp0 h'd018 cas15 cas14 cas13 cas12 cas11 cas10 cas9 cas8 h'd019 cas w 16 16 cas7 cas6 cas5 cas4 cas3 cas2 cas1 cas0 h'd01a cbs15 cbs14 cbs13 cbs12 cbs11 cbs10 cbs9 cbs8 h'd01b cbs w 16 16 cbs7 cbs6 cbs5 cbs4 cbs3 cbs2 cbs1 cbs0 h'd01c cofp15 cofp14 cofp13 cofp12 cofp11 cofp10 cofp9 cofp8 h'd01d cofp w 16 16 cofp7 cofp6 cofp5 cofp4 cofp3 cofp2 cofp1 cofp0 h'd01e cofs15 cofs14 cofs13 c ofs12 cofs11 cofs 10 cofs9 cofs8 h'd01f cofs w 16 16 cofs7 cofs6 cofs 5 cofs4 cofs3 c ofs2 cofs1 cofs0 capstan digital filter appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 905 of 1038 rej09b0328-0300 address * register name r/w access bus width 7 6 5 4 3 2 1 0 module name h'd020 ? ? ? ? dzs11 dzs10 dzs9 dzs8 h'd021 dzs w 16 16 dzs7 dzs6 dzs5 dzs4 dzs3 dzs2 dzs1 dzs0 h'd022 ? ? ? ? dzp11 dzp10 dzp9 dzp8 h'd023 dzp w 16 16 dzp7 dzp6 dzp5 dzp4 dzp3 dzp2 dzp1 dzp0 h'd024 ? ? ? ? czs11 czs10 czs9 czs8 h'd025 czs w 16 16 czs7 czs6 czs5 czs4 czs3 czs2 czs1 czs0 h'd026 ? ? ? ? czp11 czp10 czp9 czp8 h'd027 czp w 16 16 czp7 czp6 czp5 czp4 czp3 czp2 czp1 czp0 h'd028 dfic r/w 8 ? drov dpha dzpon dzso n dsg2 dsg1 dsc0 h'd029 cfic r/w 8 16 ? crov cpha czpon czso n csg2 csg1 csg0 h'd02a dfucr r/w 8 16 ? ? pton cp/ dp cfeps dfeps cfess dfess digital filter h'd030 dfpr15 dfpr14 dfpr13 dfpr12 dfpr11 dfpr10 dfpr9 dfpr8 h'd031 dfpr w 16 16 dfpr7 dfpr6 dfpr5 dfpr4 dfpr3 dfpr2 dfpr1 dfpr0 h'd032 dfer15 dfer14 dfer13 dfer12 dfer11 dfer10 dfer9 dfer8 h'd033 dfer r/w 16 16 dfer7 dfer6 dfer5 dfer4 dfer3 dfer2 dfer1 dfer0 h'd034 dfrudr1 5 dfrudr1 4 dfrudr1 3 dfrudr1 2 dfrudr1 1 dfrudr1 0 dfrudr9 dfrudr8 h'd035 dfrudr w 16 16 dfrudr7 dfrudr6 dfrudr5 dfrudr4 dfrudr3 dfrudr2 dfrudr1 dfrudr0 h'd036 dfrldr1 5 dfrldr1 4 dfrldr1 3 dfrldr1 2 dfrldr1 1 dfrldr1 0 dfrldr9 dfrldr8 h'd037 dfrldr w 16 16 dfrldr7 dfrldr6 dfrldr5 dfrldr4 dfrldr3 dfrldr2 dfrldr1 dfrldr0 h'd038 dfvcr r/w 8 16 dfcs1 dfcs0 dfovf dfrfon df-r/unr opcnt dfrcs1 dfrcs0 h'd039 dpgcr r/w 8 16 dpcs1 dpcs0 dpovf n/v hswes ? ? ? h'd03a dppr15 dppr14 dppr13 dppr12 dppr11 dppr10 dppr9 dppr8 h'd03b dppr2 w 16 16 dppr7 dppr6 dppr5 dppr4 dppr3 dppr2 dppr1 dppr0 h'd03c dppr1 w 8 16 ? ? ? ? dppr19 dppr18 dppr17 dppr16 h'd03d dper1 w 8 16 ? ? ? ? dper19 dper18 dper17 dper16 h'd03e dper15 dper14 dper13 dper12 dper11 dper10 dper9 dper8 h'd03f dper2 w 16 16 dper7 dper6 dper5 dper4 dper3 dper2 dper1 dper0 drum error detector h'd050 cfpr15 cfpr14 cfpr13 cfpr12 cfpr11 cfpr10 cfpr9 cfpr8 h'd051 cfpr w 16 16 cfpr7 cfpr6 cfpr5 cfpr4 cfpr3 cfpr2 cfpr1 cfpr0 h'd052 cfer15 cfer14 cfer13 cfer12 cfer11 cfer10 cfer9 cfer8 h'd053 cfer r/w 16 16 cfer7 cfer6 cfer5 cfer4 cfer3 cfer2 cfer1 cfer0 h'd054 cfrudr1 5 cfrudr1 4 cfrudr1 3 cfrudr1 2 cfrudr1 1 cfrudr1 0 cfrudr9 cfrudr8 h'd055 cfrudr w 16 16 cfrudr7 cfrudr6 cfrudr5 cfrudr4 cfrudr3 cfrudr2 cfrudr1 cfrudr0 h'd056 cfrldr1 5 cfrldr1 4 cfrldr1 3 cfrldr1 2 cfrldr1 1 cfrldr1 0 cfrldr9 cfrldr8 h'd057 cfrldr w 16 16 cfrldr7 cfrldr6 cfrldr5 cfrldr4 cfrldr3 cfrldr2 cfrldr1 cfrldr0 h'd058 cfvcr r/w 8 16 cfcs1 cfcs0 cfovf cfrfon cf-r/unr cpcnt cfrcs1 cfrcs0 h'd059 cpgcr r/w 8 16 cpcs1 cpcs0 cpovf cr/rf selcfg2 ? ? ? capstan error detector appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 906 of 1038 rej09b0328-0300 address * register name r/w access bus width 7 6 5 4 3 2 1 0 module name h'd05a cph15 cph14 cph13 cp h12 cph11 cph10 cph9 cph8 h'd05b cppr2 w 16 16 cph7 cph6 cph5 cph4 cph3 cph2 cph1 cph0 h'd05c cppr1 w 8 16 ? ? ? ? cph19 cph18 cph17 cph16 h'd05d cper1 w 8 16 ? ? ? ? cper19 cper18 cper17 cper16 h'd05e cper15 cper14 cper13 cper12 cper11 cper10 cper9 cper8 h'd05f cper2 w 16 16 cper7 cper6 cper5 cper4 cper3 cper2 cper1 cper0 capstan error detector h'd060 hsm1 r/w 8 flb fla empb empa ovwb ovwa clrb clra h'd061 hsm2 r/w 8 16 frt fgr2off lop edg isel sofg ofg vff/nff h'd062 hslp w 8 16 lob3 lob2 lob1 lob0 loa3 loa2 loa1 loa0 h'd064 ? adtrga striga narrowff a vffa affa vpulsea mlevela h'd065 fpdra w 16 16 ppga7 ppga6 ppga5 ppga4 ppga3 ppga2 ppga1 ppga0 h'd066 ftpra * w 16 ftpra15 ftrpa14 ftrpa13 ftrpa12 ftrpa11 ftrpa10 ftrpa9 ftrpa8 h'd066 ftctr * r 16 16 ftctr15 ftctr14 ftctr13 ftctr12 ftctr11 ftctr10 ftctr9 ftctr8 h'd067 ftpra * w 16 ftpra7 ftpra6 ftpra5 ftpra4 ftpra3 ftpra2 ftpra1 ftpra0 h'd067 ftctr * r 16 16 ftctr7 ftctr6 ftctr5 ftctr4 ftctr3 ftctr2 ftctr1 ftctr0 h'd068 ? adtrgb strigb narrowff b vffb affb vpulseb mlevelb h'd069 fpdrb w 16 16 ppgb7 ppgb6 ppgb5 ppgb4 ppgb3 ppgb2 ppgb1 ppgb0 h'd06a ftprb15 ftprb14 ftprb13 ftprb12 ftprb11 ftprb10 ftprb9 ftprb8 h'd06b ftprb w 16 16 ftprb7 ftprb6 ftprb5 ftprb4 fptrb3 fptrb2 fptrb1 fptrb0 h'd06c dfctr * w 8 isel2 cclr cksl dfcra 4 dfcra3 dfcra2 dfcra1 dfcra0 h'd06c dfcrb r 8 16 ? ? ? dfctr4 dfctr3 dfctr2 dfctr1 dfctr0 h'd06d dfcrb w 8 16 ? ? ? dfcrb4 dfcrb3 dfcrb2 dfcrb1 dfcrb0 hsw timing generator * assign to the same address. h'd06e chcr w 8 v/n hswpol crh hah sig3 sig2 sig1 sig0 4-head special- effects playback h'd06f addvr r/w 8 16 ? ? ? hmsk hi-z cut vpon pol additional v h'd070 ? ? ? ? xr11 xr10 xr9 xr8 h'd071 xdr w 16 16 xr7 xr6 xr5 xr4 xr3 xr2 xr1 xr0 h'd072 ? ? ? ? trd11 trd10 trd9 trd8 h'd073 trdr w 16 16 trd7 trd6 trd5 trd4 trd3 trd2 trd1 trd0 h'd074 xtcr r/w 8 16 ? caprf at/ mu trk/ x exc/ref xcs dvrer1 dvref0 x-value, trk-value h'd078 ? ? ? ? dpwdr11 dpwdr10 dpwdr9 dpwdr8 h'd079 dpwdr r/w 16 16 dpwdr7 dpwdr6 dpwdr5 dpwdr4 dpwdr3 dpwdr2 dpwdr1 dpwdr0 h'd07a dpwcr w 8 dpol ddc dhiz dh/l dsfdf dck2 dck1 dck0 drum 12- bit pwm h'd07b cpwcr w 8 16 cpol cdc chiz ch/l cs f/df cck2 cck1 cck0 h'd07c ? ? ? ? cpwdr11 cpwdr10 cpwdr9 cpwdr8 h'd07d cpwdr r/w 16 16 cpwdr7 cpwdr6 cpwdr5 cpwdr4 cpwdr3 cpwdr2 cpwdr1 cpwdr0 capstan 12-bit pwm appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 907 of 1038 rej09b0328-0300 address * register name r/w access bus width 7 6 5 4 3 2 1 0 module name h'd080 ctcr w 8 nt/pal flsc flsb fsla ccs lctl unctl slwm h'd081 ctlm r/w 8 16 asm rec/ pb fw/rv md4 md3 md3 md1 md0 h'd082 ? ? ? ? cmt1b cmt1a cmt19 cmt18 h'd083 rcdr1 w 16 16 cmt17 cmt16 cmt15 cmt14 cmt13 cmt12 cmt11 cmt10 h'd084 ? ? ? ? cmt2b cmt2a cmt29 cmt28 h'd085 rcdr2 w 16 16 cmt27 cmt26 cmt25 cmt24 cmt23 cmt22 cmt21 cmt20 h'd086 ? ? ? ? cmt3b cmt3a cmt39 cmt38 h'd087 rcdr3 w 16 16 cmt37 cmt36 cmt35 cmt34 cmt33 cmt32 cmt31 cmt30 h'd088 ? ? ? ? cmt4b cmt4a cmt49 cmt48 h'd089 rcdr4 w 16 16 cmt47 cmt46 cmt45 cmt44 cmt43 cmt42 cmt41 cmt40 h'd08a ? ? ? ? cmt5b cmt5a cmt59 cmt58 h'd08b rcdr5 w 16 16 cmt57 cmt56 cmt55 cmt54 cmt53 cmt52 cmt51 cmt50 h'd08c di/o r/w 8 vctr2 vctr1 vctr0 ? bpon bps bpf di/o h'd08d btpr r/w 8 16 lsp7 lsp6 lsp5 lsp4 lsp3 lsp2 lsp1 lsp0 ctl circuit h'd090 ref15 ref14 ref13 ref 12 ref11 ref10 ref9 ref8 h'd091 rfd w 16 16 ref7 ref6 ref5 ref4 ref3 ref2 ref1 ref0 h'd092 crf15 crf14 crf13 crf12 crf11 crf10 crf9 crf8 h'd093 crf w 16 16 crf7 crf6 crf5 crf4 crf3 crf2 crf1 crf0 h'd094 rfc15 rfc14 rfc13 rfc12 rfc11 rfc10 rfc9 rfc8 h'd095 rfc r/w 16 16 rfc7 rfc6 rfc5 rfc4 rfc3 rfc2 rfc1 rfc0 h'd096 rfm r/w 8 rcf vna cvs rex crd od/ev vst veg h'd097 rfm2 r/w 8 16 (tbc) * ? ? ? ? ? ? fds reference signal generator * the tbc bit is available only in the h8s/2194 c group. h'd098 ctvc r/w 8 cex ceg ? ? ? cfg hsw ctl h'd099 ctlr w 8 16 ctl7 ctl6 ctl5 ctl4 ctl3 ctl2 ctl1 ctl0 h'd09a cdvc r/w 8 mcgain cmk cmn dvtrg crf cps1 cps0 h'd09b cdivr1 w 8 16 ? cdv16 cdv15 cdv14 cdv 13 cdv12 cdv11 cdv10 h'd09c cdivr2 w 8 ? cdv26 cdv25 cdv24 cdv 23 cdv22 cdv21 cdv20 h'd09d ctmr w 8 16 ? ? cpm5 cpm4 cpm3 cpm2 cpm1 cpm0 h'd09e fgcr w 8 16 ? ? ? ? ? ? ? drf frequency divider h'd0a0 spmr r/w 8 8 ctlstop ? cfgcom p excelon dpgsw comp h.amp.s w c.rot h'd0a1 spcr r/w 8 8 ? ? ? spcr4 spcr3 spcr2 spcr1 spcr0 h'd0a2 spdr r/w 8 8 ? ? ? spdr4 spdr3 spdr2 spdr1 spdr0 h'd0a3 svmcr r/w 8 8 ? ? svmcr5 svmcr4 svmcr3 svmcr2 svmcr1 svmcr0 h'd0a4 ctlgr r/w 8 8 ? ? ? ctlfb ctlgr3 ctlgr2 ctlgr1 ctlgr0 servo port control h'd0b0 vtr w 8 16 ? ? vtr5 vtr4 vtr3 vtr2 vtr1 vtr0 h'd0b1 htr w 8 16 ? ? ? ? htr3 htr2 htr1 htr0 h'd0b2 hrtr w 8 16 hrtr7 hrtr6 hrtr5 hrtr4 hrtr3 hrtr2 hrtr1 hrtr0 h'd0b3 hpwr w 8 16 ? ? ? ? hpwr3 hpwr2 hpwr1 hpwr0 h'd0b4 nwr w 8 16 ? ? nwr5 nwr4 nwr3 nwr2 nwr1 nwr0 h'd0b5 ndr w 8 16 ndr7 ndr6 ndr5 ndr4 ndr3 ndr2 ndr1 ndr0 h'd0b6 syncr r/w 8 16 ? ? ? ? nid/vd nois fld syct sync detector appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 908 of 1038 rej09b0328-0300 address * register name r/w access bus width 7 6 5 4 3 2 1 0 module name h'd0b8 sienr1 r/w 8 16 iedr3 iedr2 iedr1 iecap3 iecap2 iecap1 iehsw2 iehsw1 h'd0b9 sienr2 r/w 8 16 ? ? ? ? ? ? iesnc iestl h'd0ba sirqr1 r/w 8 16 irrdrm 3 irrdrm2 irrdrm1 irrcap3 irrcap2 irrcap1 irrhsw2 irrhsw1 h'd0bb sirqr2 r/w 8 16 ? ? ? ? ? ? irrsnc irrctl servo interrupt control h'd0c0 r/w 8 8 h'd0c1 r/w 8 8 h'd0c2 r/w 8 8 h'd0c3 r/w 8 8 h'd0c4 r/w 8 8 h'd0c5 r/w 8 8 h'd0c6 r/w 8 8 h'd0c7 r/w 8 8 h'd0c8 r/w 8 8 h'd0c9 r/w 8 8 h'd0ca r/w 8 8 h'd0cb r/w 8 8 h'd0cc r/w 8 8 h'd0cd r/w 8 8 h'd0ce r/w 8 8 h'd0cf r/w 8 8 h'd0d0 r/w 8 8 h'd0d1 r/w 8 8 h'd0d2 r/w 8 8 h'd0d3 r/w 8 8 h'd0d4 r/w 8 8 h'd0d5 r/w 8 8 h'd0d6 r/w 8 8 h'd0d7 r/w 8 8 h'd0d8 r/w 8 8 h'd0d9 r/w 8 8 h'd0da r/w 8 8 h'd0db r/w 8 8 h'd0dc r/w 8 8 h'd0dd r/w 8 8 h'd0de r/w 8 8 h'd0df 32 byte data buffer r/w 8 8 h'd0e0 star r/w 8 8 ? ? ? sta4 sta3 sta2 sta1 sta0 h'd0e1 edar r/w 8 8 ? ? ? eda4 eda3 eda2 eda1 eda0 h'd0e2 scr2 r/w 8 8 teie abtie ? gap1 gap0 cks2 cks1 cks0 h'd0e3 scsr2 r/w 8 8 tei ? ? sol orer wt abt stf 32-byte buffer sci2 appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 909 of 1038 rej09b0328-0300 address * register name r/w access bus width 7 6 5 4 3 2 1 0 module name h'd100 tier r/w 8 16 iciae icibe icice icide ociae ocibe ovie icsa h'd101 tcsrx r/w 8 16 icfa icfb icfc icfd ocfa ocfb ovf cclra h'd102 frch frch7 frch6 frch5 f rch4 frch3 frch2 frch1 frch0 h'd103 frcl r/w 8/16 16 frcl7 frcl6 frcl5 frcl4 frcl3 frcl2 frcl1 frcl0 h'd104 oxrah * ocrah7 ocrah6 ocrah5 ocrah4 ocrah3 ocrah2 ocrah1 ocrah0 h'd105 ocral * r/w 8/16 16 ocral7 ocral6 ocral5 ocral4 ocral3 ocral2 ocral1 ocral0 h'd104 ocrbh * ocrbh7 corbh6 ocrbh5 ocrbh4 ocrbh3 ocrbh2 ocrbh1 ocrbh0 h'd105 ocrbl * r/w 8/16 16 ocrbl7 ocrbl6 ocrbl5 corbl4 corbl3 corbl2 corbl1 corbl0 h'd106 tcrx r/w 8 16 iedga iedgb iedgc iedgd bufea fufeb cks1 cks0 h'd107 tocr r/w 8 16 icsb icsc icsd ocrs oea oeb olvla olvlb h'd108 icrah icrah7 icrah6 icrah5 icrah4 icrah3 icrah2 icrah1 icrah0 h'd109 icral r 8/16 16 icral7 icral6 icral5 icral4 icral3 icral2 icral1 icral0 h'd10a icrbh icrbh7 icrbh6 icrbh5 i crbh4 icrbh3 icrbh2 icrbh1 icrbh0 h'd10b icrbl r 8/16 16 icrbl7 icrbl6 icrbl5 icrbl4 icrbl3 icrbl2 icrbl1 icrbl0 h'd10c icrch icrch7 icrch6 icrch5 icrch4 icrch3 icrch2 icrch1 icrch0 h'd10d icrcl r 8/16 16 icrcl7 icrcl6 icrcl5 icrcl4 icrcl3 icrcl2 icrcl1 icrcl0 h'd10e icrdh icrdh7 icrdh6 icrdh5 icrdh4 icrdh3 icrdh2 icrdh1 icrdh0 h'd10f icrdl r 8/16 16 icrdl7 icrdl6 icrdl5 icrdl4 icrdl3 icrdl2 icrdl1 icrdl0 timer x1 * ocra and ocrb addresses are the same. switched by ocsr bit in iocr. h'd110 tmb r/w 8 8 tmb17 tmbif tmpie ? ? tmp12 tmp11 tcb10 h'd111 tcb r 8 8 tcb17 tcb16 tcb15 tcb14 tcb13 tcb12 tcb11 tcb10 h'd111 tlb w 8 8 tlb17 tlb16 tlb15 tlb14 tlb13 tlb12 tlb11 tlb10 timer b h'd112 lmr r/w 8 8 lmif lmie ? ? lmr3 lmr2 lmr1 lmr0 h'd113 ltc r 8 8 ltc7 ltc6 ltc5 ltc4 ltc3 ltc2 ltc1 ltc0 h'd113 rcr w 8 8 rcr7 rcr6 rcr5 rcr4 rcr3 rcr2 rcr1 rcr0 timer l h'd118 tmrm1 r/w 8 8 clr2 ac/br rld rlck ps21 pc20 rld/cap cps h'd119 tmrm2 r/w 8 8 lat rs11 ps10 ps31 ps30 cp/slm capf slw h'd11a tmrcp1 r 8 8 tmrc17 tmrc16 tmrc15 tmrc14 tmrc13 tmrc12 tmrc11 tmrc10 h'd11b tmrcp2 r 8 8 tmrc27 tmrc26 tmrc25 tmrc24 tmrc23 tmrc22 tmrc21 tmrc20 h'd11c tmrl1 w 8 8 tmr17 tmr16 tmr15 tmr14 tmr13 tmr12 tmr11 tmr10 h'd11d tmrl2 w 8 8 tmr27 tmr26 tmr25 tmr24 tmr23 tmr22 tmr21 tmr20 h'd11e tmrl3 w 8 8 tmr37 tmr36 tmr35 tmr34 tmr33 tmr32 tmr31 tmr30 h'd11f tmrcs r/w 8 8 tmri3e tm ri2e tmri1e tmri3 tmri2 tmri1 ? ? timer r h'd120 pwdrl w 8 8 pwdrl7 pwdrl6 pwdrl5 pwdrl4 pwdrl3 pwdrl2 pwdrl1 pwdrl0 h'd121 pwdru w 8 8 ? ? pwdru5 pwdru4 pwdru3 pwdru2 pwdru1 pwdru0 h'd122 pwcr r/w 8 8 ? ? ? ? ? ? ? pwmcr0 14-bit pwm h'd126 pwr0 w 8 8 pw07 pw06 pw05 pw04 pw03 pw02 pw01 pw00 h'd127 pwr1 w 8 8 pw17 pw16 pw15 pw14 pw13 pw12 pw11 pw10 h'd128 pwr2 w 8 8 pw27 pw26 pw25 pw24 pw23 pw22 pw21 pw20 h'd129 pwr3 w 8 8 pw37 pw36 pw35 pw34 pw33 pw32 pw31 pw30 h'd12a pw8cr r/w 8 8 ? ? ? ? pwc3 pwc2 pwc1 pwc0 8-bit pwm h'd12c icr1 r 8 8 icr17 icr16 icr15 icr14 icr13 icr12 icr11 cir10 h'd12d pcsr r/w 8 8 icif icie iceg ncon/off ? dcs2 dcs1 dcs0 psu appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 910 of 1038 rej09b0328-0300 address * register name r/w access bus width 7 6 5 4 3 2 1 0 module name h'd130 adrh adr9 adr8 adr7 a dr6 adr5 adr4 adr3 adr2 h'd131 adrl r 16 8 adr1 adr0 ? ? ? ? ? ? h'd132 ahrh ahr9 ahr8 ahr7 a hr6 ahr5 ahr4 ahr3 ahr2 h'd133 ahrl r 16 8 ahr1 ahr0 ? ? ? ? ? ? h'd134 adcr r/w 8 8 ck ? hch1 hch0 sch3 sch2 sch1 sch0 h'd135 adcsr r/w 8 8 send hend adie sst hst busy scnl h'd136 adtsr r/w 8 8 ? ? ? ? ? ? trgs1 trgs0 a/d h'd138 tlk w 8/16 16 tlr27 tlr26 tlr25 tlr24 tlr23 tlr22 tlr21 tlr20 h'd138 tck r 8/16 16 tlr17 tlr16 tlr15 tlr14 tlr13 tlr12 tlr11 tlr10 h'd139 tlj w 8/16 16 tdr27 tdr26 tdr 25 tdr24 tdr23 tdr22 tdr21 tdr20 h'd139 tcj r 8/16 16 tdr17 tdr16 tdr 15 tdr14 tdr13 tdr12 tdr11 tdr10 h'd13a tmj r/w 8/16 16 ps11 ps10 st 8/16 ps21 ps20 tgl t/r h'd13b tmjc r/w 8/16 16 buzz1 buzz0 mon1 mon0 tmj2ie tmj1ie (ps22) * h'd13c tmjs r/w 8/16 16 tmj2i tmj1i ? ? ? ? ? ? timer j * the ps22 bit is available only in the h8s/2194 c group. h'd148 smr1 r/w 8 8 c/ a chr pe o/ e stop mp cks1 cks0 h'd149 brr1 r/w 8 8 h'd14a scr1 r/w 8 8 tei rie te re mpie teie cke1 cke0 h'd14b tdr1 r/w 8 8 h'd14c ssr1 r/w 8 8 tdre rdrf orer fer per temd mpb mpbt h'd14d rdr1 r 8 8 h'd14e scmr1 r/w 8 8 ? ? ? ? sdir sinv ? smif clock synchroniz ation/start- stop sync sci h'd158 iccr r/w 8 8 ice ieic mst trs acke bbsy iric scp h'd159 icsr r/w 8 8 estp stop irtr aasx al aas adz ackb h'd15e icdr * r/w 8 8 icdr7 icdr6 icdr5 i cdr4 icdr3 icdr2 icdr1 icdr0 h'd15e sarx * r/w 8 8 svax6 svax5 svax4 svax3 svax2 svax1 svax0 fsx h'd15f icmr * r/w 8 8 mls wait cks2 cks1 cks0 bc2 bc1 bc0 h'd15f sar * r/w 8 8 sva6 sva5 sva4 sva3 sva2 sva1 sva0 fs iic interface * access varies depending on ice bit. h'ffb0 ta023 ta022 ta021 ta020 ta019 ta018 ta017 ta016 h'ffb1 ta015 ta014 ta013 ta012 ta011 ta010 ta009 ta008 h'ffb2 tar0 r/w 8 8 ta007 ta006 ta005 ta004 ta003 ta002 ta001 h'ffb3 ta123 ta122 ta121 ta120 ta119 ta118 ta117 ta116 h'ffb4 ta115 ta114 ta113 ta112 ta111 ta110 ta109 ta108 h'ffb5 tar1 r/w 8 8 ta107 ta106 ta105 ta104 ta103 ta102 ta101 h'ffb6 ta223 ta222 ta221 ta220 ta219 ta218 ta217 ta216 h'ffb7 ta215 ta214 ta213 ta212 ta211 ta210 ta209 ta208 h'ffb8 tar2 r/w 8 8 ta207 ta206 ta205 ta204 ta203 ta202 ta201 h'ffb9 t rcr r/w 8 8 ? ? ? ? ? trc2 trc1 trc0 atc h'ffba tma r/w 8 8 tmaov tmaie ? ? tma3 tma2 tma1 tma0 h'ffbb tca r 8 8 tca7 tca6 tca5 tca4 tca3 tca2 tca1 tca0 timer a h'ffbc wtcsr r/w 8/16 16 ovf wt/ it tme rsts rst/ nmi cks2 cks1 cks0 h'ffbd wtcnt r/w 8/16 16 wdt appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 911 of 1038 rej09b0328-0300 address * register name r/w access bus width 7 6 5 4 3 2 1 0 module name h'ffc0 pdr0 r 8 8 pdr07 pdr06 pdr05 pdr04 pdr03 pdr02 pdr01 pdr00 h'ffc1 pdr1 r/w 8 8 pdr17 pdr16 pdr15 pdr14 pdr13 pdr12 pdr11 pdr10 h'ffc2 pdr2 r/w 8 8 pdr27 pdr26 pdr25 pdr24 pdr23 pdr22 pdr21 pdr20 h'ffc3 pdr3 r/w 8 8 pdr37 pdr36 pdr35 pdr34 pdr33 pdr32 pdr31 pdr30 h'ffc4 pdr4 r/w 8 8 pdr47 pdr46 pdr45 pdr44 pdr43 pdr42 pdr41 pdr40 h'ffc5 pdr5 r/w 8 8 ? ? ? ? pdr53 pdr52 pdr51 pdr50 h'ffc6 pdr6 r/w 8 8 pdr67 pdr66 pdr65 pdr64 pdr63 pdr62 pdr61 pdr60 h'ffc7 pdr7 r/w 8 8 pdr77 pdr76 pdr75 pdr74 pdr73 pdr72 pdr71 pdr70 h'ffc8 pdr8 r/w 8 8 pdr87 pdr86 pdr85 pdr84 pdr83 pdr82 pdr81 pdr80 port data register h'ffcd pmr0 r/w 8 8 pmr07 pmr06 pmr05 pmr04 pmr03 pmr02 pmr01 pmr00 h'ffce pmr1 r/w 8 8 pmr17 pmr16 pmr15 pmr14 pmr13 pmr12 pmr11 pmr10 h'ffcf pmr2 r/w 8 8 pmr27 pmr26 pmr25 ? ? ? ? pmr20 port mode register h'ffd0 pmr3 r/w 8 8 pmr37 pmr36 pmr35 pmr34 pmr33 pmr32 pmr31 pmr30 port mode register h'ffd1 pcr1 w 8 8 pcr17 pcr16 pcr15 pcr14 pcr13 pcr12 pcr11 pcr10 h'ffd2 pcr2 w 8 8 pcr27 pcr26 pcr25 pcr24 pcr23 pcr22 pcr21 pcr20 h'ffd3 pcr3 w 8 8 pcr37 pcr36 pcr35 pcr34 pcr33 pcr32 pcr31 pcr30 h'ffd4 pcr4 w 8 8 pcr47 pcr46 pcr45 pcr44 pcr43 pcr42 pcr41 pcr40 h'ffd5 pcr5 w 8 8 ? ? ? ? pcr53 pcr52 pcr51 pcr50 h'ffd6 pcr6 w 8 8 pcr67 pcr66 pcr65 pcr64 pcr63 pcr62 pcr61 pcr60 h'ffd7 pcr7 w 8 8 pcr77 pcr76 pcr75 pcr74 pcr73 pcr72 pcr71 pcr70 h'ffd8 pcr8 w 8 8 pcr87 pcr86 pcr85 pcr84 pcr83 pcr82 pcr81 pcr380 port control register h'ffdb pmr4 r/w 8 8 ? ? ? ? ? ? ? pmr40 h'ffdc pmr5 r/w 8 8 ? ? ? ? pmr53 pmr52 pmr51 pmr50 h'ffdd pmr6 r/w 8 8 pmr67 pmr66 pmr65 pmr64 pmr63 pmr62 pmr61 pmr60 h'ffde pmr7 r/w 8 8 pmr77 pmr76 pmr75 pmr74 pmr73 pmr72 pmr71 pmr70 h'ffdf pmr8 r/w 8 8 ? ? ? ? pmr83 pmr82 pmr81 pmr80 port mode register h'ffe1 pur1 r/w 8 8 pur17 pur16 pur15 pur14 pur13 pur12 pur11 pur10 h'ffe2 pur2 r/w 8 8 pur27 pur26 pur25 pur24 pur23 pur22 pur21 pur20 h'ffe3 pur3 r/w 8 8 pur37 pur36 pur35 pur34 pur33 pur32 pur31 pur30 port pull-up select register h'ffe4 rtpegr r/w 8 8 ? ? ? ? ? ? rtpegr1 rtpegr0 h'ffe5 rtpsr r/w 8 8 rtpsr7 rtpsr6 rtpsr5 rtpsr4 rtpsr3 rtpsr2 rtpsr1 rtpsr0 rtp trg select h'ffe8 syscr r/w 8 8 ? ? intm1 intm0 xrst nmieg1 nmieg0 ? h'ffe9 m dcr r/w 8 8 ? ? ? ? ? ? ? mds0 h'ffea sbycr r/w 8 8 ssby sts2 sts1 sts0 ? ? sck1 sck0 h'ffeb lpwrcr r/w 8 8 dton lson nesel ? ? ? sa1 sa0 h'ffec mstp crh r/w 8 8 mstp15 mstp14 mstp13 mstp12 mstp11 mstp10 mstp9 mstp8 h'ffed mstpcrl r/w 8 8 mstp7 mstp6 mstp5 mstp4 mstp3 mstp2 mstp1 mstp0 h'ffee stcr r/w 8 8 ? iicx iicrst ? flashe ? ? ? system control register h'fff0 iegr r/w 8 8 ? irq5eg irq4eg irq3eg irq2eg irq1eg irq0eg1 irq0eg0 irq edge h'fff1 ienr r/w 8 8 ? ? irq5e irq4e irq3e irq2e irq1e irq0e irq enable h'fff2 irqr r/w 8 8 ? ? irq5f irq4f irq3f irq2f irq1f irq0f irq status appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 912 of 1038 rej09b0328-0300 address * register name r/w access bus width 7 6 5 4 3 2 1 0 module name h'fff3 icra r/w 8 8 icra7 icra6 i cra5 icra4 icra3 i cra2 icra1 icra0 h'fff4 icrb r/w 8 8 icrb7 icrb6 i crb5 icrb4 icrb3 i crb2 icrb1 icrb0 h'fff5 icrc r/w 8 8 icrc7 icrc6 i crc5 icrc4 icrc3 icrc2 icrc1 icrc0 h'fff6 icrd r/w 8 8 icrd7 icrd6 i crd5 icrd4 icrd3 icrd2 icrd1 icrd0 irq priority control h'fff8 flmcr1 r/w 8 8 fwe swe ? ? ev pv e p h'fff9 flmcr2 r/w 8 8 fler ? ? ? ? ? esu psu h'fffa ebr1 r/w 8 8 ? ? ? ? ? ? eb9 eb8 h'fffb ebr2 r/w 8 8 eb7 eb6 eb5 eb4 eb3 eb2 eb1 eb0 only for flash version. h'fff8 flmcr1 r/w 8 8 fwe swe esu1 psu1 ev1 pv1 e1 p1 h'fff9 flmcr2 r/w 8 8 fler ? esu2 psu2 ev2 pv2 e2 p2 f'fffa ebr1 r/w 8 8 ? ? eb13 eb12 eb11 eb10 eb9 eb8 f'fffb ebr2 r/w 8 8 eb7 eb6 eb5 eb4 eb3 eb2 eb1 eb0 only for flash version in the h8s/2194 c note: * lower 16 bits of the address. appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 913 of 1038 rej09b0328-0300 b.2 function list h'd000: gain constant dgkp: drum digital filter h'd001: gain constant dgkp: drum digital filter h'd002: gain constant dgks: drum digital filter h'd003: gain constant dgks: drum digital filter bit : initial value : le g end: * undetermined r/w : * w 13 * w 14 * w 15 10 32 54 7 * w 6 * w 9 * w 8 * w 11 * w 10 * w * www ww ww 12 * * * * * * h'd004: coefficient dap: drum digital filter h'd005: coefficient dap: drum digital filter h'd006: coefficient dbp: drum digital filter h'd007: coefficient dbp: drum digital filter h'd008: coefficient das: drum digital filter h'd009: coefficient das: drum digital filter h'd00a: coefficient dbs: drum digital filter h'd00b: coefficient dbs: drum digital filter bit : initial value : r/w : * w 13 * w 14 * w 15 10 32 54 7 * w 6 * w 9 * w 8 * w 11 * w 10 * w * www ww ww 12 * * * * * * le g end: * undetermined appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 914 of 1038 rej09b0328-0300 h'd00c: offset dofp: drum digital filter h'd00d: offset dofp: drum digital filter h'd00e: offset dofs: drum digital filter h'd00f: offset dofs: drum digital filter bit : initial value : r/w : * w 13 * w 14 * w 15 10 32 54 7 * w 6 * w 9 * w 8 * w 11 * w 10 * w * www ww ww 12 * * * * * * le g end: * undetermined h'd010: gain constant cgkp: capstan digital filter h'd011: gain constant cgkp: capstan digital filter h'd012: gain constant cgks: capstan digital filter h'd013: gain constant cgks: capstan digital filter bit : initial value : r/w : * w 13 * w 14 * w 15 10 32 54 7 * w 6 * w 9 * w 8 * w 11 * w 10 * w * www ww ww 12 * * * * * * le g end: * undetermined appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 915 of 1038 rej09b0328-0300 h'd014: coefficient cap: capstan digital filter h'd015: coefficient cap: capstan digital filter h'd016: coefficient cbp: capstan digital filter h'd017: coefficient cbp: capstan digital filter h'd018: coefficient cas: capstan digital filter h'd019: coefficient cas: capstan digital filter h'd01a: coefficient cbs: capstan digital filter h'd01b: coefficient cbs: capstan digital filter bit : initial value : r/w : * w 13 * w 14 * w 15 10 32 54 7 * w 6 * w 9 * w 8 * w 11 * w 10 * w * www ww ww 12 * * * * * * le g end: * undetermined h'd01c: offset cofp: capstan digital filter h'd01d: offset cofp: capstan digital filter h'd01e: offset cofs: capstan digital filter h'd01f: offset cofs: capstan digital filter bit : initial value : r/w : * w 13 * w 14 * w 15 10 32 54 7 * w 6 * w 9 * w 8 * w 11 * w 10 * w * www ww ww 12 * * * * * * le g end: * undetermined appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 916 of 1038 rej09b0328-0300 h'd020: delay initialization register dzs: digital filter h'd021: delay initialization register dzs: digital filter h'd022: delay initialization register dzp: digital filter h'd023: delay initialization register dzp: digital filter h'd024: delay initialization register czs: digital filter h'd025: delay initialization register czs: digital filter h'd026: delay initialization register czp: digital filter h'd027: delay initialization register czp: digital filter 13 14 15 10 32 54 7 0 w 6 0 w 9 0 w 8 0 w 11 0 w 10 0 www ww ww 12 0 0 0 0 0 0 1 1 1 1 bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 917 of 1038 rej09b0328-0300 h'd028: drum system digital filter control register dfic: digital filter 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 0 6 0 7 r/w r/w r/(w) dpha r/(w) * drov dzpon dzson dsg2 dsg1 dsg0 1 note: * only 0 can be written. note: * optional drum system range over flag 0 filter computation result does not exceed 12 bits. 1 filter computation result exceeds 12 bits. drum phase system filter computation start bit 0 phase system filter computation is off. phase system computation result y is not added to es. 1 phase system filter computation is on. drum phase system z -1 initialization bit 0 phase system z -1 reflects dzp value. 1 phase system z -1 does not relect dzp value. drum speed system z -1 initialization bit 0 speed system z -1 reflects dzs value. 1 speed system z -1 does not relect dzs value. drum system gain control bit dsg2 dsg1 dsg0 description 0 0 0 1 1 2 1 0 4 1 8 1 0 0 16 1 ( 32) * 1 0 ( 64) * 1 invalid (do not set) bit : initial value : r/w : ? ? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 918 of 1038 rej09b0328-0300 h'd029: capstan system digital filter control register cfic: digital filter 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 0 6 0 7 r/w r/w r/(w) cpha r/(w) * crov czpon czson csg2 csg1 csg0 1 note: * only 0 can be written. capstan system range over flag 0 filter computation result does not exceed 12 bits. 1 filter computation result exceeds 12 bits. capstan phase system filter computation start bit 0 phase system filter computation is off. phase system computation result y is not added to es. 1 phase system filter computation is on. capstan phase system z -1 initialization bit 0 phase system z -1 reflects czp value. 1 phase system z -1 does not relect czp value. capstan speed system z -1 initialization bit 0 speed system z -1 reflects czs value. 1 speed system z -1 does not relect czs value. capstan system gain control bit csg2 csg1 csg0 description 0 0 0 1 1 2 1 0 4 1 8 1 0 0 16 1 ( 32) * 1 0 ( 64) * 1 invalid (do not set) bit : initial value : r/w : ? ? note: * setting optional appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 919 of 1038 rej09b0328-0300 h'd02a: digital filter control register dfucr: digital filter 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 0 6 7 r/w r/w r/w pton cp/dp cfeps dfeps cfess dfess 1 1 phase system computation result pwm output bit 0 output normal filter computation result to pwm pin. 1 output only phase system computation result to pwm pin. pwm output select bit 0 output drum phase system computation result (cappwm) 1 output capstan phase system computation result (drmpwm) drum phase system error data transfer bit 0 transfer data by hsw (nhsw) signal latch. 1 transfer data at the time of error data write. capstan phase system error data transfer bit 0 transfer data by dvcfg2 signal latch. 1 transfer data at the time of error data write. capstan speed system error data transfer bit 0 transfer data by dvcfg signal latch. 1 transfer data at the time of error data write. drum speed system error data transfer bit 0 transfer data by ncdfg signal latch. 1 transfer data at the time of error data write. bit : initial value : r/w : ? ? ? ? h'd030: specified dfg speed preset data register dfpr: drum error detector h'd031: specified dfg speed preset data register dfpr: drum error detector 0 w 13 0 w 14 0 w 15 10 32 54 7 0 w 6 0 w 9 0 w 8 0 w 11 0 w 10 0 w 0 www ww ww 12 0 0 0 0 0 0 bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 920 of 1038 rej09b0328-0300 h'd032: dfg speed error data register dfer: drum error detector h'd033: dfg speed error data register dfer: drum error detector 0 r * /w 13 0 r * /w 14 0 r * /w 15 10 32 54 7 0 r * /w 6 0 r * /w 9 0 r * /w 8 0 r * /w 11 0 r * /w 10 0 r * /w 0 r * /w r * /w r * /w r * /w r * /w r * /w r * /w 12 0 0 0 0 0 0 bit : initial value : r/w : note: * note that only detected error data can be read. h'd034: dfg lock upper data register dfrudr: drum error detector h'd035: dfg lock upper data register dfrudr: drum error detector 1 w 13 1 w 14 0 w 15 10 32 54 7 1 w 6 1 w 9 1 w 8 1 w 11 1 w 10 1 w 1 www ww ww 12 1 1 1 1 1 1 bit : initial value : r/w : h'd036: dfg lock lower data register dfrldr: drum error detector h'd037: dfg lock lower data register dfrldr: drum error detector 0 w 13 0 w 14 1 w 15 10 32 54 7 0 w 6 0 w 9 0 w 8 0 w 11 0 w 10 0 w 0 www ww ww 12 0 0 0 0 0 0 bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 921 of 1038 rej09b0328-0300 h'd038: drum speed error detection contro l register dfvcr: drum error detector 0 0 1 0 (r)/w * 2 2 0 r/w 3 0 4 0 r/w 0 r/(w) * 1 5 6 0 7 dfrfon df-r/unr dpcnt dfrcs1 dfrcs0 0 r/w dfcs1 (r)/w * 2 r r/w dfcs0 dfovf notes: clock source select bit dfcs1 dfcs0 0 0 s 1 s/2 1 0 s/4 1 s/8 counter overflow flag 0 normal status 1 counter overflows. error data limit function select bit 0 limit function off 1 limit function on drum lock flag 0 drum speed system is not locked. 1 drum speed system is locked. drum phase system filter computation auto start bit 0 filter computation by drum lock detection is not excuted. 1 filter computation of phase system is executed at the time of drum lock detection. drum lock counter setting bit dfrcs1 dfrcs0 description 0 0 underflow by 1 lock detection 1 underflow by 2 lock detections 1 0 underflow by 3 lock detections 1 underflow by 4 lock detections description bit : initial value : r/w : 1. only 0 can be written. 2. when read, counter value is read. appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 922 of 1038 rej09b0328-0300 h'd039: drum phase error detection control register dpgcr: drum error detector 0 1 1 2 1 3 0 4 0 r/w 5 0 6 0 7 r/w r/(w) * dpovf r/w dpcs0 0 r/w dpcs1 n/v hswes 1 note: * only 0 can be written. error data latch signal select bit 0 hsw (videoff) signal 1 nhsw (narrowff) signal edge select bit 0 latch at rising edge 1 latch at falling edge bit : initial value : r/w : clock source select bit dpcs1 dpcs0 0 0 s 1 s/2 1 0 s/3 1 s/4 counter overflow flag 0 normal status 1 counter overflows. description ??? ??? h'd03a: specified drum phase preset data register 2 dppr2: drum error detector 0 w 13 0 w 14 0 w 15 10 32 54 7 0 w 6 0 w 9 0 w 8 0 w 11 0 w 10 0 w 0 www ww ww 12 0 0 0 0 0 0 bit : initial value : r/w : h'd03c: specified drum phase preset data register 1 dppr1: drum error detector 0 0 1 0 w 2 0 w 3 0 4 1 5 1 6 1 7 w w 1 bit : initial value : r/w : ???? ???? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 923 of 1038 rej09b0328-0300 h'd03d: drum phase error data register 1 dper1: drum error detector 0 0 1 0 r * /w 2 0 r * /w 3 0 4 1 5 1 6 1 7 r * /w r * /w 1 bit : initial value : r/w : ?? ? ? ?? ? ? note: * note that only detected error data can be read. h'd03e: drum phase error data regist er 2 dper2: drum error detector 0 r * /w 13 0 r * /w 14 0 r * /w 15 10 32 54 7 0 r * /w 6 0 r * /w 9 0 r * /w 8 0 r * /w 11 0 r * /w 10 0 r * /w 0 r * /w r * /w r * /w r * /w r * /w r * /w r * /w 12 0 0 0 0 0 0 bit : initial value : r/w : note: * note that only detected error data can be read. h'd050: specified cfg speed preset data register cfpr: capstan error detector 0 w 13 0 w 14 0 w 15 10 32 54 7 0 w 6 0 w 9 0 w 8 0 w 11 0 w 10 0 w 0 www ww ww 12 0 0 0 0 0 0 bit : initial value : r/w : h'd052: cfg speed error data register cfer: capstan error detector 0 r * /w 13 0 r * /w 14 0 r * /w 15 10 32 54 7 0 r * /w 6 0 r * /w 9 0 r * /w 8 0 r * /w 11 0 r * /w 10 0 r * /w 0 r * /w r * /w r * /w r * /w r * /w r * /w r * /w 12 0 0 0 0 0 0 bit : initial value : r/w : note: * note that only detected error data can be read. h'd054: cfg lock upper data regist er cfrudr: capstan error detector 1 w 13 1 w 14 0 w 15 10 32 54 7 1 w 6 1 w 9 1 w 8 1 w 11 1 w 10 1 w 1 www ww ww 12 1 1 1 1 1 1 bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 924 of 1038 rej09b0328-0300 h'd056: cfg lock lower data register cfrldr: capstan error detector 0 w 13 0 w 14 1 w 15 10 32 54 7 0 w 6 0 w 9 0 w 8 0 w 11 0 w 10 0 w 0 www ww ww 12 0 0 0 0 0 0 bit : initial value : r/w : h'd058: capstan speed error detection control register cfvcr: capstan error detector 0 0 1 0 (r)/w * 2 2 0 r/w 3 0 4 0 r/w 0 r/(w) * 1 5 6 0 7 cfrfon cf-r/unr cpcnt cfrcs1 cfrcs0 0 r/w cfcs1 (r)/w * 2 r r/w cfcs0 cfovf notes: capstan phase system filter computation auto start bit 0 filter computation by capstan lock detection is not excuted. 1 filter computation of phase system is executed at the time of drum lock detection. bit : initial value : r/w : capstan lock counter setting bit cfrcs1 cfrcs0 description 0 0 underflow by 1 lock detection 1 underflow by 2 lock detections 1 0 underflow by 3 lock detections 1 underflow by 4 lock detections clock source select bit cfcs1 cfcs0 0 0 s 1 s/2 1 0 s/4 1 s/8 counter overflow flag 0 normal status 1 counter overflows. error data limit function select bit 0 limit function off 1 limit function on capstan lock flag 0 capstan speed system is not locked. 1 capstan speed system is locked. description 1. only 0 can be written. 2. when read, counter value is read. appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 925 of 1038 rej09b0328-0300 h'd059: capstan phase error detection control register cpgcr: capstan error detector 0 1 1 2 1 3 0 4 0 r/w 5 0 6 0 7 r/w r/(w) * cpovf r/w cpcs0 0 r/w cpcs1 cr/rf selcfg2 1 note: * only 0 can be written. preset signal select bit 0 preset by ref30p signal 1 preset by crrf signal preset, latch signal select bit 0 preset by capref30 signal and latch by dvctl signal 1 preset by ref30p signal and latch by dvcfg2 signal bit : initial value : r/w : clock source select bit cpcs1 cpcs0 0 0 s 1 s/2 1 0 s/4 1 s/8 counter overflow flag 0 normal status 1 counter overflows. description ??? ??? h'd05a: specified capstan phas e preset data register 2 c ppr2: capstan error detector 0 w 13 0 w 14 0 w 15 10 32 54 7 0 w 6 0 w 9 0 w 8 0 w 11 0 w 10 0 w 0 www ww ww 12 0 0 0 0 0 0 bit : initial value : r/w : h'd05c: specified capstan phas e preset data register 1 c ppr1: capstan error detector 0 0 1 0 w 2 0 w 3 0 4 1 5 1 6 1 7 w w 1 bit : initial value : r/w : ???? ???? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 926 of 1038 rej09b0328-0300 h'd05d: capstan phase error data regist er 1 cper1: capstan error detector 0 0 1 0 r * /w 2 0 r * /w 3 0 4 1 5 1 6 1 7 r * /w r * /w 1 bit : initial value : r/w : ?? ?? ?? ?? note: * note that only detected error data can be read. h'd05e: capstan phase error data regist er 2 cper2: capstan error detector 0 r * /w 13 0 r * /w 14 0 r * /w 15 10 32 54 7 0 r * /w 6 0 r * /w 9 0 r * /w 8 0 r * /w 11 0 r * /w 10 0 r * /w 0 r * /w r * /w r * /w r * /w r * /w r * /w r * /w 12 0 0 0 0 0 0 bit : initial value : r/w : note: * note that only detected error data can be read. appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 927 of 1038 rej09b0328-0300 h'd060: hsw mode register 1 hsm1: hsw timing generator 0 0 1 0 r/w 2 0 r/(w) * 3 0 4 1 r 1 r 5 6 0 7 empa ovwb ovwa clrb clra 0 r flb r/w r/(w) * r fla empb note: * only 0 can be written. fifo2 full flag 0 fifo2 is not full 1 fifo2 is full fifo1 full flag 0 fifo1 is not full 1 fifo1 is full fifo2 empty flag 0 data remains in fifo2 1 fifo2 is empty fifo1 empty flag 0 data remains in fifo1 1 fifo1 is empty fifo2 overwrite flag 0 normal operation 1 data is written to fifo2 while it is full. write 0 to clear the flag. fifo1 overwrite flag 0 normal operation 1 data is written to fifo1 while it is full. write 0 to clear the flag. fifo2 pointer clear 0 normal operation 1 clear fifo2 pointer fifo1 pointer clear 0 normal operation 1 clear fifo1 pointer bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 928 of 1038 rej09b0328-0300 h'd061: hsw mode register 2 hsm2: hsw timing generator 0 0 1 0 r 2 0 r/w 3 0 4 0 r/w 0 r/w 5 6 0 7 edg isel1 sofg ofg vff/nff 0 r/w frt r/w r/w r/w fgr20ff lop free-run bit 0 5-bit dfg counter and 16-bit timer 1 16-bit frc frg2 clear stop bit 0 16-bit counter clear by dfg reference register 2 is enabled 1 16-bit counter clear by dfg reference register 2 is disabled mode select bit 0 signal mode 1 loop mode dfg edge select bit 0 calculated by dfg rising edge 1 calculated by dfg falling edge interrupt select bit 0 interrupt request is generated by rising of fifo strig signal 1 interrupt request is generated by fifo match signal fifo output group select bit 0 20-level output by fifo1 and fifo2 1 10-level output by fifo1 only output fifo group flag 0 outputting pattern by fifo1 1 outputting pattern by fifo2 videoff/narrowff output switchover bit 0 videoff output 1 narrowff output bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 929 of 1038 rej09b0328-0300 h'd062: hsw loop stage setting register hslp: hsw timing generator 0 * 1 * r/w 2 * r/w 3 * 4 * r/w 5 * 6 * 7 r/w r/w r/w lob1 r/w lob2 * r/w lob3 lob0 loa3 loa2 loa1 loa0 fifo1 stage setting bit hsm2 hslp description bit 5 bit 3 bit 2 bit 1 bit 0 lop loa3 loa2 loa1 loa0 0 * * * * single mode 1 0 0 0 0 output stage 0 of fifo1 1 output stage 0 and 1 of fifo1 1 0 output stage 0 to 2 of fifo1 1 output stage 0 to 3 of fifo1 1 0 0 output stage 0 to 4 of fifo1 1 output stage 0 to 5 of fifo1 1 0 output stage 0 to 6 of fifo1 1 output stage 0 to 7 of fifo1 1 0 0 0 output stage 0 to 8 of fifo1 1 output stage 0 to 9 of fifo1 1 0 setting disabled 1 1 0 0 1 1 0 1 legend: * don't care. fifo2 stage setting bit hsm2 hslp description bit 5 bit 7 bit 6 bit 5 bit 4 lop lob3 lob2 lob1 lob0 0 * * * * single mode 1 0 0 0 0 output stage 0 of fifo2 1 output stage 0 and 1 of fifo2 1 0 output stage 0 to 2 of fifo2 1 output stage 0 to 3 of fifo2 1 0 0 output stage 0 to 4 of fifo2 1 output stage 0 to 5 of fifo2 1 0 output stage 0 to 6 of fifo2 1 output stage 0 to 7 of fifo2 1 0 0 0 output stage 0 to 8 of fifo2 1 output stage 0 to 9 of fifo2 1 0 setting disabled 1 1 0 0 1 1 0 1 legend: * don't care. bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 930 of 1038 rej09b0328-0300 h'd064: fifo output pattern register 1 fpdra: hsw timing generator 8 * 9 * w 10 * w 11 * 12 * w * w 13 14 * 15 narrowffa vffa affa vpulsea mlevela 1 w w w adtrga striga 0 * 1 * w 2 * w 3 * 4 * w * w 5 6 * 7 ppga4 ppga3 ppga2 ppga1 ppga0 * w ppga7 w w w ppga6 ppga5 bit : initial value : r/w : bit : initial value : r/w : ? ? legend: * undetermined h'd066: fifo timing pattern register 1 ftpra: hsw timing generator bit : initial value : r/w : 1 * w ftpra 1 0 * w ftpra 0 3 * w ftpra 3 2 * w ftpra 2 5 * w ftpra 5 4 * w ftpra 4 7 * w ftpra 7 6 * w ftpra 6 9 * w ftpra 9 8 * w ftpra 8 11 * w ftpra11 10 * w ftpra10 ftpra13 ftpra12 ftpra15 ftpra14 12 * 13 * 14 * 15 * wwww legend: * undetermined h'd066: fifo timer capture register 1 ftctr: hsw timing generator bit : initial value : r/w : 1 0 r ftctr 1 0 0 r ftctr 0 3 0 r ftctr 3 2 0 r ftctr 2 5 0 r ftctr 5 4 0 r ftctr 4 7 0 r ftctr 7 6 0 r ftctr 6 9 0 r ftctr 9 8 0 r ftctr 8 11 0 r ftctr11 10 0 r ftctr10 ftctr13 ftctr12 ftctr15 ftctr14 12 0 13 0 14 0 15 0 rrrr h'd068: fifo output pattern register 2 fpdrb: hsw timing generator 8 * 9 * w 10 * w 11 * 12 * w * w 13 14 * 15 narrowffb vffb affb vpulseb mlevelb 1 w w w adtrgb strigb 0 * 1 * w 2 * w 3 * 4 * w * w 5 6 * 7 ppgb4 ppgb3 ppgb2 ppgb1 ppgb0 * w ppgb7 w w w ppgb6 ppgb5 bit : initial value : r/w : bit : initial value : r/w : ? ? note: * undetermined appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 931 of 1038 rej09b0328-0300 h'd06a: fifo timing pattern regist er 2 ftprb: hsw timing generator 1 ftprb 1 0 ftprb 0 3 ftprb 3 2 ftprb 2 5 ftprb 5 4 ftprb 4 7 ftprb 7 6 ftprb 6 9 ftprb 9 8 ftprb 8 11 ftprb11 10 ftprb10 ftprb13 ftprb12 ftprb15 ftprb14 12 13 14 15 bit : initial value : r/w : * w * w * w * w * w * w * w * w * w * w * w * w * * * * wwww note: * undetermined h'd06c: dfg reference register 1 dfcra: hsw timing generator 0 * 1 * w 2 * w 3 * 4 * w 0 w 5 6 0 7 dfcra4 dfcra3 dfcra2 dfcra1 dfcra0 0 w isel2 w w w cclr cksl interrupt select bit 0 interrupt request is generated by clear signal of 16-bit timer counter 1 interrupt request is generated by vd signal in pb mode dfg counter clear bit 0 normal operation 1 clear 5-bit dfg counter 16-bit counter clock source select bit 0 s/4 1 s/8 bit : initial value : r/w : h'd06c: dfg reference count register dfctr: hsw timing generator 0 0 1 0 r 2 0 r 3 0 4 0 r 5 6 1 7 dfctr4 dfctr3 dfctr2 dfctr1 dfctr0 r r 11 bit : initial value : r/w : ??? ??? h'd06d: dfg reference register 2 dfcrb: hsw timing generator 0 * 1 * w 2 * w 3 * 4 * w 5 6 1 7 dfcrb4 dfcrb3 dfcrb2 dfcrb1 dfcrb0 w w 11 bit : initial value : r/w : ??? ?? ? note: * undetermined appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 932 of 1038 rej09b0328-0300 h'd06e: special effect pl ayback control register chcr: 4-head special effect playback circuit 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 6 0 7 hah sig3 sig2 sig1 sig0 0 w v/n w w w hswpol crh hsw output signal select bit 0 videoff signal output 1 narrow ff signal output comp polarity select bit 0 positive 1 negative c.rotary synchronization control bit 0 synchronous 1 asynchronous h.ampsw synchronization control bit 0 synchronous 1 asynchronous signal control bits sig3 sig2 sig1 sig0 output pin c.rotary h.amp sw 0 0 * * l l 1 0 0 hsw l 1 hsw h 1 0 l hsw 1 h hsw 1 0 0 * hsw ex-or comp comp 1 hsw ex-nor comp comp 1 0 hsw ex-or rtp0 rtp0 1 hsw ex-nor rtp0 rtp0 note: * don't care. bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 933 of 1038 rej09b0328-0300 h'd06f: additional v control register addvr: additional v signal generator 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 1 6 7 r/w r/w hmsk hi-z cut vpon pol 11 legend : * don't care. osch mask bit 0 osch added 1 osch not added high impedance bit 0 3-level output from vpulse pin 1 vpulse pin is set as 3-state (h/l/hi-z) pin additional v output control bits cut vpon pol description 0 0 * low level 1 0 negative polarity (figure 28.46) 1 positive polarity (figure 28.45) 1 * 0 immediate level (high-impedance when hi-z bit = 1) 1 high level bit : initial value : r/w : ??? ??? h'd070: x-value data regist er xdr: x-value, trk-value 1 13 1 14 1 15 10 32 54 7 0 w 6 0 w 9 0 w 8 0 w 11 0 w 10 0 w 1 ww ww ww 12 xd1 xd0 xd3 xd2 xd5 xd4 xd7 xd6 xd9 xd8 xd11 xd10 0 0 0 0 0 0 bit : initial value : r/w : ???? ???? h'd072: trk-value data regist er trdr: x-value, trk-value 1 13 1 14 1 15 10 32 54 7 0 w 6 0 w 9 0 w 8 0 w 11 0 w 10 0 w 1 ww ww ww 12 trd1 trd0 trd3 trd2 trd5 trd4 trd7 trd6 trd9 trd8 trd11 trd10 0 0 0 0 0 0 bit : initial value : r/w : ???? ???? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 934 of 1038 rej09b0328-0300 h'd074: x-value/trk-value control register xtcr: x-value, trk-value adjustment circuit 0 0 1 0 r/w 2 0 w 3 0 4 0 w 5 0 6 0 7 r/w w w at/mu w caprf trk/x exc/ref xcs dvref1 dvref0 1 capstan phase adjustment auto/manual select bit 0 manual mode 1 auto mode external sync signal edge select bit 0 generated at excap rising edge 1 generated at excap rising and falling edge capstan phase adjustment register select bit 0 capref30 is generated only by xdr setting value 1 capref30 is generated by xdr and trdr setting values reference signal select bit 0 generated by ref30p signal 1 generated by external referece signal clock source select bit 0 s 1 s/2 ref30p frequency division rate select bit dvref1 dvref0 description 0 0 1-division 1 2-division 1 0 3-division 1 4-division bit : initial value : r/w : ? ? h'd078: drum 12-bit pwm data register dpwdr: drum 12-bit pwm 1 0 r/w dpwdr1 0 0 r/w dpwdr0 3 0 r/w dpwdr3 2 0 r/w dpwdr2 5 0 r/w dpwdr5 4 0 r/w dpwdr4 7 0 r/w dpwdr7 6 0 r/w dpwdr6 9 0 r/w dpwdr9 8 0 r/w dpwdr8 11 0 r/w dpwdr11 10 0 r/w dpwdr10 12 1 13 1 14 1 15 1 bit : initial value : r/w : ???? ???? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 935 of 1038 rej09b0328-0300 h'd07a: drum 12-bit pwm control registor dpwcr: drum 12-bit pwm 0 0 1 1 w 2 0 w 3 0 4 0 w 0 w 5 6 1 7 dh/l dsf/df dck2 dck1 dck0 0 w dpol w w w ddc dhiz positive polarity negative polarity output 0 1 polarity switchover bit fixed output bit, pwm pin output bit 0 1 0 low level output from pwm pin hi-z h/l dc fixed output bit, pwm pin output bit 1 high level output form pwm pin 1 0 * high impedance from pwm pin ** pwm modulated signal output legend: * don't care. modulate error data from digital filter circuit modulate data written in data register 0 1 output data select bit note: when pwms output data from the digital filter circuit, the data consisting of the speed and phase filtering results are modulated by pwms and output from the cappwm and drmpwm pins. however, it is possible to output only drum phase filter results from cappwm pin and only capstan phase filter result from drmpwm pin, by dfucr settings of the digital filter circuit. see the section explaining the digital filter computation circuit. carrier frequency select bits carrier frequency select bits 0 00 /2 ck1 ck0 ck2 1 /4 10 /8 1 /16 0 10 /32 1 /64 10 /128 1 (do not set) bit : initial value : r/w : h'd07b: capstan 12-bit pwm control register cpwcr: capstan 12-bit pwm 0 0 1 1 w 2 0 w 3 0 4 0 w 0 w 5 6 1 7 ch/l csf/df cck2 cck1 cck0 0 w cpol w w w cdc chiz bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 936 of 1038 rej09b0328-0300 h'd07c: capstan 12-bit pwm data register cpwdr: capstan 12-bit pwm 1 0 r/w cpwdr1 0 0 r/w cpwdr0 3 0 r/w cpwdr3 2 0 r/w cpwdr2 5 0 r/w cpwdr5 4 0 r/w cpwdr4 7 0 r/w cpwdr7 6 0 r/w cpwdr6 9 0 r/w cpwdr9 8 0 r/w cpwdr8 11 0 r/w cpwdr11 10 0 r/w cpwdr10 12 1 13 1 14 1 15 1 bit : initial value : r/w : ???? ???? h'd080: ctl control register ctcr: ctl circuit 0 0 1 0 r 2 0 w 3 0 4 1 w 5 1 6 0 7 w w w fslb w fslc 0 w nt/pl fsla ccs lctl unctl slwm ntsc/pal select bit 0 ntsc mode (frame rate: 30 hz) 1 pal mode (frame rate: 25 hz) long ctl bit 0 clock source (ccs) operates at the setting value 1 clock source (ccs) operates for further 8-division after operating at the setting value ctl undetected bit 0 detected 1 undetected mode select bit 0 normal mode 1 slow mode clock source select bit 0 s 1 s/2 operating frequency select bits fslc fslb fsla description 0 0 0 reserved (do not set) 1 reserved (do not set) 1 0 fosc = 8 mhz 1 fosc = 10 mhz (initial value) 1 * * reserved (do not set) legend : * don't care. bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 937 of 1038 rej09b0328-0300 h'd081: ctl mode register ctlm: ctl circuit 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 0 6 0 7 r/w r/w r/w fw/rv r/w rec/ pb 0 r/w asm md4 md3 md2 md1 md0 record/playback mode bits asm rec/ pb description 0 0 playback mode (playback) 1 record mode (record) 1 0 assemble mode 1 invalid (do not set) direction bit 0 forward 1 reverse ctl mode select bits bit : initial value : r/w : h'd082: rec-ctl duty data register 1 rcdr1: ctl circuit 1111 13 14 15 10 32 54 76 98 11 10 cmt11 w 12 0 cmt10 w 0 cmt13 w 0 cmt12 w 0 cmt15 w 0 cmt14 w 0 cmt17 w 0 cmt16 w 0 cmt19 w 0 cmt18 w 0 cmt1b w 0 cmt1a w 0 bit : initial value : r/w : ???? ???? h'd084: rec-ctl duty data register 2 rcdr2: ctl circuit 1111 13 14 15 10 32 54 76 98 11 10 cmt21 w 12 0 cmt20 w 0 cmt23 w 0 cmt22 w 0 cmt25 w 0 cmt24 w 0 cmt27 w 0 cmt26 w 0 cmt29 w 0 cmt28 w 0 cmt2b w 0 cmt2a w 0 bit : initial value : r/w : ???? ???? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 938 of 1038 rej09b0328-0300 h'd086: rec-ctl duty data register 3 rcdr3: ctl circuit 1111 13 14 15 10 32 54 76 98 11 10 cmt31 w 12 0 cmt30 w 0 cmt33 w 0 cmt32 w 0 cmt35 w 0 cmt34 w 0 cmt37 w 0 cmt36 w 0 cmt39 w 0 cmt38 w 0 cmt3b w 0 cmt3a w 0 bit : initial value : r/w : ???? ???? h'd088: rec-ctl duty data register 4 rcdr4: ctl circuit 1111 13 14 15 10 32 54 76 98 11 10 cmt41 w 12 0 cmt40 w 0 cmt43 w 0 cmt42 w 0 cmt45 w 0 cmt44 w 0 cmt47 w 0 cmt46 w 0 cmt49 w 0 cmt48 w 0 cmt4b w 0 cmt4a w 0 bit : initial value : r/w : ???? ???? h'd08a: rec-ctl duty data register 5 rcdr5: ctl circuit 1111 13 14 15 10 32 54 76 98 11 10 cmt51 w 12 0 cmt50 w 0 cmt53 w 0 cmt52 w 0 cmt55 w 0 cmt54 w 0 cmt57 w 0 cmt56 w 0 cmt59 w 0 cmt58 w 0 cmt5b w 0 cmt5a w 0 bit : initial value : r/w : ???? ???? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 939 of 1038 rej09b0328-0300 h'd08c: duty i/o regist er di/o: ctl circuit 0 1 1 0 r/(w) * 2 0 w 3 0 4 5 1 6 7 r/w w w vctr0 1 w vctr1 1 w vctr2 bpon bps bpf di/o 1 note: * only 0 can be written. bit pattern detection on/off bit 0 bit pattern detection off 1 bit pattern detection on bit pattern detection start bit 0 normal status 1 starts 8-bit bit pattern detection duty i/o register bit pattern detection flag 0 bit pattern (8-bit) is not detected 1 bit pattern (8-bit) is detected vctr2 vctr1 vctr0 number of 1-pulse for detection 0 0 0 2 1 4 (sync mark) 1 0 6 1 8 (mark a, short) 1 0 0 12 (mark a, long) 1 16 1 0 24 (mark b) 1 32 viss interrupt setting bits bit : initial value : r/w : ? ? h'd08d: bit pattern register btpr: ctl circuit 0 1 1 1 r * /w 2 1 r * /w 3 1 4 5 1 6 7 r * /w r * /w r * /w lsp5 1 r * /w lsp4 1 r * /w lsp6 1 r * /w lsp7 lsp3 lsp2 lsp1 lsp0 note: * writes are disabled during bit pattern detection. bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 940 of 1038 rej09b0328-0300 h'd090: reference frequency register 1 rfd: reference signal generator 15 1 ref15 w 14 1 ref14 w 13 1 ref13 w 12 1 ref12 w 11 1 ref11 w 10 1 ref10 w 9 1 ref9 w 8 1 ref8 w 7 1 ref7 w 6 1 ref6 w 5 1 ref5 w 4 1 ref4 w 3 1 ref3 w 2 1 ref2 w 1 1 ref1 w 0 1 ref0 w bit : initial value : r/w : h'd092: reference frequency register 2 crf: reference signal generator 15 1 crf15 w 14 1 crf14 w 13 1 crf13 w 12 1 crf12 w 11 1 crf11 w 10 1 crf10 w 9 1 crf9 w 8 1 crf8 w 7 1 crf7 w 6 1 crf6 w 5 1 crf5 w 4 1 crf4 w 3 1 crf3 w 2 1 crf2 w 1 1 crf1 w 0 1 crf0 w bit : initial value : r/w : h'd094: ref30 counter register rfc: reference signal generator 15 0 rfc15 14 0 rfc14 13 0 rfc13 12 0 rfc12 11 0 rfc11 10 0 rfc10 9 0 rfc9 8 0 rfc8 7 0 rfc7 6 0 rfc6 5 0 rfc5 4 0 rfc4 3 0 rfc3 2 0 rfc2 1 0 rfc1 0 0 rfc0 r/w r/w r/w r/w 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 : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 941 of 1038 rej09b0328-0300 h'd096: reference frequency mode register rfm: reference signal generator 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 6 0 7 rex crd od/ev vst veg 0 w rcs w w w vna cvs clock source select bit 0 s/2 1 s/4 mode select bit 0 manual mode 1 auto mode manual select bit 0 vd sync 1 free-run external signal synchronization select bit 0 vd signal or free-run 1 external signal sync dvcfg2 synchronization select bit 0 at mode switching 1 dvcfg2 signal synchronized odd/even edge switchoverselect bit 0 generated at field signal rising (even) 1 generated at field signal rising (odd) videoff counter set 0 videoff signal turns counter set off 1 videoff signal turns counter set on videoff edge select bit 0 set at videoff signal rising 1 set at videoff signal falling bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 942 of 1038 rej09b0328-0300 h'd097: reference frequency mode register 2 rfm2: reference signal generator 0 0 1 1 2 1 3 1 4 1 5 6 7 fds 1 11 r/w field select bit 0 generated by selected odd or even vd signal 1 generated by vd signal immediately after mode transition tbc select bit 0 reference signal is generated with vd 1 reference signal is generated in free-run bit : initial value : r/w : (tbc) * ?????? (r/w) * ?????? note: * the tbc bit is readable/writable only in the h8s/2194c group. this bit cannot be modified in the h8s/2194 group, and the reference signal is therefore generated in free-run. h'd098: dvctl control register ctvc: frequency divider 0 * 1 * r 2 * r 3 4 5 6 7 r cfg hsw 0 w 0 w cex ceg ctl 1 11 dvctl signal generation select bit 0 generated by pb-ctl signal 1 generated by external input signal external sync signal edge select bit 0 rising edge 1 falling edge cfg flag 0 cfg level is low 1 cfg level is high hsw flag 0 hsw level is low 1 hsw level is high ctl flag 0 rec or pb-ctl level is low 1 rec or pb-ctl level is high bit : initial value : r/w : ??? ??? note: * undetermined appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 943 of 1038 rej09b0328-0300 h'd099: ctl frequency division register ctlr: frequency divider 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 6 0 7 ctl4 ctl3 ctl2 ctl1 ctl0 0 w ctl7 w w w ctl6 ctl5 bit : initial value : r/w : h'd09a: dvcfg control register cdvc: frequency divider 0 0 1 0 w 2 0 w 3 4 0 w 5 1 6 1 7 w r cmk cmn w dvtrg 0 r/w * mcgin crf cps1 cps0 0 note: * only 0 can be written mask cfg flag 0 cfg normal operation 1 dvcfg is detected while mask is set (race detection) cfg mask status bit 0 mask is released by capstan mask timer 1 mask is set by capstan mask timer cfg mask select bit 0 capstan mask timing function on 1 capstan mask timing function off pb (asm)-to-rec transition timing sync on/off select bit 0 pb (asm)-to-rec transition timing sync on 1 pb (asm)-to-rec transition timing sync off cfg frequency division edge select bit 0 execute frequency division operation at cfg rising edge 1 execute frequency division operation at cfg rising and falling edges cfg mask timer clock select bit cps1 cps0 description 0 0 s/1024 1 s/512 1 0 s/256 1 s/128 bit : initial value : r/w : ? ? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 944 of 1038 rej09b0328-0300 h'd09b: cfg frequency division register 1 cdivr1: frequency divider 0 0 1 0 w 2 0 w 3 4 0 w 5 0 6 7 w w cdv15 cdv14 0 w cdv16 0 w cdv13 cdv12 cdv11 cdv10 1 bit : initial value : r/w : ? ? h'd09c: cfg frequency division register 2 cdivr2: frequency divider 0 0 1 0 w 2 0 w 3 4 0 w 5 0 6 7 w w cdv25 cdv24 0 w cdv26 0 w cdv23 cdv22 cdv21 cdv20 1 bit : initial value : r/w : ? ? h'd09d: dvcfg mask interval register ctmr: frequency divider 0 1 1 1 w 2 1 w 3 4 1 w 5 1 6 7 w w cpm5 cpm4 1 w cpm3 cpm2 cpm1 cpm0 11 bit : initial value : r/w : ?? ?? h'd09e: fg control register fgcr: frequency divider 0 0 1 1 2 1 3 1 4 1 5 1 6 1 7 w drf 1 dfg edge select bit 0 ncdfg signal rising edge is selected 1 ncdfg signal falling edge is selected bit : initial value : r/w : ?????? ? ?????? ? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 945 of 1038 rej09b0328-0300 h'd0a0: servo port mode re gister spmr: servo port 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 6 7 exctlon dpgsw comp h.amp.sw c.rot 0 r/w ctlstop r/w r/w cfgcomp 1 cfg input method switch bit 0 zero cross type comparator method for cfg signal input 1 digital signal input method for cfg signal input ctlstop bit 0 ctl circuit operates 1 ctl circuit does not operate exctl pin function switch bit 0 exctl/ps4 pin functions as excel input pin 1 exctl/ps4 pin functions as ps4 i/o pin comp pin function switch bit 0 comp/ps2 pin functions as comp input pin 1 comp/ps2 pin functions as ps2 i/o pin h.ampsw pin function switch bit 0 h.ampsw/ps1 pin functions as h.ampsw output pin 1 h.ampsw/ps1 pin functions as ps1 i/o pin c.rotary pin function switch bit 0 c.rotary/ps0 pin functions as c.rotary output pin 1 c.rotary/ps0 pin functions as ps0 i/o pin dpg pin functionswitch bit 0 separate input for drum control system input (dpg/ps3 pin functions as dpg input pin) 1 weight input for drum control system input (dpg/ps3 pin functions as ps3 i/o pin) bit : initial value : r/w : ? ? h'd0a1: servo control register spcr: servo port 0 0 1 0 w 2 0 w 3 0 4 0 w 5 6 7 spcr4 spcr3 spcr2 spcr1 spcr0 w w 11 1 spcrn description 0 psn pin functions as input pin 1 psn pin functions as output pin bit : initial value : r/w : ??? ??? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 946 of 1038 rej09b0328-0300 h'd0a2: servo data register spdr: servo port controller 0 0 1 0 2 0 3 0 4 0 5 6 7 spdr4 spdr3 spdr2 spdr1 spdr0 11 1 r/w r/w r/w r/w r/w bit : initial value : r/w : ??? ??? h'd0a3: servo monitor control register svmcr: servo port 0 0 1 0 2 0 3 0 4 0 5 6 7 svmcr4 svmcr3 svmcr2 svmcr1 svmcr0 1 1 r/w r/w r/w 0 svmcr5 r/w r/w r/w svmcr5 svmcr4 svmcr3 description 0 0 0 ref30 signal is output from sv2 output pin 1 capref30 signal is output from sv2 output pin 1 0 cref signal is output from sv2 output pin 1 ctlmoni signal is output from sv2 output pin 1 0 0 dvcfg signal is output from sv2 output pin 1 cfg signal is output from sv2 output pin 1 0 dfg signal is output from sv2 output pin 1 dpg signal is output from sv2 output pin svmcr2 svmcr1 svmcr0 description 0 0 0 ref30 signal is output from sv1 output pin 1 capref30 signal is output from sv1 output pin 1 0 cref signal is output from sv1 output pin 1 ctlmoni signal is output from sv1 output pin 1 0 0 dvcfg signal is output from sv1 output pin 1 cfg signal is output from sv1 output pin 1 0 dfg signal is output from sv1 output pin 1 dpg signal is output from sv1 output pin bit : initial value : r/w : ?? ?? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 947 of 1038 rej09b0328-0300 h'd0a4: ctl gain control register ctlgr: servo port 0 0 1 0 2 0 3 0 4 0 5 6 7 ctlfb ctlgr3 ctlgr2 ctlgr1 ctlgr0 1 1 r/w r/w r/w 0 ctle/a r/w r/w r/w ctl select bit 0 amp output 1 exctl ctl amp feedback sw bit 0 ctlfb sw is off 1 ctlfb sw is on ctl amp gain setting bit ctlgr3 ctlgr2 ctlgr1 ctlgr0 ctl outpu gain 0 0 0 0 34.0 db 1 36.5 db 1 0 39.0 db 1 41.5 db 1 0 0 44.0 db 1 46.5 db 1 0 49.0 db 1 51.5 db 1 0 0 0 54.0 db 1 56.5 db 1 0 59.0 db 1 61.5 db 1 0 0 64.0 db * 1 66.5 db * 1 0 69.0 db * 1 71.5 db * bit : initial value : r/w : ?? ?? note: * with a setting of 64.0db or more, the ctlamp is in a very sensitive status. when configuring the set board, be concerned about countermeasure against noise around the control head signal input port. also, thoroughly set the filter between the ctlamp and ctlsmt. h'd0b0: vertical sync signal threshold va lue register vtr: sync detector (servo) 0 0 1 0 w 2 0 w 3 0 4 0 w 5 0 6 1 7 w w w vtr5 vtr4 vtr3 vtr2 vtr1 vtr0 1 bit : initial value : r/w : ?? ?? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 948 of 1038 rej09b0328-0300 h'd0b1: horizontal sync signal threshold va lue register htr: sync detector (servo) 0 0 1 0 w 2 0 w 3 0 4 5 6 1 7 w w htr3 htr2 htr1 htr0 11 1 bit : initial value : r/w : ???? ???? h'd0b2: h pulse adjustment start time setting register hrtr: sync detector (servo) 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 6 0 7 hrtr4 hrtr3 hrtr2 hrtr1 hrtr0 0 w hrtr7 w w w hrtr6 hrtr5 bit : initial value : r/w : h'd0b3: h pulse width setting regist er hpwr: sync detector (servo) 0 0 1 0 w 2 0 w 3 0 4 5 6 1 7 w w hpwr3 hpwr2 hpwr1 hpwr0 11 1 bit : initial value : r/w : ???? ???? h'd0b4: noise detection window setting re gister nwr: sync detector (servo) 0 0 1 0 w 2 0 w 3 0 4 0 w 5 0 6 1 7 w w w nwr5 nwr4 nwr3 nwr2 nwr1 nwr0 1 bit : initial value : r/w : ?? ?? h'd0b5: noise detection register ndr: sync detector (servo) 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 6 0 7 ndr4 ndr3 ndr2 ndr1 ndr0 0 w ndr7 w w w ndr6 ndr5 bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 949 of 1038 rej09b0328-0300 h'd0b6: sync signal control register syncr: sync detector (servo) 0 0 1 0 r 2 0 r/(w) * 3 1 4 5 6 1 7 r/w r/w nis/vd nois fld syct 11 1 note: * only 0 can be written. interrupt select bit 0 noise level interrupt 1 vd interrupt noise detection flag 0 noise count is less than four times of ndr setting value 1 noise count is over four times of ndr setting value field detection flag 0 odd field 1 even field sync signal polarity select bit syct description polarity 0 positive 1 negative bit : initial value : r/w : ???? ???? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 950 of 1038 rej09b0328-0300 h'd0b8: servo interrupt enable register 1 sienr1: servo interrupt 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 6 0 7 iecap3 iecap2 iecap1 iehsw2 iehsw1 0 r/w iedrm3 r/w r/w r/w iedrm2 iedrm1 drum phase error detection interrupt enable bit 0 interrupt request is disabled by irrdrm3 1 interrupt request is enabled by irrdrm3 drum speed error detection (lock detection) interrupt enable bit 0 interrupt request is disabled by irrdrm2 1 interrupt request is enabled by irrdrm2 drum speed error detection (ovf, latch) interrupt enable bit 0 interrupt request is disabled by irrdrm1 1 interrupt request is enabled by irrdrm1 capstan phase error detection interrupt enable bit 0 interrupt request is disabled by irrcap3 1 interrupt request is enabled by irrcap3 capstan speed error detection (lock detection) interrupt enable bit 0 interrupt request is disabled by irrcap2 1 interrupt request is enabled by irrcap2 capstan speed error detection (ovf, latch) interrupt enable bit 0 interrupt request is disabled by irrcap1 1 interrupt request is enabled by irrcap1 hsw timing generation (counter clear, capture) interrupt enable bit 0 interrupt request is disabled by irrhsw2 1 interrupt request is enabled by irrhsw2 hsw timing generator (ovw, match, strig) interrupt enable bit 0 interrupt request is disabled by irrhsw1 1 interrupt request is enabled by irrhsw1 bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 951 of 1038 rej09b0328-0300 h'd0b9: servo interrupt enable register 2 sienr2: servo interrupt 0 0 1 0 r/w 2 3 4 5 6 1 7 r/w iesnc iectl 11 11 1 vertical sync signal interrupt enable bit 0 interrupt (vertical sync signal interrupt) request is disabled by irrsnc 1 interrupt (vertical sync signal interrupt) request is enabled by irrsnc ctl interrupt enable bit 0 interrupt request is disabled by irrctl 1 interrupt request is enabled by irrctl bit : initial value : r/w : ?????? ?????? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 952 of 1038 rej09b0328-0300 h'd0ba: servo interrupt request register 1 sirqr1: servo interrupt 0 0 1 0 r/(w) * 2 0 r/(w) * 3 0 4 0 r/(w) * 0 r/(w) * 5 6 0 7 irrcap3 irrcap2 irrcap1 irrhsw2 irrhsw1 0 r/(w) * irrdrm3 r/(w) * r/(w) * r/(w) * irrdrm2 irrdrm1 note: * only 0 can be written to clear the flag. drum phase error detector interrupt request bit 0 drum phase error detector interrupt request is not generated 1 drum phase error detector interrupt request is generated drum speed error detector (lock detection) interrupt request bit 0 drum speed error detector (lock detection) interrupt request is not generated 1 drum speed error detector (lock detection) interrupt request is generated drum speed error detector (ovf, latch) interrupt request bit 0 drum speed error detector (ovf, latch) interrupt request is not generated 1 drum speed error detector (ovf, latch) interrupt request is generated capstan phase error detector (ovf, latch) interrupt request bit 0 capstan phase error detector (ovf, latch) interrupt request is not generated 1 capstan phase error detector (ovf, latch) interrupt request is generated capstan speed error detector (lock detection) intrerrupt request bit 0 capstan speed error detector (lock detection) interrupt request is not generated 1 capstan speed error detector (lock detection) interrupt request is generated capstan speed error detector (ovf, latch) interrupt request bit 0 capstan speed error detector (ovf, latch) interrupt request in not generated 1 capstan speed error detector (ovf, latch) interrupt request in generated hsw timing generator (counter clear, capture) interrupt request bit 0 hsw timing generator (counter clear, capture) interrupt request is not generated 0 hsw timing generator (counter clear, capture) interrupt request is generated hsw timing generator (ovw, match, strig) interrupt request bit 0 hsw timing generator (ovm, match, strig) interrupt request is not generated 1 hsw timing generator (ovm, match, strig) interrupt request is generated bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 953 of 1038 rej09b0328-0300 h'd0bb: servo interrupt request register 2 sirqr2: servo interrupt 0 0 1 0 r/(w) * 2 3 4 5 6 1 7 r/(w) * irrsnc irrctl 11 11 1 note: * only 0 can be written to clear the flag. vertical sync signal interrupt request bit 0 sync signal detector (vd, noise) interrupt request is not generated 1 sync signal detector (vd, noise) interrupt request is generated ctl interrupt request bit 0 ctl interrupt request is not generated 1 ctl interrupt request is generated bit : initial value : r/w : ? ????? ? ????? h'd0e0: start address register star: 32-byte buffer sci2 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 6 1 7 r/w r/w sta4 sta3 sta2 sta1 sta0 11 bit : initial value : r/w : ??? ??? h'd0e1: end address register edar: 32-byte buffer sci2 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 6 1 7 r/w r/w eda4 eda3 eda2 eda1 eda0 11 bit : initial value : r/w : ??? ??? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 954 of 1038 rej09b0328-0300 h'd0e2: serial control register 2 scr2: 32-byte buffer sci2 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 6 7 r/w r/w gap1 0 r/w abtie r/w teie gap0 cks2 cks1 cks0 0 1 transfer data interval select bits gap1 gap0 transfer data interval 0 0 no interval 0 1 8-clock interval 1 0 24-clock interval 1 1 56-clock interval transfer end interrupt enable bit 0 transfer-end interrupt request is disabled 1 transfer-end interrupt request is enabled transfer interrupt enable bit 0 transfer interrupt request is disabled 1 transfer interrupt request is enabled bit : initial value : r/w : transfer clock select bits cks2 cks1 cks0 sck2 pin clock source transfer clock frequency = 10 mhz = 5 mhz 0 0 0 sprescaler s /256 25.6 s 51.2 s 0 0 1 /64 6.4 s 12.8 s 0 1 0 /32 3.2 s 6.4 s 0 1 1 /16 1.6 s 3.2 s 1 0 0 /8 0.8 s 1.6 s 1 0 1 /4 0.4 s 0.8 s 1 1 0 /2 ? 0.4 s 1 1 1 external clock ? ? ? prescaler frequency division rate sck2 output sck2 input ? ? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 955 of 1038 rej09b0328-0300 h'd0e3: serial control status register 2 scsr2: 32-byte buffer sci2 0 0 1 0 r/(w) * 2 0 r/(w) * 3 0 4 0 r/w 5 6 7 r/w r/(w) * sol r/(w) * tei orer wt abt stf 01 1 note: * only 0 can be written to clear the flag. transfer end interrupt request flag 0 [clear condition] when 0 is written after reading 1 1 [setting condition] when transmission or reception ends abort flag 0 [clear condition] when 0 is written after reading 1 1 [setting condition] when cs pin output level becomes high during transfer overrun error flag 0 [clear condition] when 0 is written after reading 1 1 [setting condition] when extra pulse is over-applied to correct transfer clock or clock input is generated after transfer end, when using external clock wait flag 0 [clear condition] when 0 is written after reading 1 1 [setting condition] when read/write instruction to serial data buffer (32-bit) is generated while transfer is in progress or during cs input standby extension data bit 0 read: so2 pin output level is low write: so2 pin output level is changed to low 1 read: so2 pin output level is high write: so2 pin output level is changed to high start flag 0 read: transfer stops write: transfer aborted and sci2 initialized 1 read: transfer in progress, or cs input standby write: transfer starts bit : initial value : r/w : ?? ?? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 956 of 1038 rej09b0328-0300 h'd100: timer interrupt enable register iter: timer x1 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 0 6 0 7 r/w r/w r/w icice r/w icibe 0 r/w iciae icide ociae ocibe ovie icsa icfa interrupt request (icia) is disabled icfa interrupt request (icia) is enabled 0 1 input capture a interrupt enable bit ftia pin input is selected for input capture a input hsw is selected for input capture a input 0 1 input capture input select a bit icfb interrupt request (icib) is disabled icfb interrupt request (icib) is enabled 0 1 input capture b interrupt enable bit icfc interrupt request (icic) is disabled icfc interrupt request (icic) is enabled 0 1 input capture c interrupt enable bit icfd interrupt request (icid) is disabled icfd interrupt request (icid) is enabled 0 1 input capture d interrupt enable bit ofv interrupt request (fovi) is disabled ofv interrupt request (fovi) is enabled 0 1 output compare interrupt enable bit ocfb interrupt request (ocib) is disabled ocfb interrupt request (ocib) is enabled 0 1 output compare interrupt b enable bit ocfa interrupt request (ocia) is disabled ocfa interrupt request (ocia) is enabled 0 1 output compare interrupt a enable bit bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 957 of 1038 rej09b0328-0300 h'd101: timer control/status register x tcsrx: timer x1 0 0 1 0 2 0 3 0 4 0 5 0 6 0 7 r/ w r/(w) * icfb 0 r/(w) * icfa r/(w) * icfd r/(w) * icfc r/(w) * ocfb r/(w) * ocfa cclra r/(w) * ovf note: * only 0 can be written to bits 7 to 1 to clear the flags. output compare flag a [clearing condition] when 0 is written to ocfa after reading ocfa = 1 [setting condition] when frc = ocra 0 1 output compare flag b [clearing condition] when 0 is written to ocfb after reading ocfb = 1 [setting condition] when frc = ocrb 0 1 timer overflow [clearing condition] when 0 is written to ovf after reading ovf = 1 [setting conditio] when frc changes from h'ffff to h'0000 0 1 input capture flag d [clearing condition] when 0 is written to icfd after reading icfd = 1 [setting condition] when input capture signal is generated 0 1 input capture flag c [clearing condition] when 0 is written to icfc after reading icfc = 1 [setting condition] when input capture signal is generated 0 1 input capture flag b [clearing condition] when 0 is written to icfb after reading icfb = 1 [setting condition] when frc value is transferred to icrb by input capture signal 0 1 input capture flag a [clearing condition] when 0 is written to icfa after reading icfa = 1 [setting condition] when frc value is transferred to icra by input capture signal 0 1 counter clear frc clearing is disabled frc clearing is enabled 0 1 bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 958 of 1038 rej09b0328-0300 h'd102: free running count er h frch: timer x1 h'd103: free running counter l frcl: timer x1 0 3 0 r/w 5 0 r/w 7 0 9 0 r/w 11 0 13 0 15 r/w r/w r/w 0 r/w r/w 1 0 2 0 r/w 4 0 r/w 6 0 8 0 r/w 10 0 12 0 14 frc frch frcl r/w r/w r/w r/w 0 r/w 0 bit : initial value : r/w : h'd104: output compare register ah, bh ocrah, ocrbh: timer x1 h'd105: output compare register al, bl ocral, ocrbl: timer x1 1 3 1 r/w 5 1 r/w 7 1 9 1 r/w 11 1 13 1 15 r/w r/w r/w 1 r/w r/w 1 1 2 1 r/w 4 1 r/w 6 1 8 1 r/w 10 1 12 1 14 ocra, ocrb ocrah, ocrbh ocral, ocrbl r/w r/w r/w r/w 1 r/w 0 bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 959 of 1038 rej09b0328-0300 h'd106: timer control register x tcrx: timer x1 0 0 1 0 2 0 3 0 4 0 5 0 6 0 7 r/w r/w iedgb 0 r/w iedga r/w iedgd r/w iedgc r/w bufeb r/w bufea cks0 r/w cks1 capture at falling edge of input capture input a capture at rising edge of input capture input a 0 1 input capture edge select a capture at falling edge of input capture input b capture at rising edge of input capture input b 0 1 input capture edge select b capture at falling edge of input capture input c capture at rising edge of input capture input c 0 1 input capture edge select c capture at falling edge of input capture input d capture at rising edge of input capture input d 0 1 input capture edge select d icrc is not used as buffer register for icrb icrc is used as buffer register for icrb 0 1 buffer enable b icrc is not used as buffer register for icra icrc is used as buffer register for icra 0 1 buffer enable a clock selct bit clock select 0 0 cks0 cks1 1 0 0 1 internal clock: count at /4 internal clock: count at /16 internal clock: count at /64 1 1 dvcfg: edge detection p ulse selected by cfg frequency division timer bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 960 of 1038 rej09b0328-0300 h'd107: timer output compare control register tocr: timer x1 0 0 1 0 2 0 3 0 4 0 5 0 6 0 7 r/w r/w icsc 0 r/w icsb r/w osrs r/w icsd r/w oeb r/w oea olvlb r/w olvla ftib pin is selected for input capture b input vd is selected for input capture b input 0 1 input capture input select b low level high level 0 1 output level b ftic pin is selected for input capture c input dvctl is selected for input capture c input 0 1 input capture input select c ftid pin is selected for input capture d input nhsw is selected for input capture d input 0 1 input capture input select d ocra register is selected ocrb register is selected 0 1 output compare register select low level high level 0 1 output level a output compare a output is disabled output compare a output is enabled 0 1 output enable a bit : initial value : r/w : 0 1 output enable b output compare b output is disabled output compare b output is enabled appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 961 of 1038 rej09b0328-0300 h'd108: input capture register ah icrah: timer x1 h'd109: input capture register al icral: timer x1 h'd10a: input capture register bh icrbh: timer x1 h'd10b: input capture register bl icrbl: timer x1 h'd10c: input capture register ch icrch: timer x1 h'd10d: input capture register cl icrcl: timer x1 h'd10e: input capture register dh icrdh: timer x1 h'd10f: input capture register dl icrdl: timer x1 0 3 0 r 5 0 r 7 0 9 0 r 11 0 13 0 15 r r r 0 rr 1 0 2 0 r 4 0 r 6 0 8 0 r 10 0 12 0 14 icra, icrb, icrc, icrd icrah, icrbh, icrch, icrdh icral, icrbl, icrcl, icrdl r r r r 0 r 0 bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 962 of 1038 rej09b0328-0300 h'd110: timer mode register b tmb: timer b 0 0 1 0 r/w 2 0 r/w 3 1 4 1 5 0 6 0 7 r/w r/w tmbie r/(w) * tmbif 0 r/w tmb17 tmb12 tmb11 tmb10 note: * only 0 can be written to clear the flag. interval function is selected auto reload function is selected 0 1 auto reload function select bit [setting condition] when tcb overflows [clearing condition] when 0 is written after reading 1 0 1 timer b interrupt request flag timer b interrupt request is disabled timer b interrupt request is enabled 0 1 timer b interrupt enable bit 0 0 0 internal clock: count at /16384 tmb11 tmb10 tmb12 clock select 0 1 internal clock: count at /4096 1 0 0 0 0 internal clock: count at /1024 11 internal clock: count at /512 0 1 0 internal clock: count at /128 0 1 internal clock: count at /32 1 1 1 1 0 internal clock: count at /8 1 1 count at rising/falling edge of external event (tmbi) * note: * external event edge selection is set at pmr51 in port mode register 5 (pmr5). see section 13.2.4, port register 5 (pmr5). clock select bit bit : initial value : r/w : ?? ? ? h'd111: timer counter b tcb: timer b 0 0 1 0 r 2 0 r 3 4 5 0 6 0 7 r r tcb15 0 r tcb14 0 r tcb13 r tcb16 0 r tcb17 tcb12 tcb11 tcb10 bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 963 of 1038 rej09b0328-0300 h'd111: timer load registerb tlb: timerb 0 0 1 0 w 2 0 w 3 4 5 0 6 0 7 w w tlb15 0 w tlb14 0 w tlb13 w tlb16 0 w tlb17 tlb12 tlb11 tlb10 bit : initial value : r/w : h'd112: timer l mode register lmr: timer l 0 0 1 0 r/w 2 0 r/w 3 0 4 1 5 1 6 0 7 r/w r/w r/w lmie 0 r/(w) * lmif imr3 imr2 imr1 imr0 note: * only 0 can be written to clear the flag. timer l interrupt request flag [clearing condition] when 0 is written after reading 1 [setting condition] when ltc overflow, underflow or compare match clear occurs 0 1 timer l interrupt enable bit timer l interrupt request is disabled timer l interrupt request is enabled 0 1 up count control down count control 0 1 up/down count control clock select bit clock select 0 0 0 count at rising edge of pb and rec-ctl lmr1 lmr0 r2 1 count at falling edge of pb and rec-ctl 1 * count dvcfg2 0 1 * internal clock: count at /128 1 * internal clock: count at /64 legend: * don't care. bit : initial value : r/w : ?? ?? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 964 of 1038 rej09b0328-0300 h'd113: linear time counter ltc: timer l 0 0 1 0 r 2 0 3 0 4 5 6 0 7 r rr r ltc6 0 r ltc5 0 r ltc4 0 r ltc7 ltc3 ltc2 ltc1 ltc0 bit : initial value : r/w : h'd113: reload/compare match register rcr: timer l 0 0 1 0 w 2 0 3 0 4 5 6 0 7 w ww w rcr6 0 w rcr5 0 w rcr4 0 w rcr7 rcr3 rcr2 rcr1 rcr0 bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 965 of 1038 rej09b0328-0300 h'd118: timer r mode register 1 tmrm1: timer r 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 0 6 0 7 r/w r/w r/w rld r/w ac/br 0 r/w clr2 rlck ps21 ps20 rld/cap cps tmru-2 is not cleard at the time of capture tmru-2 is cleard at the time of capture 0 1 tmru-2 clear select bit deceleration acceleration 0 1 acceleration/deceleration select bit tmru-2 is not used as reload timer tmru-2 is used as reload timer 0 1 execution/non-execution of reload by tmru-2 reload at cfg rising edge reload at tmru underflow 0 1 tmru-2 reload timing select bit 0 0 count at tmru-1 underflow ps20 ps21 1 pss, count at /256 0 1 pss, count at /128 pss, count at /64 1 tmru-2 clock source select bits tmru-2 clock source select capture signal at cfg rising edge capture signal at irq3 edge 0 1 tmru-1 capture signal select bit tmru-1 functions as reload timer tmru-1 functions as capture timer 0 1 tmru-1 operation mode select bit bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 966 of 1038 rej09b0328-0300 h'd119: timer r mode register tmrm2: timer r 0 0 1 0 r/(w) * 2 0 r/w 3 0 4 0 r/w 5 0 6 0 7 r/(w) * r/w r/w ps10 r/w ps11 0 r/w lat ps31 ps30 cp/slm capf slw tmru-1 clock source select bits tmru-1 clock source select 0 0 count at cfg rising edge ps10 ps11 1 pss, count at /4 0 1 pss, count at /256 1 pss, count at /512 tmru-3 clock source select bits tmru-3 clock source select 0 0 count at rising edge of dvctl from frequency divider ps30 ps31 1 pss, count at /4096 0 1 pss, count at /2048 1 pss, count at /1024 interrupt select bit interrupt request by tmru-2 capture signal is enabled interrupt request by slow tracking mono-multi end is enabled 0 1 capture signal flag [clearing condition] when 0 is written after reading 1 [setting condition] when tmru-2 capture signal is generated while cp/slm bit = 0 0 1 slow tracking mono-multi flag [clearing condition] when 0 is written after reading 1 [setting condition] when slow tracking mono-multi ends while cp/slm bit = 1 0 1 tmru-2 captrue signal select bits * 0 capture at tmru-3 underflow cps lat 0 1 capture at cfg rising edge 1 capture at irq3 edge tmru-2 capture signal select legend: * don't care. bit : initial value : r/w : note: * only 0 can be written to clear the flag. appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 967 of 1038 rej09b0328-0300 h'd11a: timer r capture register 1 tmrcp1: time r 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 r tmrc17 r tmrc16 r tmrc15 r tmrc14 r tmrc13 r tmrc12 r tmrc11 r tmrc10 bit : initial value : r/w : h'd11b: timer r capture register 2 tmrcp2: time r 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 r tmrc27 r tmrc26 r tmrc25 r tmrc24 r tmrc23 r tmrc22 r tmrc21 r tmrc20 bit : initial value : r/w : h'd11c: timer r load register 1 tmrl1: timer r 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 w tmr17 w tmr16 w tmr15 w tmr14 w tmr13 w tmr12 w tmr11 w tmr10 bit : initial value : r/w : h'd11d: timer r load register 2 tmrl2: timer r 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 w tmr27 w tmr26 w tmr25 w tmr24 w tmr23 w tmr22 w tmr21 w tmr20 bit : initial value : r/w : h'd11e: timer r load register 3 tmrl3: timer r 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 w tmr37 w tmr36 w tmr35 w tmr34 w tmr33 w tmr32 w tmr31 w tmr30 bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 968 of 1038 rej09b0328-0300 h'd11f: timer r control/statu s register tmrcs: timer r 0 1 1 1 2 0 r/(w) * 3 0 4 0 r/(w) * 5 0 6 0 7 r/(w) * r/w tmri1e r/w tmri2e 0 r/w tmri3e tmri3 tmri2 tmri1 note: * only 0 can be written to clear the flag. tmri3 interrupt request is disabled tmri3 interrupt request is enabled 0 1 tmri3 interrupt enable bit tmri2 interrupt request is disabled tmri2 interrupt request is enabled 0 1 tmri2 interrupt enable bit tmri1 interrupt request is disabled tmri1 interrupt request is enabled 0 1 tmri1 interrupt enable bit tmri1 interrupt request flag [clearing condition] when 0 is written after reading 1 [setting condition] when tmru-1 underflows 0 1 tmri2 interrupt request flag [clearing condition] when 0 is written after reading 1 [setting condition] when tmru-2 underflows or when capstan motor acceleration/deceleration operation ends 0 1 tmri3 interrupt request flag [clearing condition] when 0 is written after reading 1 [setting condition] when interrupt source selected at cp/slm bit in tmrm2 is generated 0 1 bit : initial value : r/w : ?? ?? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 969 of 1038 rej09b0328-0300 h'd120: pwm data register l pwdrl: 14-bit pwm 0 0 1 0 2 0 3 0 4 0 5 0 6 7 w pwdrl0 w pwdrl1 w pwdrl2 w pwdrl3 w pwdrl4 w pwdrl5 0 w pwdrl6 w pwdrl7 0 bit : initial value : r/w : h'd121: pwm data register u pwdru: 14-bit pwm 0 0 1 0 2 0 3 0 4 0 5 0 6 1 7 w pwdru0 w pwdru1 w pwdru2 w pwdru3 w pwdru4 w pwdru5 1 bit : initial value : r/w : ?? ?? h'd122: pwm control register pwcr: 14-bit pwm 0 0 1 1 2 1 3 1 4 1 5 1 6 1 7 r/w pwcr0 1 clock select bit note: * t : pwm input clock frequency input clock is /2 (t = 2/ ) generate pwm waveform with conversion frequency of 16384/ and minimum pulse width of 1/ input clock is /4 (t = 4/ ) generate pwm waveform with conversion frequency of 32768/ and minimum pulse width of 2/ 0 1 bit : initial value : r/w : ??????? ??????? h'd126: 8-bit pwm data register 0 pwr0: 8-bit pwm 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 6 0 7 pw04 pw03 pw02 pw01 pw00 0 w pw07 w w w pw06 pw05 bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 970 of 1038 rej09b0328-0300 h'd127: 8-bit pwm data register 1 pwr1: 8-bit pwm 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 6 0 7 pw14 pw13 pw12 pw11 pw10 0 w pw17 w w w pw16 pw15 bit : initial value : r/w : h'd128: 8-bit pwm data register 2 pwr2: 8-bit pwm 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 6 0 7 pw24 pw23 pw22 pw21 pw20 0 w pw27 w w w pw26 pw25 bit : initial value : r/w : h'd129: 8-bit pwm data register 3 pwr3: 8-bit pwm 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 6 0 7 pw34 pw33 pw32 pw31 pw30 0 w pw37 w w w pw36 pw35 bit : initial value : r/w : h'd12a: 8-bit pwm control register pw8cr: 8-bit pwm 0 0 1 0 r/w 2 0 r/w 3 0 4 5 6 7 pwc3 pwc2 pwc1 pwc0 r/w r/w 1111 output polarity select bits positive polarity negative polarity 0 1 note: n = 3 to 0 bit : initial value : r/w : ???? ???? h'd12c: input capture register 1 icr1: psu 0 0 1 0 r 2 0 r 3 0 4 0 r 0 r 5 6 0 7 icr14 icr13 icr12 icr11 icr10 0 r icr17 r r r icr16 icr15 bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 971 of 1038 rej09b0328-0300 h'd12d: prescaler unit contro l/status register pcsr: psu 0 0 1 0 r/w 2 0 r/w 3 1 4 0 r/w 5 0 6 0 7 r/w r/w iceg r/w icie 0 r/(w) * icif ncon/off dcs2 dcs1 dcs0 note: * only 0 can be written to clear the flag. interrupt request by input capture is disabled interrupt request by input capture is enabled 0 1 input capture interrupt enable bit frequency division clock output select bits frequency division clodk output select 0 0 0 pss, output /32 dcs1 dcs0 dcs2 1 pss, output /16 1 0 pss, output /8 1 pss, output /4 0 1 0 psw, output w/32 1 psw, output w/16 1 0 psw, output w/8 1 psw, output w/4 input capture interrupt flag [clearing condition] when 0 is written after reading 1 [setting condition] when input capture is executed at ic pin edge 0 1 noise cancel function of ic pin is disabled noise cancel function of ic pin is enabled 0 1 noise cancel on/off bit ic pin edge select bit falling edge of ic pin input is detected rising edge of ic pin input is detected 0 1 bit : initial value : r/w : ? ? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 972 of 1038 rej09b0328-0300 h'd130: software trigger a/d result register h adrh: a/d converter h'd131: software trigger a/d result register l adrl: a/d converter adrh adrl 1 0 32 54 7 0 r 6 0 r 9 0 r 8 0 r 11 0 r 10 0 r 0 r 0 r 0 r adr9 adr8 adr7 adr6 adr5 adr4 adr3 adr2 adr1 adr0 0 r 12 13 14 15 0 0 0 0 0 0 bit : initial value : r/w : ?????? ?????? h'd132: hardware trigger a/d result register h ahrh: a/d converter h'd133: hardware trigger a/d result register l ahrl: a/d converter ahrh ahrl 1 0 32 54 7 0 r 6 0 r 9 0 r 8 0 r 11 0 r 10 0 r 0 r 0 r 0 r ahr9 ahr8 ahr7 ahr6 ahr5 ahr4 ahr3 ahr2 ahr1 ahr0 0 r 12 13 14 15 0 0 0 0 0 0 bit : initial value : r/w : ? ????? ? ????? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 973 of 1038 rej09b0328-0300 h'd134: a/d control register adcr: a/d converter 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 0 6 1 7 r/w r/w r/w hch1 0 r/w ck hch0 sch3 sch2 sch1 sch0 clock select 0 conversion frequency = 266 states 1 conversion frequency = 134 states hardware channel select bits hch1 hch2 analog input channel 0 0 an8 1 an9 1 0 ana 1 anb software channel select bits sch3 sch2 sch1 sch0 analog input channel 0 0 0 0 an0 1 an1 1 0 an2 1 an3 1 0 0 an4 1 an5 1 0 an6 1 an7 1 0 0 0 an8 1 an9 1 0 ana 1 anb 1 * * software-triggered conversion channel is not selected note: if conversion is started by software when sch3 to sch0 are set to 11 ** , the conversion result is undetermined. hardware- or external-triggered conversion, however, will be performed on the channel selected by hch1 and hch0. bit : initial value : r/w : ? ? legend: * don't care. appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 974 of 1038 rej09b0328-0300 h'd135: a/d control/status re gister adcsr: a/d converter 0 0 1 0 r 2 0 r 3 0 4 0 r/w 5 0 6 7 r//(w) * r r/w adie 0 r/(w) * send sst hst busy scnl hend 1 a/d interrupt enable bit 0 interrupt (adi) upon a/d conversion end is disabled 1 interrupt (adi) upon a/d conversion end is enabled software a/d start flag 0 read: indicates that software-triggered a/d conversion has ended or been stopped write: software-triggered a/d conversion is aborted 1 read: indicates that software-triggered a/d conversion is in progress write: starts software-triggered a/d conversion busy flag 0 no contention for a/d conversion 1 indicates an attempt to execute software-triggerd a/d conversion was canceled by the start of hardware- triggered a/d conversion. software-triggered a/d conversion cancel flag 0 no contention for a/d conversion 1 indicates that software-triggered a/d conversion was canceled by the start of hardware-triggered a/d conversion. hardware a/d status flag 0 read: hardware- or external -triggered a/d conversion is not in progress write: hardware- or external-triggered a/d conversion is aborted 1 hardware- or external-triggered a/d conversion has ended or been stopped software a/d end flag 0 [clearing condition] when 0 is written after reading 1 1 [setting condition] when software-triggered a/d conversion has ended hardware a/d end flag 0 [clearing condition] when 0 is written after reading 1 1 [setting condition] when hardware- or external-triggered a/d conversion has ended bit : initial value : r/w : ? ? note: * only 0 can be written to clear the flag. appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 975 of 1038 rej09b0328-0300 h'd136: a/d trigger select register adtsr: a/d converter 0 1 2 3 0 4 r/w 5 6 7 trgs1 0 r/w trgs0 111111 trigger select bits trgs1 trgs0 0 0 hardware- or external-triggered a/d conversion is disabled 1 hardware-triggered (adtrg) a/d conversion is selected 1 0 hardware-triggered (dfg) a/d conversion is selected 1 external-triggered (adtrg) a/d conversion is selected bit : initial value : r/w : ?????? ?????? h'd138: timer load register k tlk: timer j 0 1 1 1 w 2 1 w 3 1 4 1 w 5 1 6 1 7 w w w tlr25 w tlr26 1 w tlr27 tlr24 tlr23 tlr22 tlr21 tlr20 bit : initial value : r/w : h'd138: timer counter k tck: timer j 0 1 1 1 r 2 1 r 3 1 4 1 r 5 1 6 1 7 r r r tdr25 r tdr26 1 r tdr27 tdr24 tdr23 tdr22 tdr21 tdr20 bit : initial value : r/w : h'd139: timer load register j tlj: timer j 0 1 1 1 w 2 1 w 3 1 4 1 w 5 1 6 1 7 w w w tlr15 w tlr16 1 w tlr17 tlr14 tlr13 tlr12 tlr11 tlr10 bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 976 of 1038 rej09b0328-0300 h'd139: timer counter j tcj: timer j 0 1 1 1 r 2 1 r 3 1 4 1 r 5 1 6 1 7 r r r tdr15 r tdr16 1 r tdr17 tdr14 tdr13 tdr12 tdr11 tdr10 bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 977 of 1038 rej09b0328-0300 h'd13a: timer mode register j tmj: timer j 0 0 1 0 r 2 0 r/w 3 0 4 0 r/w 5 0 6 0 7 r/w r/w r/w st r/w ps10 0 r/w ps11 8/16 ps21 ps20 tgl t/r tmj-2 toggle flag tmj-2 toggle output is 0 tmj-2 toggle output is 1 0 1 timer output/remote-controller output select bit tmj-1 timer output tmj-1 toggle output (data transmitted from remote controller) 0 1 tmj-1 and tmj-2 operate separately tmj-1 and tmj-2 operate together as 16-bit 0 1 8-bit/16-bit operation select bit stop tmj-1 clock supply in remote control mode start tmj-1 clock supply in remote control mode 0 1 remote-controlled operation start bit note: * external clock edge selection is set in edge select register (iegr). see section explaining edge select register (iegr). when using external clock in remote control mode, set opposite edges for irq1 and irq2 edges (eg. when falling edge is set for irq1, set rising edge for irq2). 0 0 ps10 ps11 1 0 1 pss, count at /512 pss, count at /256 pss, count at /4 1 count at rising/falling edge of external clock ( irq1 ) tmj-1 input clock select bits tmj-1 input clock select legend: * don't care. notes: 1. the edge selection for the external clock inputs is made by setting the edge select register (iegr). see section 6.2.4, irq edge select register (iegr) for more information. 2. available only in the h8s/2194c group. ps20 ps21 ps22 * 3 counthing by the pss, /16384 counthing by the pss, /2048 counting at underflowing of the tmj-1 counting at the leading edge or the trailing edge of the external clock inputs ( irq2 ) * 1 counting by the pss, /1024 * 2 tmj-2 input clock select bits tmj-2 input clock select bit : initial value : r/w : 0 1 0 1 0 1 ** 0 1 appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 978 of 1038 rej09b0328-0300 h'd13b: timer j control register tmjc: timer j 0 1 0 2 0 r/w 3 4 0 r/w 5 0 6 0 7 r/w r/w mon1 r/w buzz0 0 r/w buzz1 mon0 tmj2ie tmj1ie 11 /4096 buzz0 output signal buzz1 frequency when = 10 mhz /8192 2.44 khz 1.22 khz output monitor signal 00 1 10 1 output timer j buzz signal buzzer output select bits tmj2i interrupt request is disabled tmj2i interrupt request is enabled 0 1 tmj2i interrupt enable bit tmj1i interrupt request is disabled tmj1i interrupt request is enabled 0 1 tmj1i interrupt enable bit pb or rec-ctl mon0 mon1 dvctl output tca7 00 1 1 * monitor output select bits monitor output select legend: * don't care. bit : initial value : r/w : ? (ps22) * ? (r/w) * h8s/2194 group: when ths is read, 1 will always be readout. writes are disabled. h8s/2194c group: this bit, together with bit 3 and 2 (ps21,ps20) in tmj, selects the input clock for tmj-2. note: * bit 0 is readable/writable only in the h8s/2194c group. appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 979 of 1038 rej09b0328-0300 h'd13c: timer j status register tmjs: timer j 0 1 2 3 4 5 6 0 7 r/(w) * tmj1i 0 r/(w) * tmj2i 11 1 1 11 note: * only 0 can be written to clear the flag. tmj1i interrupt request flag [clearing condition] when 0 is written after reading 1 [setting condition] when tmj-1 underflows 0 1 tmj2i interrupt request flag [clearing condition] when 0 is written after reading 1 [setting condition] when tmj-2 underflows 0 1 bit : initial value : r/w : ?????? ?????? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 980 of 1038 rej09b0328-0300 h'd148: serial mode register smr1: sci1 7 c/ a 0 r/w 6 chr 0 r/w 5 pe 0 r/w 4 o/e 0 r/w 3 stop 0 r/w 0 cks0 0 r/w 2 mp 0 r/w 1 cks1 0 r/w start-stop synchronous mode clock synchronouns mode 0 1 communication mode multiprocessor function is disabled multiprocessor format is selected 0 1 multiprocessor mode clock select clock select 0 0 cks0 cks1 1 0 1 clock /4 clock /16 clock 1 /64 clock 8-bit data 7-bit data 0 1 character length note: * when 7-bit data is selected, the msb (bit 7) of tdr is not transmitted, and lsb-first/msb-first selection is not available. even parity * 1 odd parity * 2 0 1 parity mode notes: 1. when even parity is set, parity bit addition is performed in transmission so that the total number of 1 bits in the transmit character plus the parity bit is even. in reception, a check is performed to see if the total number of 1 bits in the receive character plus the parity bit is even. 2. when odd parity is set, parity bit addition is performed in transmission so that the total number of 1 bits in the transmit character plus the parity bit is odd. in reception, a check is performed to see if the total number of 1 bits in the receive character plus the parity bit is odd. 1 stop bit * 1 2 stop bit * 2 0 1 stop bit length notes: 1. in transmission, a single 1 bit (stop bit) is added to the end of a transmit character before it is sent. 2. in transmission, two 1 bits (stop bits) are added to the end of a transmit character before it is sent. parity bit addition and checking disabled parity bit addition and checking enabled * 0 1 parity enable note: * when the pe bit is set to 1, the parity (even or odd) specified by the o/ e bit is added to transmit data before transmission. in reception, the parity bit is checked for the parity (even or odd) specified by the o/ e bit. bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 981 of 1038 rej09b0328-0300 h'd149: bit rate register brr1: sci1 7 1 r/w 6 1 r/w 5 1 r/w 4 1 r/w 3 1 r/w 0 1 r/w 2 1 r/w 1 1 r/w bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 982 of 1038 rej09b0328-0300 h'd14a: serial control register scr1: sci1 7 tie 0 r/w 6 rie 0 r/w 5 te 0 r/w 4 re 0 r/w 3 mpie 0 r/w 0 cke0 0 r/w 2 teie 0 r/w 1 cke1 0 r/w transmit-data-empty interrupt (txi) request is disabled * transmit-data-empty interrupt (txi) request is enabled 0 1 transmit interrupt enable bit note: * txi interrupt request cancellation can be performed by reading 1 from the tdre flag, then clearing it to 0, or clearing the tie bit to 0. reveive-data-full interrupt (rxi) request and receive-error interrupt (eri) request is disabled * reveive-data-full interrupt (rxi) request and receive-error interrupt (eri) request is enabled 0 1 receive interrupt enable bit note: * rxi and eri interrupt request cancellation can be performed by reading 1 from the rdrf, fer, per, or orer flag, then clearing the flag to 0, or clearing the rie bit to 0. transmission is disabled * 1 transmission is enabled * 2 0 1 transmit enable bit notes: 1. the tdre flag in ssr1 is fixed at 1. 2. in this state, serial transmission is started when transmit data is written to tdr and tdre flag in ssr1 is cleared to 0. smr1 setting must be performed to decide the transmission format before setting the te bit to 1. reception is disabled * 1 reception is enabled * 2 0 1 receive enable bit notes: 1. clearing the re bit to 0 does not affect the rdrf, fer, per, and orer flags, which retain their states. 2. serial reception is started in this state when a start bit is detected in asynchronous mode or serial clock input is detected in synchronous mode. smr1 setting must be performed to decide the reception format before setting the re bit to 1. multiprocessor interrupts are disabled (normal reception performed) [clearing conditions] (1) when the mpie bit is cleared to 0 (2) when data with mpb = 1 is received multiprocessor interrupt are enabled * receive interrupt (rxi) requests, receive-error interrupt (eri) requests, and setting of the rdrf, fer, and orer flags in ssr1 are disabled until data with the multiprocessor bit set to 1 is received. 0 1 multiprocessor interrupt enable bit note: * when receive data including mpb = 0 is reveived, receive data transfer from rsr to rdr1, receive error detection, and setting of the rdrf, fer, and orer flags in ssr1, is not performed. when receive data with mpb = 1 is received, the mpb bit in ssr1 is set to 1, the mpie bit is cleared to 0 automatically, and generation of rxi and eri interrup ts (when the tie and rie bits in scr1 are set to 1) and fer and orer flag setting is enabled. clock enable bits notes: 1. initial value 2. outputs a clock of the same frequency as the bit rate. 3. inputs a clock with a frequency 16 times the bit rate. clock select 0 0 internal clock/sck1 pin function as i/o port * 1 cke0 cke1 internal clock/sck1 pin function as serial clock output * 1 1 internal clock/sck1 pin function as clock output * 2 internal clock/sck1 pin function as serial clock output 0 1 external clock/sck1 pin function as clock input * 3 external clock/sck1 pin function as serial clock input 1 external clock/sck1 pin function as clock input * 3 start-stop synchronous mode clock synchronous mode start-stop synchronous mode clock synchronous mode start-stop synchronous mode clock synchronous mode start-stop synchronous mode clock synchronous mode external clock/sck1 pin function as serial clock input transmit-end interrupt (tei) request is disabled * transmit-end interrupt (tei) request is enabled * 0 1 transmit end interrupt enable bit note: * tei cancellation can be performed by reading 1 from the tdre flag in ssr, then clearing it to 0 and clearing the tend flag to 0, or clearing the teie bit to 0. bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 983 of 1038 rej09b0328-0300 h'd14b: transmit data register tdr1: sci1 7 1 r/w 6 1 r/w 5 1 r/w 4 1 r/w 3 1 r/w 0 1 r/w 2 1 r/w 1 1 r/w bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 984 of 1038 rej09b0328-0300 h'd14c: serial status register ssr1: sci1 data with a 0 multiprocessor bit is transmitted data with a 1 multiprocessor bit is transmitted 0 1 multiprocessor bit transfer transmit data register empty [clearing condition] when 0 is written in tdre after reading tdre = 1 [setting conditions] (1) when the te bit in scr1 is 0 (2) when data is transferred from tdr1 to tsr and data can be written to tdr1 0 1 transmit end 0 [clearing condition] when 0 is written in tdre after reading tdre = 1 [setting conditions] (1) when the te bit in scr1 is 0 (2) when tdre = 1 at trasmission of the last bit of a 1-byte serial transmit character 1 7 tdre 1 r/(w) * 6 rdrf 0 r/(w) * 5 orer 0 r/(w) * 4 fer 0 r/(w) * 3 per 0 r/(w) * 0 mpbt 0 r/w 2 tend 1 r 1 mpb 0 r multiprocessor bit 0 [clearing condition] * when data with a 0 multiprocessor bit is received [setting condition] when data with a 1 multiprocessor bit is reveived 1 note: * retains its previous state when the re bit in scr1 is cleared to 0 with multiprocessor format. [clearing condition] * 1 when 0 is written in per after reading per = 1 [setting condition] when, in reception, the number of 1 bits in the receive data plus the parity bit does not match the parity setting (even or odd) specified by the o/ e bit in smr1 * 2 0 1 parity error notes: 1. the per flag is not affected and retains its previous state when the re bit in scr1 is cleared to 0. 2. if a parity error occurs, the receive data is transferred to rdr1 but the rdrf flag is not set. also, subsequent serial reception cannot be continued while the per flag is set to 1. in synchronous mode, serial transmission cannot be continued, either. receive data register full [clearing condition] when 0 is written in rdrf after reading rdrf = 1 [setting condition] when serial reception ends normally adn receive data is transferred from rsr to rdr1 0 1 note: rdr1 and the rdrf flag are not affected and retain their previous values when an error is detected during reception or when the re bit in scr1 is cleared to 0. if reception of the next data is completed while the rdrf flag is still set to 1, an overrun error will occur and the receive data will be lost. overrun errro [clearing condition] * 1 when 0 is written in orer after reading orer = 1 [setting condition] when the next serial reception is completed while rdrf = 1 * 2 0 1 notes: 1. the orer flag is not affected and retains its previous state when the re bit in scr1 is cleared to 0. 2. the receive data prior to the overrun error is retained in rdr1, and the data received subsequently is lost. also, subsequent serial reception cannot be continued while the orer flag is set to 1. in synchronous mode, serial transmission cannot be continued, either. framing error [clearing condition] * 1 when 0 is written in fer after reading fer = 1 [setting condition] when the sci1 checks the stop bit at the end of the receive data when reception ends, and the stop bit is 0. * 2 0 1 notes: 1. the fer flag is not affected and retains its previous state when the re bit in scr1 is cleared to 0. 2. in 2-stop-bit mode, only the first stop bit is checked for a value of 1; the second stop bit is not checked. if a framing error occurs, the receive data is transferred to rdr1 but the rdrf flag is not set. also, subsequent serial reception cannot be continued while the fer flag is set to 1. in synchronous mode, serial transmission cannot be continued, either. bit : initial value : r/w : note: * only 0 can be written to clear the flag. appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 985 of 1038 rej09b0328-0300 h'd14d: receive data register rdr1: sci1 7 0 r 6 0 r 5 0 r 4 0 r 3 0 r 0 0 r 2 0 r 1 0 r bit : initial value : r/w : h'd14e: serial interface mo de register scmr1: sci1 7 ? 1 ? 6 ? 1 ? 5 ? 1 ? 4 ? 1 ? 3 sdir 0 r/w 0 smif 0 r/w 2 sinv 0 r/w 1 ? 1 ? normal sci mode reserved mode 0 1 serial communication inteface mode select data invert tdr1 contents are transmitted without modification receive data is stored in rdr1 without modification tdr1 contents are onverted before being transmitted receive data is stored in rdr1 in inverted form 0 1 tdr1 contents are transmitted lsb-first receive data is stored in rdr1 lsb-first tdr1 contents are transmitted msb-first receive data is stored in rdr1 msb-first 0 1 data transfer direction bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 986 of 1038 rej09b0328-0300 h'd158: i 2 c bus control register iccr: iic bus interface 7 ice 0 r/w 6 ieic 0 r/w 5 mst 0 r/w 4 trs 0 r/w 3 acke 0 r/w 0 scp 1 w 2 bbsy 0 r/w 1 iric 0 r/(w) * note: * only 0 can be written to clear the falg. i 2 c bus interface enable 0 i 2 c bus interface module disabled, with scl and sda signal pins set to port function. initialization of the internal state of the i 2 c module. sar and sarx can be accessed 1 i 2 c bus interface module enabled for transfer operation (pins scl and sda are driving the bus) i 2 c bus interface interrupt enable 0 interrupt request is disabled 1 interrupt request is enabled acknowledge bit judgment selection 0 the value of the acknowledge bit is ignored, and continuous transfer is performed 1 if the acknowledge bit is 1, continuous transfer is interrupted bus busy 0 bus is free [clearing condition] when a stop condition is detected 1 bus is busy [setting condition] when a start condition is detected i 2 c bus interface interrupt request flag 0 waiting for transfer, or transfer in progress [clearing condition] when 0 is written in iric after reading iric = 1 1 interrupt requested [setting conditions] ? i 2 c bus format master mode (1) when a start condition is detected in the bus line state after a start condition is issued (when the tdre flag is set to 1 because of first frame transmission) (2) when a wait is inserted between the data and acknowledge bit when wait = 1 (3) at the end of data transfer (at the rise of the 9th transmit clock pulse, and at the fall of the 8th transmit/ receive clock pulse when a wait is inserted) (4) when a slave address is received after bus arbitration is lost (when the al flag is set to 1) (5) when 1 is reveived as teh acknowledge bit when the acke bit is 1 (when the ackb bit is set to 1) ? i 2 c bus format slave mode (1) when the slave address (sva, svax) matches (when the aas and aasx flags are set to 1) and at the end of data transfer up to the subsequent retransmission start condition or stop condition detection (when the tdre or rdrf flag is set to 1) (2) when the general call address is detected (when fs = 0 and the adz flag is set to 1) and at the end of data transfer up to the subsequent retransmission start condition or stop condition detection (when the tdre or rdrf flag is set to 1) (3) when 1 is received as the acknowledge bit when the acke bit is 1 (when the ackb bit is set to 1) (4) when a stop condition is detected (when the stop or estp flag is set to 1) ? synchronous serial format (1) at the end of data transfer (when the tdre or rdrf flag is set to 1) (2) when a start condition is detected with serial format selected when conditions are occurred such that the tdre or rdrf flag is set to 1 start condition/stop condition prohibit 0 writing 0 issues a start or stop condition, in combination with the bbsy flag 1 reading always returns a value of 1 writing is ignored master/slave select transmit/receive select mst trs 0 0 slave reveive mode 1 slave transmit mode 1 0 master receive mode 1 master transmit mode bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 987 of 1038 rej09b0328-0300 h'd159: i 2 c bus status register icsr: iic bus interface 7 estp 0 r/(w) * 6 stop 0 r/(w) * 5 irtr 0 r/(w) * 4 aasx 0 r/(w) * 3 al 0 r/(w) * 0 ackb 0 r/w 2 aas 0 r/(w) * 1 adz 0 r/(w) * note: * only 0 can be written to clear the flag. error stop condition detection flage 0 no error stop condition [clearing conditions] (1) when 0 is written in estp after reading estp = 1 (2) when the iric flag is cleared to 0 1 ? in i 2 c bus format slave mode error stop condition detected [setting condition] when a stop condition is detected during frame transfer ? in other mode no meaning normal stop condition detection flag 0 no normal stop condition [clearing conditions] (1) when 0 is written in stop after reading stop = 1 (2) when the iric flag is cleared to 0 1 ? in i 2 c bus format slave mode normal stop condition detected [setting condition] when a stop condition is detected after completion of frame transfer ? in other mode no meaning i 2 c bus interface continuous transmission/reception interrupt request flag 0 waiting for transfer, or transfer in progress [clearing conditions] (1) when 0 is written in irtr after reading irtr = 1 (2) when the iric flag is cleared to 0 1 continuous transfer state [setting conditions] ? in i 2 c bus interface slave mode when the tdre or rdrf flag is set to 1 when aasx = 1 ? in other mode when the tdre or rdrf flag is set to 1 second slave address recognition flag 0 second slave address not recognized [clearing conditions] (1) when 0 is written in aasx after reading aasx = 1 (2) when a start condition is detected (3) in master mode 1 second slave address recognized [setting condition] when the second slave address is detected in slave receive mode while fsx = 0 arbitration lost flag 0 bus arbitration won [clearing conditions] (1) when icdr data is written (transmit mode) or read (receive mode) (2) when 0 is written in al after reading al = 1 1 arbitration lost [setting conditions] (1) if the internal sda and sda pin disagree at the rise of scl in master transmit mode (2) if the internal scl line is high at the fall of scl in master transmit mode slave address recognition flag 0 slave address or general call address not recognized [clearing conditions] (1) when icdr data is written (transmit mode) or read (receive mode) (2) when 0 is written in aas after reading aas = 1 (3) in master mode 1 slave address or general call address recognized [setting condition] when the slave address or general call address is detected in slave receive mode general call address recognition flag 0 general call address not recognized [clearing conditions] (1) when icdr data is written (transmit mode) or read (receive mode) (2) when 0 is written in adz after reading adz = 1 (3) in master mode 1 general call address recognized [setting condition] when the general call address is detected in slave receive mode acknowledge bit 0 receive mode: 0 is output at acknowledge output timing transmit mode: indicates that the receiving device has acknowldeged the data (signal is 0) 1 receive mode; 1 is output at acknowledge output timing bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 988 of 1038 rej09b0328-0300 h'd15e: i 2 c bus data register icdr: iic bus interface 7 icdr7 ? r/w 6 icdr6 ? r/w 5 icdr5 ? r/w 4 icdr4 ? r/w 3 icdr3 ? r/w 0 icdr0 ? r/w 2 icdr2 ? r/w 1 icdr1 ? r/w bit : initial value : r/w : h'd15e: second slave address register sarx: iic bus interface 7 svax6 0 r/w 6 svax5 0 r/w 5 svax4 0 r/w 4 svax3 0 r/w 3 svax2 0 r/w 0 fsx 1 r/w 2 svax1 0 r/w 1 svax0 0 r/w bit : initial value : r/w : format select used combined with sar fs bit. appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 989 of 1038 rej09b0328-0300 h'd15f: i 2 c bus mode register icmr: iic bus interface 7 mls 0 r/w 6 wait 0 r/w 5 cks2 0 r/w 4 cks1 0 r/w 3 cks0 0 r/w 0 bc0 0 r/w 2 bc2 0 r/w 1 bc1 0 r/w msb-first/lsb-first select 0 msb-first 1 lsb-first wait insertion bit 0 data and acknowledge bits transferred consecutively 1 wait inserted between data and acknowledge bits transfer clock select bits bit counter bit/frame bc2 bc1 bc0 clock sync i 2 c bus format serial format 0 0 0 8 9 1 1 2 1 0 2 3 1 3 4 0 0 0 4 5 1 5 6 1 0 6 7 1 7 8 bit : initial value : r/w : note: * see stcr bit 6. iicx * cks2 cks1 cks0 clock transfer rate = 5 mhz = 8 mhz = 10 mhz 0 0 0 0 /28 179 khz 286 khz 357 khz 1 /40 125 khz 200 khz 250 khz 1 0 /48 104 khz 167 khz 208 khz 1 /64 78.1 khz 125 khz 156 khz 1 0 0 /80 62.5 khz 100 khz 125 khz 1 /100 50.0 khz 80.0 khz 100 khz 1 0 /112 44.6 khz 71.4 khz 89.3 khz 1 /128 39.1 khz 62.5 khz 78.1 khz 1 0 0 0 /56 89.3 khz 143 khz 179 khz 1 /80 62.5 khz 100 khz 125 khz 1 0 /96 52.1 khz 83.3 khz 104 khz 1 /128 39.1 khz 62.5 khz 78.1 khz 1 0 0 /160 31.3 khz 50.0 khz 62.5 khz 1 /200 25.0 khz 40.0 khz 50.0 khz 1 0 /224 22.3 khz 35.7 khz 44.6 khz 1 /256 19.5 khz 31.3 khz 39.1 khz appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 990 of 1038 rej09b0328-0300 h'd15f: slave address register sar: iic bus interface 7 sva6 0 r/w 6 sva5 0 r/w 5 sva4 0 r/w 4 sva3 0 r/w 3 sva2 0 r/w 0 fs 0 r/w 2 sva1 0 r/w 1 sva0 0 r/w format select bit sar sarx format select bit 0 bit 0 fs fx 0 0 i 2 c bus format ? sar and sarx slave addresses recognized 1 i 2 c bus format ? sar slave address recognized ? sarx slave address ignored 1 0 i 2 c bus format ? sar slave address ignored ? sarx slave address recognized 1 i 2 c bus format ? sar and sarx slave addresses ignored bit : initial value : r/w : h'ffb0: trap address register 0 tar0: atc h'ffb3: trap address register 1 tar1: atc h'ffb6: trap address register 2 tar2: atc 0 0 1 0 r/w 2 0 r/w 3 4 5 6 7 r/w a18 a17 a16 0 0 r/w 0 r/w r/w a23 a22 a21 0 0 r/w r/w a20 a19 0 0 1 0 r/w 2 0 r/w 3 4 5 6 7 r/w a10 a9 a8 0 0 r/w 0 r/w r/w a15 a14 a13 0 0 r/w r/w a12 a11 0 1 0 r/w 2 0 r/w 3 4 5 6 7 a2 a1 0 0 r/w 0 r/w r/w a7 a6 a5 0 0 r/w r/w a4 a3 0 bit : initial value : r/w : bit : initial value : r/w : bit : initial value : r/w : ? ? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 991 of 1038 rej09b0328-0300 h'ffb9: address trap control register atcr: atc 0 0 1 0 r/w 2 0 r/w 3 1 4 1 5 1 6 1 7 r/w trc2 trc1 trc0 1 trap control 0 0 address trap function 0 is disabled 1 address trap function 0 is enabled trap control 1 0 address trap function 1 is disabled 1 address trap function 1 is enabled trap control 2 0 address trap function 2 is disabled 1 address trap function 2 is enabled bit : initial value : r/w : ???? ? ???? ? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 992 of 1038 rej09b0328-0300 h'ffba: timer mode register a tma: timer a 0 0 1 0 r/w 2 0 r/w 3 0 4 1 5 1 6 0 7 r/w r/w r/w tmaie 0 r/(w) * tmaov tma3 tma2 tma1 tma0 note: * only 0 can be written to clear the flag. [clearing condition] when 0 is written to tmaov after reading tmaov = 1 [setting condition] when tca overflows 0 1 timer a overflow flag interrupt request by timer a (tmai) is disabled interrupt request by timer a (tmai) is enabled 0 1 timer a interrupt enable bit timer a clock source is pss timer a clock source is psw 0 1 clock source, prescaler select bit pss, /16384 tma1 tma0 tma2 prescaler frequency division rate (interval timer) or overflow frequency (time-base) operation mode pss, /8192 pss, /4096 pss, /1024 0 tma3 pss, /512 pss, /256 pss, /64 pss, /16 1 s interval timer mode clock time base mode 0.5 s 0.25 s 0.03125 s 0 1 0 1 1 clear psw and tca to h'00 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 clock select bits note: = f osc bit : initial value : r/w : ? ? ? ? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 993 of 1038 rej09b0328-0300 h'ffbb: timer counter a tca: timera 0 0 1 0 r 2 0 r 3 0 4 5 6 7 r r tca3 0 r tca4 0 r tca5 0 r tca6 0 r tca7 tca2 tca1 tca0 bit : initial value : r/w : h'ffbc: watchdog timer control/status register wtcsr: wdt 7 ovf 0 r/(w) * 6 wt/it 0 r/w 5 tme 0 r/w 4 rsts 0 r/w 3 rst/nmi 0 r/w 0 cks0 0 r/w 2 cks2 0 r/w 1 cks1 0 r/w note: * only 0 can be written to clear the flag. overflow flag wtcnt is initialized to h'00 and halted wtcnt counts 0 1 nmi interrupt request is disabled internal reset request is generated 0 1 timer mode select bit timer enable bit reset or nmi interval timer mode: sends the cpu an interval timer interrupt request (wovi) when wtcnt overflows watchdog timer mode: sends the cpu a reset or nmi interrupt request when wtcnt overflows 0 1 [clearing conditions] (1) write 0 in the tme bit (2) read wtcsr when ovf = 1, then write 0 in ovf [setting condition] when wtcnt overflows (changes from h'ff to h'00) (when internal reset request generation is selected in watchdog timer mode, ovf is cleared automatically by the internal reset.) 0 1 bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 994 of 1038 rej09b0328-0300 h'ffbd: watchdog timer counter wtcnt: wdt 7 0 r/w 6 0 r/w 5 0 r/w 4 0 r/w 3 0 r/w 0 0 r/w 2 0 r/w 1 0 r/w bit : initial value : r/w : h'ffc0: port data register 0 pdr0: i/o port 0 1 r 2 r 3 4 r r 5 7 pdr04 pdr03 pdr02 pdr01 pdr00 r pdr07 r r r pdr06 pdr05 6 bit : initial value : r/w : ???????? h'ffc1: port data register 1 pdr1: i/o port 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 0 7 0 r/w r/w r/w r/w 6 pdr14 pdr13 pdr12 pdr11 pdr10 pdr17 pdr16 pdr15 bit : initial value : r/w : h'ffc2: port data register 2 pdr2: i/o port 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 0 7 0 r/w r/w r/w r/w 6 pdr24 pdr23 pdr22 pdr21 pdr20 pdr27 pdr26 pdr25 bit : initial value : r/w : h'ffc3: port data register 3 pdr3: i/o port 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 0 7 0 r/w r/w r/w r/w 6 pdr34 pdr33 pdr32 pdr31 pdr30 pdr37 pdr36 pdr35 bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 995 of 1038 rej09b0328-0300 h'ffc4: port data register 4 pdr4: i/o port 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 0 7 0 r/w r/w r/w r/w 6 pdr44 pdr43 pdr42 pdr41 pdr40 pdr47 pdr46 pdr45 bit : initial value : r/w : h'ffc5: port data register 5 pdr5: i/o port 0 0 1 0 2 3 4 1 1 5 1 7 1 6 r/w pdr51 r/w pdr50 0 r/w pdr52 0 r/w pdr53 bit : initial value : r/w : ???? ???? h'ffc6: port data register 6 pdr6: i/o port 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 6 0 7 pdr64 pdr63 pdr62 pdr61 pdr60 0 r/w pdr67 r/w r/w r/w pdr66 pdr65 bit : initial value : r/w : h'ffc7: port data register 7 pdr7: i/o port 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 6 0 7 pdr74 pdr73 pdr72 pdr71 pdr70 0 r/w pdr77 r/w r/w r/w pdr76 pdr75 bit : initial value : r/w : h'ffc8: port data register 8 pdr8: i/o port 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 6 0 7 pdr84 pdr83 pdr82 pdr81 pdr80 0 r/w pdr87 r/w r/w r/w pdr86 pdr85 bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 996 of 1038 rej09b0328-0300 h'ffcd: port mode register 0 pmr0: i/o port 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 0 7 0 r/w r/w r/w r/w 6 pmr04 pmr03 pmr02 pmr01 pmr00 pmr07 pmr06 pmr05 p07/an7 to p00/irq0 rin function select bits p0n/ann pin functions as p0n input port p0n/ann pin functions as ann input port 0 1 note: n = 7 to 0 bit : initial value : r/w : h'ffce: port mode register 1 pmr1: i/o port 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 0 7 0 r/w r/w r/w r/w 6 pmr14 pmr13 pmr12 pmr11 pmr10 pmr17 pmr16 pmr15 p17/tmow pin functions as p17 i/o port p17/tmow pin functions as tmow output port 0 1 p17/tmow pin function select bit p1n/ i rq n pin functions as p1n i/o port p1n/ i rq n pin functions as i rq n input port 0 1 p15/ i rq 5 to p10/ i rq 0 pin function select bits note: n = 5 to 0 p16/ ic pin functions as p16 i/o port p16/ ic pin functions as ic input port 0 1 p16/ ic pin function select bit bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 997 of 1038 rej09b0328-0300 h'ffcf: port mode register 2 pmr2: i/o port 0 0 1 1 2 1 3 1 4 1 0 r/w 5 0 7 0 r/w r/w r/w 6 pmr20 pmr27 pmr26 pmr25 p27/sck2 pin functions as p27 i/o port p27/sck2 pin functions as sck2 i/o port 0 1 p26/so2 pin functions as p26 i/o port p26/so2 pin functions as so2 output port 0 1 p25/si2 pin functions as p25 i/o port p25/si2 pin functions as s12 input port 0 1 p26/so2 pin functions as cmos output p26/so2 pin functions as nmos open drain output 0 1 p27/sck2 pin function select bit p26/so2 pin function select bit p25/si2 pin function select bit p26/so2 pin pmos control bit bit : initial value : r/w : ?? ?? ?? ?? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 998 of 1038 rej09b0328-0300 h'ffd0: port mode register 3 pmr3: i/o port 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 0 7 0 r/w r/w r/w r/w 6 pmr34 pmr33 pmr32 pmr31 pmr30 pmr37 pmr36 pmr35 p3n/pwmm pin functions as p3n i/o port p3n/pwmm pin functions as pwmm output port 0 1 p36/buzz pin functions as p36 i/o port p36/buzz pin functions as buzz output port 0 1 p37/tmo pin functions as p37 i/o port p37/tmo pin functions as tmo output port 0 1 p37/tmo pin function select bit notes: if the tmo pin is used for remote control sending, a careless timer output pulse may be output when the remote control mode is set after the output has been switched to the tmo output. perform the switching and setting in the following order. [1] set the remote control mode. [2] set the tmj-1 and 2 counter data of the timer j. [3] switch the p37/tmo pin to the tmo output pin. [4] set the st bit to 1. p36/buzz pin function select bit p35/pwm3 to p32/pwm0 pin function select bit p31/strb pin functions as p31 i/o port p31/strb pin functions as strb output port 0 1 p31/strb pin function select bit note: n = 5 to 2, m = 3 to 0 p30/ cs pin functions as p30 i/o port p30/ cs pin functions as cs input port 0 1 p30/ cs pin function select bit bit : initial value : r/w : h'ffd1: port control register 1 pcr1: i/o port 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 0 7 0 w w w w 6 pcr14 pcr13 pcr12 pcr11 pcr10 pcr17 pcr16 pcr15 p1n pin functions as input port p1n pin functions as output port 0 1 bit : initial value : r/w : note: n = 7 to 0 appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 999 of 1038 rej09b0328-0300 h'ffd2: port control register 2 pcr2: i/o port 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 0 7 0 w w w w 6 pcr24 pcr23 pcr22 pcr21 pcr20 pcr27 pcr26 pcr25 p2n pin functions as input port p2n pin functions as output port 0 1 note: n = 7 to 0 bit : initial value : r/w : h'ffd3: port control register 3 pcr3: i/o port 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 0 7 0 w w w w 6 pcr34 pcr33 pcr32 pcr31 pcr30 pcr37 pcr36 pcr35 p3n pin functions as input port p3n pin functions as output port 0 1 bit : initial value : r/w : note: n = 7 to 0 appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 1000 of 1038 rej09b0328-0300 h'ffd4: port control register 4 pcr4: i/o port 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 0 7 0 w w w w 6 pcr44 pcr43 pcr42 pcr41 pcr40 pcr47 pcr46 pcr45 p4n pin functions as input port p4n pin functions as output port 0 1 bit : initial value : r/w : note: n = 7 to 0 h'ffd5: port control register 5 pcr5: i/o port 0 0 1 0 2 3 4 1 1 5 1 7 1 6 w pcr51 w pcr50 0 w pcr52 0 w pcr53 p5n pin functions as input port p5n pin functions as output port 0 1 bit : initial value : r/w : ?? ?? ?? ?? note: n = 3 to 0 h'ffd6: port control register 6 pcr6: i/o port 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 6 0 7 pcr64 pcr63 pcr62 pcr61 pcr60 0 w pcr67 w w w pcr66 pcr65 0 0 p6n/rpn pin functions as p6n general purpose input port pcr6n pmr6n 1 p6n/rpn pin functions as p6n general purpose output port * 1 p6n/rpn pin functions as rpn realtime output port port control register 6 legend: * don't care. note: n = 7 to 0 bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 1001 of 1038 rej09b0328-0300 h'ffd7: port control register 7 pcr7: i/o port 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 6 0 7 pcr74 pcr73 pcr72 pcr71 pcr70 0 w pcr77 w w w pcr76 pcr75 p7n pin functions as input port p7n pin functions as output port 0 1 bit : initial value : r/w : note: n = 7 to 0 h'ffd8: port control register 8 pcr8: i/o port 0 0 1 0 w 2 0 w 3 0 4 0 w 0 w 5 6 0 7 pcr84 pcr83 pcr82 pcr81 pcr80 0 w pcr87 w w w pcr86 pcr85 p8n pin functions as input port p8n pin functions as output port 0 1 bit : initial value : r/w : note: n = 7 to 0 h'ffdb: port mode register 4 pmr4: i/o port 0 0 1 1 2 1 3 1 4 1 1 5 1 7 1 r/w 6 pmr40 p40/pwm14 pin functions as p40 i/o port p40/pwm14 pin functions as pwm14 output port 0 1 p40/pwm14 pin function select bit bit : initial value : r/w : ??????? ??????? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 1002 of 1038 rej09b0328-0300 h'ffdc: port mode register 5: pmr5: i/o port 0 1 1 0 2 3 4 1 1 5 1 7 1 6 r/w pmr51 0 r/w pmr52 0 r/w pmr53 p53/trig pin function as p53 i/o port p53/trig pin function as trig input port 0 1 p53/trig pin function select bit p52/tmbi pin function as p52 i/o port p52/tmbi pin functions as tmbi input port 0 1 p52/tmbi pin function select bit the timer b event input detects the falling edge the timer b event input detects the rising edge 0 1 timer b event input edge select bit : initial value : r/w : ???? ? ???? ? h'ffdd: port mode register 6 pmr6: i/o port 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 6 0 7 pmr64 pmr63 pmr62 pmr61 pmr60 0 r/w pmr67 r/w r/w r/w pmr66 pmr65 p6n/rpn pin functions as p6n i/o port p6n/rpn pin functions as rpn output port 0 1 p67/rp7 to p60/rp0 pin function select bit bit : initial value : r/w : note: n = 7 to 0 appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 1003 of 1038 rej09b0328-0300 h'ffde: port mode register 7 pmr7: i/o port 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 6 0 7 pmr74 pmr73 pmr72 pmr71 pmr70 0 r/w pmr77 r/w r/w r/w pmr76 pmr75 p77/ppg7 to p70/ppg0 pin function select bit p7n/ppgn pin functions as p7n i/o port p7n/ppgn pin functions as ppgn output port 0 1 bit : initial value : r/w : note: n = 7 to 0 h'ffdf: port mode register 8 pmr8: i/o port 0 0 1 0 r/w 2 0 r/w 3 0 4 1 1 5 6 1 7 pmr83 pmr82 pmr81 pmr80 1 r/w r/w p83/sv2 pin functions as p83 i/o port p83/sv2 pin functions as sv2 output port 0 1 p83/sv2 pin function select bit p82/sv1 pin functions as p82 i/o port p82/sv1 pin functions as sv1 output port 0 1 p82/sv1 pin function select bit p81/excap pin functions as p81 i/o port p81/excap pin functions as excap input port 0 1 p81/excap pin function select bit p80/exttrg pin functions as p80 i/o port p80/exttrg pin functions as exttrg input port 0 1 p80/exttrg pin function select bit bit : initial value : r/w : ???? ???? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 1004 of 1038 rej09b0328-0300 h'ffe1: pull-up mos select register 1 pur1: i/o port 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 0 7 0 r/w r/w r/w r/w 6 pur14 pur13 pur12 pur11 pur10 pur17 pur16 pur15 p1n pin has no pull-up mos transistor p1n pin has pull-up mos transistor 0 1 bit : initial value : r/w : note: n = 7 to 0 h'ffe2: pull-up mos select register 2 pur2: i/o port 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 0 7 0 r/w r/w r/w r/w 6 pur24 pur23 pur22 pur21 pur20 pur27 pur26 pur25 p2n pin has no pull-up mos transistor p2n pin has pull-up mos transistor 0 1 bit : initial value : r/w : note: n = 7 to 0 h'ffe3: pull-up mos select register 3 pur3: i/o port 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 0 7 0 r/w r/w r/w r/w 6 pur34 pur33 pur32 pur31 pur30 pur37 pur36 pur35 p3n pin has no pull-up mos transistor p3n pin has pull-up mos transistor 0 1 bit : initial value : r/w : note: n = 7 to 0 appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 1005 of 1038 rej09b0328-0300 h'ffe4: realtime output trigger edge select register rtpegr: i/o port 0 0 1 0 r/w 2 1 3 1 4 1 1 5 6 1 7 rtpegr1 rtpegr0 1 r/w 0 0 trigger input is disabled rtpegr0 rtpegr1 1 rising edge of trigger input is selected 0 1 rising and falling edges of trigger input is selected 1 falling edge of trigger input is selected realtime output trigger edge select bit realtime output trigger edge select bit : initial value : r/w : ?????? ?????? h'ffe5: realtime output trigger se lect register rtpsr: i/o port 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 6 0 7 rtpsr4 rtpsr3 rtpsr2 rtpsr1 rtpsr0 0 r/w rtpsr7 r/w r/w r/w rtpsr6 rtpsr5 external trigger (trig pin) input is selected internal triggfer (hsw) input is selected 0 1 bit : initial value : r/w : note: n = 7 to 0 appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 1006 of 1038 rej09b0328-0300 h'ffe8: system control register syscr: system control 0 1 1 0 r/w 2 0 r/w 3 1 4 0 r/w 5 0 6 0 7 r r intm1 intm0 xrst nmieg1 nmieg0 0 0 0 0 interrupt is controlled by i bit intm0 intm1 interrupt control mode interrupt control 1 1 interrupt is controlled by i and ui bits and icr 0 1 2 cannot be used in the h8s/2194 group 1 3 cannot be used in the h8s/2194 group 0 0 interrupt request is generated at falling edge of nmi input nmieg0 nmieg1 1 interrupt request is generated at rising edge of nmi input * 1 interrupt request is generated at rising or falling edge of nmi input reset is generated by watchdog timer overflow reset is generaed by external reset input 0 1 interrupt control mode external reset nmi edge select bits nmi edge select legend: * don't care. bit : initial value : r/w : ?? ? ?? ? h'ffe9: mode control register mdcr: system control 0 ? * 1 0 2 0 3 0 4 0 5 0 6 0 7 r mds0 0 note: * determined by md0 pin. mode select 0 bit : initial value : r/w : ????? ?? ????? ?? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 1007 of 1038 rej09b0328-0300 h'ffea: standby control regi ster sbycr: system control 0 0 1 0 r/w 2 0 3 0 4 0 r/w 5 0 6 0 7 r/w r/w sts1 r/w sts2 0 r/w ssby sts0 sck1 sck0 transition to sleep mode after execution of sleep instruction in high-speed mode or medium-speed mode transition to subsleep mode after execution of sleep instruction in subactive mode transition to stadby mode, subactive mode, or watch mode after execution of sleep instruction in high-speed mode or medium- speed mode transition to watch mode or high-speed mode after execution of sleep instruction in subactive mode 0 1 software standby system clock select system clock select 0 0 sck0 sck1 1 0 0 1 bus master is in high-speed mode medium-speed clock is /16 medium-speed clock is /32 1 1 medium-speed clock is /64 0 0 sts1 sts2 0 0 1 0 standby timer select bits 0 sts0 1 0 standby time 8192 states 16384 states 32768 states 1 0 0 1 0 1 1 0 1 65536 states 1 1 * 16 states * 1 131072 states 262144 states legend: * don't care. note: 1. the standby time is 32 states when transited to medium-speed mode /32 (sck = 1, sck = 0).do not select 16 states for flash rom version. bit : initial value : r/w : ? ? ? ? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 1008 of 1038 rej09b0328-0300 h'ffeb: low-power control register lpwrcr: system control 0 0 1 0 r/w 2 0 3 0 4 0 5 0 6 0 7 r/w r/w nesel r/w lson 0 r/w dton sa1 sa0 low-speed on flag noise elimination sampling frequency select subactive mode clock select subactive mode clock select sampling at divided by 16 sampling at divided by 4 0 1 ? when a sleep instruction is executed in high-speed mode or medium-speed mode, a transition is made to sleep mode, standby mode, or watch mode ? when a sleep instruction is executed in subactive mode, a transition is made to watch mode, or directly to high-speed mode ? when a sleep instruction is executed in high-speed mode or medium-speed mode, a transition is made directly to subactive mode * , or a transition is made to sleep mode or standby mode ? when a sleep instruction is executed in subactive mode, a transition is made directily to high-speed mode, or a transition is made to subsleep mode 0 1 direct transfer on flag ? when a sleep instruction is executed in high-speed mode or medium-speed mode, a transition is made to sleep mode, standby mode, or watch mode ? when a sleep instruction is executed in subactive mode, a transition is made to watch mode, or directly to high-speed mode ? after watch mode is cleared, a transition is made to high-speed mode ? when a sleep instruction is executed in high-speed mode a transition is made to watch mode, subactive mode, sleep mode or standby mode. ? when a sleep instruction is executed in subactive mode, a transition is made to subsleep mode or watch mode. ? after watch mode is cleared, a transition is made to subactive mode 0 1 legend: * don't care. 0 0 sa0 sa1 1 0 * 1 operating clock of cpu is w/8 operating clock of cpu is w/4 operating clock of cpu is w/2 bit : initial value : r/w : ??? ??? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 1009 of 1038 rej09b0328-0300 h'ffec: module stop control regi ster mstpcrh: system control h'ffed: module stop control register mstpcrl: system control 7 1 mstp15 r/w mstpcrh 6 1 mstp14 r/w 5 1 mstp13 r/w 4 1 mstp12 r/w 3 1 mstp11 r/w 2 1 mstp10 r/w 1 1 mstp9 r/w 0 1 mstp8 r/w 7 1 mstp7 r/w 6 1 mstp6 r/w 5 1 mstp5 r/w 4 1 mstp4 r/w 3 1 mstp3 r/w 2 1 mstp2 r/w 1 1 mstp1 r/w 0 1 mstp0 r/w mstpcrl module stop module stop mode is released module stop mode is set 0 1 bit : initial value : r/w : h'ffee: serial timer control re gister stcr: system control 7 ? 0 ? 6 iicx 0 r/w 5 iicrst 0 r/w 4 ? 0 ? 3 flshe 0 r/w 0 ? 0 ? 2 ? 0 ? 1 ? 0 ? flash memory control register enable bit i 2 c controller reset bit i 2 c transfer clock select used combined with icmr cks2 to cks0 i 2 c bus interface controller is not reset i 2 c bus interface controller is reset 0 1 flash memory control register is not selected flash memory control register is selected 0 1 bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 1010 of 1038 rej09b0328-0300 h'fff0: irq edge select register iegr: interrupt controller 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 0 0 7 r/w r/w r/w irq4eg r/w irq5eg irq3eg irq2eg irq1eg irq0eg1 irq0eg0 0 6 irq 0 pin detected dege select bits irq 0 pin detected edge select 0 0 interrupt request generaed at falling edge of irq 0 pin input irq0eg0 irq0eg1 1 0 interrupt request generaed at rising edge of irq 0 pin input * 1 interrupt request generaed at bath falling and rising edge of irq 0 pin input legend: * don't care. irq5 to irq1 pins detected edge select bits interrupt request generated at falling edge of irq n pin input interrupt request generated at rising edge of irq n pin input 0 1 note: n = 5 to 1 bit : initial value : r/w : ? ? h'fff1: irq enable register ienr: interrupt controller 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 5 0 0 7 r/w r/w r/w irq5e irq4e irq3e irq2e irq1e irq0e 0 6 irq5 to irq0 enable bits irqn interrupt is disabled irqn interrupt is enabled 0 1 note: n = 5 to 0 bit : initial value : r/w : ?? ?? appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 1011 of 1038 rej09b0328-0300 h'fff2: irq status register irqr: interrupt controller 0 0 1 0 r/(w) * 2 0 r/(w) * 3 0 4 0 r/(w) * 5 0 0 7 r/(w) * r/(w) * r/(w) * irq5f irq4f irq3f irq2f irq1f irq0f 0 6 note: * only 0 can be written to clear the flag. irq5 to irq0 flag [clearing condition] cleared by reading irqnf set to 1, then writing 0 in irqnf when irqn interrupt exception handling is executed [setting conditions] (1) when a falling edge occurs in i rq n input while falling edge detection is set (irqneg = 0) (2) when a rising edge occurs in i rq n input while rising edge detection is set (irqneg = 0) (3) when a falling or rising edge occurs in i rq 0 input while both-edge detection is set (irq0eg1 = 1) 0 1 note: n = 5 to 0 bit : initial value : r/w : ?? ?? h'fff3: interrupt control register a icra: interrupt controller h'fff4: interrupt control register b icrb: interrupt controller h'fff5: interrupt control register c icrc: interrupt controller h'fff6: interrupt control register d icrd: interrupt controller 0 0 1 0 r/w 2 0 r/w 3 0 4 0 r/w 0 r/w 5 0 7 icr4 icr3 icr2 icr1 icr0 0 r/w icr7 r/w r/w r/w icr6 icr5 6 interrupt control level corresponding interrupt source is control level 0 (non-priority) corresponding interrupt source is control level 1 (priority) 0 1 bit : initial value : r/w : note: n = 7 to 0 appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 1012 of 1038 rej09b0328-0300 h'fff8: flash memory control register 1 flmcr1: flash rom (h8s/2194 flash version only) 7 fwe ? * r 6 swe 0 r/w 5 ? 0 ? 4 ? 0 ? 3 ev 0 r/w 0 p 0 r/w 2 pv 0 r/w 1 e 0 r/w note: * determined by the state of the fwe pin. program software write enable writes are disabled writes are enabled [setting condition] when fwe = 1 0 1 flash write enable when a low level is input to the fwe pin (hardware-protected state) when a high level is input to the fwe pin 0 1 erase-verify erase-verify mode cleared transition to erase-verify mode [setting condition] when fwe = 1 and swe = 1 0 1 program-verify program-verify mode cleared transition to program-verufy mode [setting condition] when fwe = 1 and swe = 1 0 1 erase erase mode cleared transition to erase mode [setting condition] when fwe = 1, swe = 1, and esu = 1 0 1 program mode cleared transition to program mode [setting condition] when fwe = 1, swe = 1, and psu = 1 0 1 bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 1013 of 1038 rej09b0328-0300 h'fff8: flash memory control register 1 flmcr1: flash rom (h8s/2194c flash version only) 7 fwe ? * r 6 swe 0 r/w 5 esu1 0 r/w 4 psu1 0 r/w 3 ev1 0 r/w 0 p1 0 r/w 2 pv1 0 r/w 1 e1 0 r/w note: * determined by the state of the fwe pin. program software write enable writes are disabled writes are enabled [setting condition] when fwe = 1 0 1 flash write enable when a low level is input to the fwe pin (hardware-protected state) when a high level is input to the fwe pin 0 1 erase verify erase-verify mode cleared transition to erase-verify mode [setting condition] when fwe = 1 and swe = 1 0 1 erase setup bit 1 erase-setup cleared erase-setup [setting condition] when fwe = 1 and swe = 1 0 1 program setup bit 1 program-setup cleared program-setup [setting condition] when fwe = 1 and swe = 1 0 1 program verify program-verify mode cleared transition to program-verufy mode [setting condition] when fwe = 1 and swe = 1 0 1 erase erase mode cleared transition to erase mode [setting condition] when fwe = 1, swe = 1, and esu = 1 0 1 program mode cleared transition to program mode [setting condition] when fwe = 1, swe = 1, and psu = 1 0 1 bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 1014 of 1038 rej09b0328-0300 h'fff9: flash memory control register 2 flmcr2: flash rom (h8s/2194 flash version only) 7 fler 0 r 6 ? 0 ? 5 ? 0 ? 4 ? 0 ? 3 ? 0 ? 0 psu 0 r/w 2 ? 0 ? 1 esu 0 r/w flash memory error flash memory is operating normally flash memory program/erase protection (error protection) is disabled [clearing condition] reset or hardware standby mode an error has occurred during flash memeory programming/erasing flash memory program/erase protection (error protection) is enabled [setting condition] see section 7.6.3, error protection 0 1 program setup 0 program setup cleared program setup [setting condition] when fwe = 1, and swe = 1 1 erase setup 0 erase setup cleared erase setup [setting condition] when fwe = 1, and swe = 1 1 bit : initial value : r/w : appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 1015 of 1038 rej09b0328-0300 h'fff9: flash memory control register 2 flmcr2: flash rom (h8s/2194c flash version only) 7 fler 0 r 6 ? 0 ? 5 esu2 0 r/w 4 psu2 0 r/w 3 ev2 0 r/w 0 p2 0 2 pv2 0 r/w 1 e2 0 flash memory error flash memory is operating normally flash memory program/erase protection (error protection) is disabled [clearing condition] reset or hardware standby mode an error has occurred during flash memeory programming/erasing flash memory program/erase protection (error protection) is enabled [setting condition] see section 8.6.3, error protection 0 1 program 2 0 program mode cleared transition to program-mode [setting condition] when fwe = 1, and swe = 1,and esu2 = 1 1 erase 2 0 erase mode cleared transition to erase mode [setting condition] when fwe = 1, and swe = 1,and esu2 = 1 1 program-verify 2 0 program-verify mode cleared transition to program-verify mode [setting condition] when fwe = 1, and swe = 1 1 erase-verify 2 0 erase-verify mode cleared transition to erase-verify mode [setting condition] when fwe = 1, and swe = 1 1 program setup bit 2 0 program-setup cleared program-setup [setting condition] when fwe = 1, and swe = 1 1 erase setup bit 2 0 erase-setup cleared erase-setup [setting condition] when fwe = 1, and swe = 1 1 bit : initial value : r/w : r/w r/w appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 1016 of 1038 rej09b0328-0300 h'fffa: erase block select register 1 ebr1: flash rom (h8s/2194 flash version only) 7 ? 0 ? 6 ? 0 ? 5 ? 0 ? 4 ? 0 ? 3 ? 0 ? 0 eb8 0 r/w 2 ? 0 ? 1 eb9 0 r/w bit : ebr1 initial value : r/w : h'fffa: erase block select register 1 ebr1: flash rom (h8s/2194c flash version only) 7 ? 0 ? 6 ? 0 ? 5 eb13 0 r/w 4 eb12 0 r/w 3 eb11 0 r/w 0 eb8 0 r/w 2 eb10 0 r/w 1 eb9 0 r/w bit : ebr1 initial value : r/w : h'fffb: erase block select register 2 ebr2: flash rom (h8s/2194 flash version only) 7 eb7 0 r/w 6 eb6 0 r/w 5 eb5 0 r/w 4 eb4 0 r/w 3 eb3 0 r/w 0 eb0 0 r/w 2 eb2 0 r/w 1 eb1 0 r/w bit : ebr2 initial value : r/w : division of erase block block (size) 128-kbyte version eb0 (1 kbyte) eb1 (1 kbyte) eb2 (1 kbyte) eb3 (1 kbyte) eb4 (28 kbytes) eb5 (16 kbytes) eb6 (8 kbytes) eb7 (8 kbytes) eb8 (32 kbytes) eb9 (32 kbytes) address h'000000 to h'0003ff h'000400 to h'0007ff h'000800 to h'000bff h'000c00 to h'000fff h'001000 to h'007fff h'008000 to h'00bfff h'00c000 to h'00dfff h'00e000 to h'00ffff h'010000 to h'017fff h'018000 to h'01ffff appendix b internal i/o registers rev.3.00 jan. 10, 2007 page 1017 of 1038 rej09b0328-0300 h'fffb: erase block select register 2 ebr2: flash rom (h8s/2194c flash version only) 7 eb7 0 r/w 6 eb6 0 r/w 5 eb5 0 r/w 4 eb4 0 r/w 3 eb3 0 r/w 0 eb0 0 r/w 2 eb2 0 r/w 1 eb1 0 r/w bit : ebr2 initial value : r/w : division of erase block block (size) 256-kbyte version eb0 (1 kbyte) eb1 (1 kbyte) eb2 (1 kbyte) eb3 (1 kbyte) eb4 (28 kbytes) eb5 (16 kbytes) eb6 (8 kbytes) eb7 (8 kbytes) eb8 (32 kbytes) eb9 (32 kbytes) eb10 (32 kbytes) eb11 (32 kbytes) eb12 (32 kbytes) eb13 (32 kbytes) address h'000000 to h'0003ff h'000400 to h'0007ff h'000800 to h'000bff h'000c00 to h'000fff h'001000 to h'007fff h'008000 to h'00bfff h'00c000 to h'00dfff h'00e000 to h'00ffff h'010000 to h'017fff h'018000 to h'01ffff h'020000 to h'027fff h'028000 to h'02ffff h'030000 to h'037fff h'038000 to h'03ffff appendix c pin circuit diagrams rev.3.00 jan. 10, 2007 page 1018 of 1038 rej09b0328-0300 appendix c pin circuit diagrams c.1 pin circuit diagrams circuit diagrams for all pins except power supply pins are shown in table c.1. legend out g in out g in pmos nmos clocked gate signal transmitted when g = 1 signal transmitted when g = 0 legend: rd: read signal rst: reset signal lpm: power-down mode signal (1 in standby, watch, and subactive modes) hi-z: high impedance sleep: sleep mode signal note: numbers given for resistance va lues, etc., are reference values. appendix c pin circuit diagrams rev.3.00 jan. 10, 2007 page 1019 of 1038 rej09b0328-0300 table c.1 pin circuit diagrams pin states pin names circuit diagram at reset sleep mode power-down modes other than sleep mode p00/an0 to p07/an7 pmr0n rd sch3 to sch0 hi-z retained hi-z an8 to anb hch1, hch0 hi-z retained hi-z retained pull-up mos: off subactive mode: functions other modes: hi-z p10/ irq0 to p15/ irq5 p16/ ic pur1n p c r 1 n rd pdr1n pmr1n pcr1n int notes: int = i r q 0 to i r q5 , ic n = 0 to 6 pmr1n hi-z when irq0 to irq5 and ic input are selected, pin input should be fixed high or low. appendix c pin circuit diagrams rev.3.00 jan. 10, 2007 page 1020 of 1038 rej09b0328-0300 pin states pin names circuit diagram at reset sleep mode power-down modes other than sleep mode p17/tmow pur17 p c r17 tmow pdr17 pmr17 pcr17 rd hi-z retained pull-up mos: off subactive mode: functions other modes: hi-z retained pull-up mos: off subactive mode: functions other modes: hi-z p20/si1 pur20 p c r 2 0 rd pdr20 rxe pcr20 si1 rxe legend: rxe: input control signal determined by scr and smr. hi-z when si1 input is selected, pin input should be fixed high or low. appendix c pin circuit diagrams rev.3.00 jan. 10, 2007 page 1021 of 1038 rej09b0328-0300 pin states pin names circuit diagram at reset sleep mode power-down modes other than sleep mode p21/so1 pur21 p c r 21 so1 pdr21 txe pcr21 rd legend: txe: output control signal determined by scr and smr. hi-z retained pull-up mos: off subactive mode: functions other modes: hi-z retained pull-up mos: off subactive mode: functions other modes: hi-z p22/sck1 pur22 p c r 22 scko scki pdr22 ckoe pcr22 rd ckie legend: scko: scki: ckoe: ckie: transfer clock output transfer clock input transfer clock output control signal determined by smr transfer clock input control signal determined by smr and scr hi-z when sck1 is set to input, pin input should be fixed high or low. appendix c pin circuit diagrams rev.3.00 jan. 10, 2007 page 1022 of 1038 rej09b0328-0300 pin states pin names circuit diagram at reset sleep mode power-down modes other than sleep mode p23/sda p24/scl pur2n p c r 2 n sda/scl pdr2n iice pcr2n rd iice iice sda/scl legend: iice: i 2 c bus enable signal note: n = 3, 4 hi-z retained pull-up mos: off subactive mode: functions other modes: hi-z p26/so2 pur26 p c r 2 6 so2 pdr26 pdr26 pcr26 rd hi-z retained pull-up mos: off subactive mode: functions other modes: hi-z appendix c pin circuit diagrams rev.3.00 jan. 10, 2007 page 1023 of 1038 rej09b0328-0300 pin states pin names circuit diagram at reset sleep mode power-down modes other than sleep mode retained pull-up mos: off subactive mode: functions other modes: hi-z p25/si2 pur25 p c r 2 5 rd pdr25 pmr25 pcr25 si2 pmr25 hi-z when si2 input is selected, pin input should be fixed high or low. retained pull-up mos: off subactive mode: functions other modes: hi-z p27/sck2 pur27 p c r 2 7 scko pdr27 pmr27 exck pcr27 scki rd legend: scko: transfer clock output scki: transfer clock input exck: external clock input control signal determined by smr1 or smr2 note: n = 3, 6 hi-z when sck2 is set to input, pin input should be fixed high or low. appendix c pin circuit diagrams rev.3.00 jan. 10, 2007 page 1024 of 1038 rej09b0328-0300 pin states pin names circuit diagram at reset sleep mode power-down modes other than sleep mode retained pull-up mos: off subactive mode: functions other modes: hi-z p30/ cs pur30 p c r30 rd pdr30 pmr30 pcr30 cs pmr30 hi-z when cs input is selected, pin input should be fixed high or low. p31/strb p32/pwm0 p33/pwm1 p34/pwm2 p35/pwm3 p36/buzz p37/tmo pur3n p c r3 n out pdr3n pmr3n pcr3n rd legend: out: p31/strb: sc12 strobe output p32/pwm0: 8-bit pwm0 output p33/pwm1: 8-bit pwm1 output p34/pwm2: 8-bit pwm2 output p35/pwm3: 8-bit pwm3 output p36/buzz: timer j buzzer output p37/tmo: timer j timer output note: n = 1 to 7 hi-z retained pull-up mos: off subactive mode: functions other modes: hi-z appendix c pin circuit diagrams rev.3.00 jan. 10, 2007 page 1025 of 1038 rej09b0328-0300 pin states pin names circuit diagram at reset sleep mode power-down modes other than sleep mode p40/pwm14 out pdr40 pmr40 pcr40 out pwm14 rd hi-z retained subactive mode: functions other modes: hi-z retained subactive mode: functions other modes: hi-z p41/ftia p42/ftib p43/ftic p44/ftid rd pdr4n pcr4n legend: in = ftia, ftib, ftic, ftid * note: n = 1 to 4 in hi-z note: * as pins ftia to ftid are always active except in the standby and watch modes, a high or low level should be input to them. p45/ftoa p46/ftob out pdr4n toe pcr4n rd legend: out: p45/ftoa: timer x1 output compare output ftoa p46/ftob: timer x1 output compare output ftob toe: output control signal determined by tocr note: n = 5, 6 hi-z retained subactive mode: functions other modes: hi-z appendix c pin circuit diagrams rev.3.00 jan. 10, 2007 page 1026 of 1038 rej09b0328-0300 pin states pin names circuit diagram at reset sleep mode power-down modes other than sleep mode p47 rd pdr47 pcr47 hi-z retained subactive mode: functions other modes: hi-z retained subactive mode: functions other modes: hi-z p50/ adtrg rd pdr50 trge pcr50 adt r g legend: trge: a/d trigger input control signal trge hi-z when adtrg input is selected, pin input should be fixed high or low. p51 rd pdr51 pcr51 hi-z retained subactive mode: functions other modes: hi-z appendix c pin circuit diagrams rev.3.00 jan. 10, 2007 page 1027 of 1038 rej09b0328-0300 pin states pin names circuit diagram at reset sleep mode power-down modes other than sleep mode retained subactive mode: functions other modes: hi-z p52/tmbi p53/trig rd pdr5n pmr5n pcr5n in legend: in = tmbi, trig note: n = 2, 3 pmr5n hi-z when tmbi and trig input are selected, pin input should be fixed high or low. p60/rp0 to p67/rp7 rd note: n = 0 to 7 pdrs6n pcrs6n hi-z retained subactive mode: functions other modes: hi-z p70/ppg0 to p77/ppg7 ppgn pdr7n pmr7n pcr7n rd note: n = 0 to 7 hi-z retained subactive mode: functions other modes: hi-z appendix c pin circuit diagrams rev.3.00 jan. 10, 2007 page 1028 of 1038 rej09b0328-0300 pin states pin names circuit diagram at reset sleep mode power-down modes other than sleep mode retained subactive mode: functions other modes: hi-z p80/ exttrg p81/excap rd pdr8n pmr8n pcr8n in legend: in = exttrg, excap note: n = 0, 1 pmr8n hi-z when exttrg and excap input are selected, pin input should be fixed high or low. p82/sv1 p83/sv2 out pdr8n pmr8n pcr8n rd legend: out = sv1, sv2 note: n = 2, 3 hi-z retained subactive mode: functions other modes: hi-z p84 to p87 rd note: n = 4 to 7 pdr8n pcr8n hi-z retained subactive mode: functions other modes: hi-z csync module stop pin input should be fixed high or low. appendix c pin circuit diagrams rev.3.00 jan. 10, 2007 page 1029 of 1038 rej09b0328-0300 pin states pin names circuit diagram at reset sleep mode power-down modes other than sleep mode hi-z hi-z comp/ps2 rd spmr2 comp spmr2 spdr2 spcr2 hi-z when comp input is selected, pin input should be fixed high or low. audioff videoff out lpm legend: lpm: power-down mode signal hi-z hi-z hi-z cappwm drmpwm low output low output low output vpulse lpm three- level control circuit 15 k typ note: resistance values are reference value 15 k typ low output low output low output res rst low input (high) (high) md0 ? nmi when nmi is not used, pin input should be fixed high or low. appendix c pin circuit diagrams rev.3.00 jan. 10, 2007 page 1030 of 1038 rej09b0328-0300 pin states pin names circuit diagram at reset sleep mode power-down modes other than sleep mode c.rotary/ps0 h.ampsw/ ps1 out spdrn spmrn spcrn rd notes: n = 0, 1 out = c.rotary, h.ampsw hi-z hi-z hi-z hi-z hi-z exctl/ps4 rd spdr4 spmr4 spcr4 exctl spmr4 hi-z when exctl input is selected, pin input should be fixed high or low. cfg + - + - + - cfgcomp cfgcomp p250 ref m250 s r f/f o stp vref vref cfg bias r es+modulesto p ? ? ? appendix c pin circuit diagrams rev.3.00 jan. 10, 2007 page 1031 of 1038 rej09b0328-0300 pin states pin names circuit diagram at reset sleep mode power-down modes other than sleep mode dfg dpg/ps3 rd pdrn dfg dpg pmrn pcrn dpg sw dpg sw re s + lpm dfg dpg / ps3 hi-z ? hi-z ctl (+) ctl ( ? ) ctlref ctlbias ctlfb ctlamp (o) ctlsmt (i) + - - + + - ctlgr3 to 1 ctlfb ctlgr0 ampshort (rec-ctl) ampon (pb-ctl) pb-ctl (+) pb-ctl ( - ) ctlsmt (i) ctlamp (o) ctlfb ctlref ctl (+) ctl (-) ctlbias note note: be sure to set a capacitor between ctlamp (o) and ctlsmt (i). ? ? ? x2 oscil- lation oscil- lation oscillation x1 1 m typ note: resistance values are reference values. when the subclock is not used, set x1 = high and x2 = open. osc2 low output osc1 lpm oscil- lation oscil- lation ? appendix d port states in the difference processing states rev.3.00 jan. 10, 2007 page 1032 of 1038 rej09b0328-0300 appendix d port states in the difference processing states d.1 pin circuit diagrams table d.1 port states overview port reset active sleep standby watch subactive subsleep p07 to p00 high imped-ance high imped-ance high imped-ance high imped-ance high imped-ance high impedance high impedance p17 to p10 high imped-ance functions retained high imped-ance high imped-ance functions retained p27 to p20 high imped-ance functions retained high imped-ance high imped-ance functions retained p37 to p30 high imped-ance functions retained high imped-ance high imped-ance functions retained p47 to p40 high imped-ance functions retained high imped-ance high imped-ance functions retained p53 to p50 high imped-ance functions retained high imped-ance high imped-ance functions retained p67 to p60 high imped-ance functions retained high imped-ance high imped-ance functions retained p77 to p70 high imped-ance functions retained high imped-ance high imped-ance functions retained p87 to p80 high imped-ance functions retained high imped-ance high imped-ance functions retained appendix e usage notes rev.3.00 jan. 10, 2007 page 1033 of 1038 rej09b0328-0300 appendix e usage notes e.1 power supply rise and fall order figure e.1 shows the order in which the power supply pins rise when the chip is powered on, and the order in which they fall when the chip is powered down. if the power supply voltages cannot rise and fall simultaneously, power supply operatio ns should be carried out in this order. at power-on, wait until the microcomputer section power supply (v cc ) has risen to the prescribed voltage, then raise the other analog power supplies. at power-down, drop the analog power supplies first, followed by the microcomputer section power supply (v cc ). when powering up and down, ensure that the vo ltage applied to the pins does not exceed the respective power supply voltage. v cc , av cc legend: v cc av cc sv cc vin : microcomputer section power supply voltage : a/d converter power supply voltage : servo section power supply voltage : pin applied voltage sv cc v cc , av cc sv cc vin vin figure e.1 power supply rise and fall order in power-down modes (except sleep mode), the analog power supplies can be turned off to reduce current dissipation. when the microcomputer section power supply (v cc ) is dropped to the backup voltage in a power-down mode, the order shown in figure e.2 should be followed. make sure that the voltage applied to the pins does not exceed the respective power supply voltage. the a/d converter power supply (av cc ) should be set to the same potential as the microcomputer section power supply (v cc ). in all power-down modes except sleep mode, av cc is turned off inside the device. at this time, the av cc current dissipation is defined as aistop. appendix e usage notes rev.3.00 jan. 10, 2007 page 1034 of 1038 rej09b0328-0300 legend: v cc av cc sv cc vin 5 v 2.7 v : microcomputer section power supply voltage : a/d converter power supply voltage : servo section power supply voltage : pin applied voltage v cc , av cc sv cc vin figure e.2 power supply control in power-down modes e.2 pin handling when the high-speed switching circuit for four-head special playback is not used table e.1 shows how the c.rotary, h.ampsw, and comp pins should be handled when the switching circuit for four-head special-effects playback is not used. comp is an input pin, and the other two are output pins. when the switching circuit for four-head special-e ffects playback is not used, the related pins should be handled as shown below. table e.1 pin handling when the high-speed switching ci rcuit for four-head special playback is not used pin no. pin name connection 103 c.rotary open (output pin) * 104 h.amp sw open (output pin) * 105 comp v ss note: * output depends on the special-effects control register (chcr) value. if the initial value is used, the output is low-level. appendix e usage notes rev.3.00 jan. 10, 2007 page 1035 of 1038 rej09b0328-0300 e.3 sample external circuits examples of external circuits for the servo section, and sync signal detection circuit are shown in figures e.3, e.4. (1) servo section an example of the external circuit for the drmpwm output and cappwm output pins is shown in figure e.3. r 1 drmpwm cappwn c 1 figure e.3 sample external circuit for servo section (2) sync signal detection circuit section figure e.4 shows an example of the external circu it for the sync signal detection circuit section. 33 k csync note: the figures shown are reference values. careful consideration should be given to board floating capacitance and wiring characteristics when deciding on the constants. 10 pf figure e.4 example of external circuit for sync signal det ection circuit section appendix f list of product codes rev.3.00 jan. 10, 2007 page 1036 of 1038 rej09b0328-0300 appendix f list of product codes table f.1 product codes list of h8s/2194 group and h8s/2194c group product type part no. mark code package (package code) mask rom version hd6432194 hd6432194 ( *** )f 112-pin qfp (fp-112) h8s/2194 f-ztat version HD64F2194 HD64F2194f 112-pin qfp (fp-112) h8s/2193 mask rom version hd6432193 hd6432193 ( *** )f 112-pin qfp (fp-112) h8s/2192 mask rom version hd6432192 hd6432192 ( *** )f 112-pin qfp (fp-112) h8s/2194 group h8s/2191 mask rom version hd6432191 hd6432191 ( *** )f 112-pin qfp (fp-112) h8s/2194c group mask rom version hd6432194c hd6432194c ( *** )f 112-pin qfp (fp-112) h8s/2194c f-ztat version HD64F2194c HD64F2194cf 112-pin qfp (fp-112) h8s/2194b mask rom version hd6432194b hd6432194b ( *** )f 112-pin qfp (fp-112) h8s/2194a mask rom version hd6432194a hd6432194a ( *** )f 112-pin qfp (fp-112) note: ( *** ) is the rom code. appendix g external dimensions rev.3.00 jan. 10, 2007 page 1037 of 1038 rej09b0328-0300 appendix g external dimensions the package dimention that is shown in the renesas semiconductor package data book has priority. note) 1. dimensions" * 1"and" * 2" do not include mold flash 2. dimension" * 3"does not include trim offset. 1.23 1.23 0.10 0.13 0.65 8 ? 0 ? 23.5 23.2 22.9 3.05 0.12 0.17 0.22 0.24 0.32 0.40 0.00 0.30 0.15 0.10 0.25 l 1 z e z d y x c b 1 b p a h d a 2 e d a a c 1 e e l h e 20 1.6 22.9 23.2 23.5 2.70 20 reference symbol dimension in millimeters min nom max 0.5 0.8 1.1 * 1 * 2 * 3 p e d e d 56 57 84 85 29 28 1 112 f ym x z z b h e h d 2 1 1 detail f c l a a a l terminal cross section p 1 1 b c b c p-qfp112-20x20-0.65 2.4g mass[typ.] fp-112/fp-112v prqp0112ja-a renesas code jeita package code previous code figure g.1 extermal dimensions (fp-112) appendix g external dimensions rev.3.00 jan. 10, 2007 page 1038 of 1038 rej09b0328-0300 renesas 16-bit single- chip microcomputer hardware manual h8s/2194 group, h8s/2194c group, h8s/2194 f-ztat?, h8s/2194c f-ztat? publication date: 1st edition, november 1998 rev.3.00, january 10, 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 h8s/2194 group, h8s/2194c group, h8s/2194 f-ztat?, h8s/2194c f-ztat? hardware manual |
Price & Availability of HD64F2194 |
|
|
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] |