Part Number Hot Search : 
SM200 BCX5316 EVQPSM NTE121 1N60C SF166C BUX17 2ASPR
Product Description
Full Text Search
 

To Download EVENT Datasheet File

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


  Datasheet File OCR Text:
  regarding the change of names mentioned in the document, such as mitsubishi electric and mitsubishi xx, to renesas technology corp. the semiconductor operations of hitachi and mitsubishi electric were transferred to renesas technology corporation on april 1st 2003. these operations include microcomputer, logic, analog and discrete devices, and memory chips other than drams (flash memory, srams etc.) accordingly, although mitsubishi electric, mitsubishi electric corporation, mitsubishi semiconductors, and other mitsubishi brand names are mentioned in the document, these names have in fact all been changed to renesas technology corp. thank you for your understanding. except for our corporate trademark, logo and corporate statement, no changes whatsoever have been made to the contents of the document, and these changes do not constitute any alteration to the contents of the document itself. note : mitsubishi electric will continue the business operations of high frequency & optical devices and power devices. renesas technology corp. customer support dept. april 1, 2003 to all our customers
a pplication n ote m16c/62 EVENT counter mode on the m16c/62 1. abstract EVENT counters are useful in automated packagi ng lines, tachometers, and mechanical equipment monitoring. also, the EVENT counters on the m16c/ 62 can be configured to interrupt on a single EVENT, adding to the interrupt input pins. t he following article describes how to configure the m16c/62 timers as EVENT counters, referred to as ?EVENT counter mode?. 2. introduction the mitsubishi m16c/62 is a 16-bit mcu, based on t he m16c cpu core, with an impressive list of features including 10-bit a/d, d/a, uarts, timers, dma, etc., and up to 256k bytes of user flash. the mcu has 5 ?a? timers and 6 ?b? timers. all 11 timers can operate in ?EVENT counter mode?. timer a has the following additional modes of operation: ? timer mode ? pwm mode ? one-shot mode timer b has the following additional modes of operation: ? timer mode ? pulse period/pulse width measurement mode figure 1 illustrates the operation of timer a, and figure 2, timer b. note that there are some differences between the two timers but both operate similarly in ev ent counter mode. the remainder of this article focuses on setting up timer a0 in EVENT counter mode. an-dece-mcu-5-a february 2002 1
m16c/62 EVENT counter mode on the m16c/62 figure 1. block diagram of timer a figure 2. block diagram of timer b an-dece-mcu-5-a february 2002 2
m16c/62 EVENT counter mode on the m16c/62 3. EVENT counter mode description in general, the timer tai or tbi r egister counts an input signal and, at any time, the count value can be read. when the timer overflows (for up-count) or underflows (down-count) the timer interrupt request bit is set and an interrupt is generated if the timer interrupt pr iority level is set above the current cpu priority level (if the i flag in the cpu flag registers is cleared, the interrupt will not be serviced until the flag is set). if at any time during counting the count start flag is cleared, counting is suspended until set. this is illustrated in figure 3. figure 3. operation timing of EVENT counter mode, reload type selected besides having the option of counting up or down, EVENT counter mode has many other options such as count source (tai in or tbi in input pin or another ti mer), reload or free running type, etc. and these options vary depending on which timer is used. the opti ons and the timers they are associated with are summarized in table 1, table 2, and table 3. an-dece-mcu-5-a february 2002 3
m16c/62 EVENT counter mode on the m16c/62 table 1. timer a specifications in even t counter mode (single phase mode only) an-dece-mcu-5-a february 2002 4
m16c/62 EVENT counter mode on the m16c/62 table 2. timer specifications in EVENT counter mode (when processing two-phase pulse signal with timers a2, a3, and a4) an-dece-mcu-5-a february 2002 5
m16c/62 EVENT counter mode on the m16c/62 table 3. timer b specifications in EVENT counter mode 4. configuring EVENT counter mode to configure a timer for EVENT counter mode: 1. load the timer mode register, taimr. select EVENT counter mode: bits tmod0 = 1, tmod1 = 0. set the remaining bits (mr0, mr1, mr2, tc k0, tck1) depending on required functions (see mode register diagrams below). 2. load the tai or tbi register with the count source. 3. select the trigger via the trgsr or onsf register (n/a for timer b). 4. select up or down count via the udf register (n/a for timer b, ti mer b counts down only). 5. set the timer ?interrupt priority level?, taii c or tbiic, to at least 1 if required. 6. enable interrupts (cpu i flag set). 7. set the ?start count? flag bit, tais or tbis, in the ?count start flag? register, tabsr or tbsr. it is not necessary to perform these steps in t he order listed, but the mode register should be loaded before the ?start count? flag is set. also, the priority level should not be modified when there is a possibility of an interrupt occurring. the required registers are shown in figure 4 to figure 7, figure 9, figure 10 and figure 12. an-dece-mcu-5-a february 2002 6
m16c/62 EVENT counter mode on the m16c/62 figure 4. timer ai mode register in EVENT counter mode figure 5. timer ai mode register (when not using two-phase pulse signal processing) an-dece-mcu-5-a february 2002 7
m16c/62 EVENT counter mode on the m16c/62 figure 6. timer ai mode register (whe n using two-phase pulse signal processing) figure 7. timer bi register an-dece-mcu-5-a february 2002 8
m16c/62 EVENT counter mode on the m16c/62 figure 8. one-shot start flag figure 9. trigger select register an-dece-mcu-5-a february 2002 9
m16c/62 EVENT counter mode on the m16c/62 figure 10. timer ai register figure 11. count start flag an-dece-mcu-5-a february 2002 10
m16c/62 EVENT counter mode on the m16c/62 figure 12. interrupt control register figure 13. timer b3, 4, 5 count start flag an-dece-mcu-5-a february 2002 11
m16c/62 EVENT counter mode on the m16c/62 5. references ? nc30 ver. 4.0 user?s manual, nc30ue.pdf ? m16c/60 and m16c/20 c language programming manual, 6020ec.pdf ? m16c/62 datasheets, 62aeds.pdf ? m16c/62 user?s manual, 62eum.pdf ? application note: writing interrupt handlers in c for the m16c an-dece-mcu-5-a february 2002 12
m16c/62 EVENT counter mode on the m16c/62 6. software code the software supplied by mitsubishi electric & electronics usa, inc. is intended and supplied for use on mitsubishi electric products. this software is owned by mitsubishi electric & electronics usa, inc. or mitsubishi electric corporation and is protected under applicable copyright laws. all rights are reserved. this software is provided ?as is?. no warranties, whether express, implied, or statutory, including but not limited to implied warran ties of merchantability and fitness for a particular purpose apply to this software. mitsubishi electric & electronics usa, inc. and mitsubishi electric corporation reserve the right, without notice, to make changes to this software. neither mitsubishi electric & electronics usa, inc. nor mitsubishi electric corporation shall, in any circumstances, be liable for special, incidental, or consequential damages for any reason whatsoever arising out of the use or application of this software. below is a program written for mitsubishi?s nc30 comp iler to illustrate how to configuring EVENT counter mode. the program counts 100 falling edges on the p7.1 (ta0 in ) pin then flashes d6 on the mdece0620 starter kit board. to get familiar with this mode, try changing to up-c ount, the count value or even switch to a different timer (e.g. ta1, tb0, etc). /***************************************************************************** * * file name: EVENT_mode.c * * content: example program using timer a in "EVENT counter mode". this program * is written for the EVENT counter mode application note. this program * works with the mdece0620 starter kit board. * compiled with nc30 ver. 3.20.00. * all timing based on 16 mhz xtal * * copyright,2001 mitsubishi electric corporation * and mitsubishi semiconductor system corporation * and mitsubishi electric and electronics usa *============================================================================= * $log:$ *===========================================================================*/ #include "sfr62.h" #define time_config 0x01 /* 00000001 value to load into timer mode register ||||||||_ tmod0,tmod1: EVENT counter mode ||||||____ mr0: no pulse output |||||_____ mr1: count falling edges ||||_______mr2: use up/down flag |||_______ mr3: = 0 in EVENT counter mode ||________ tck0: reload type |__________tck1: bit not used */ an-dece-mcu-5-a february 2002 13
m16c/62 EVENT counter mode on the m16c/62 #define cntr_ipl 0x03 // ta0 priority interrupt level #define led p7_7 //p6_0 led port on msv1632 board #define led_port_direction pd7_7 //pd6_0 led port direction on msv1632 board #define output 1 //prototypes void init(void); #pragma interrupt /b timera0int void timera0int(void); /***************************************************************************** name: timera0int() parameters: none returns: nothing description:timer a0 interrupt service routine. interrupts every 100 falling edges on the ta0in pin. flashes the led and increments 'count'. **************************************************************************** */ void timera0int(void) { int delaycntr; delaycntr = 0; count++; // e.g for an automated packaging line, counts # of cases led = 1; while( delaycntr <0xffff) //software delay for flashing led delaycntr++; led = 0; } /***************************************************************************** name: main() parameters: none returns: nothing description: initializes variables and led port. then does nothing but wait for ta0 interrupts. **************************************************************************** */ void main (void) { int temp; count = 0; led_port_direction = output; init(); while (1); } an-dece-mcu-5-a february 2002 14
m16c/62 EVENT counter mode on the m16c/62 /***************************************************************************** name: initial() parameters: none returns: nothing description: timer ta0 setup for 5msec interrupts. **************************************************************************** */ void init() { ta0 = 100; //e.g for an automated packaging line, 100 items per cases /* the following procedure for writing an interrupt priority level follows that as described in the m16c data sheets under 'interrupts' */ _asm (" fclr i") ; //turn off interrupts before modifying ipl ta0ic |= cntr_ipl; // use read-modify-write instruction to write ipl ta0mr = time_config; _asm (" fset i"); ta0s = 1; //start counting } in order for this program to run properly, timer a0?s interrupt vector needs to point to the function. the interrupt vector table is near the end of the startup file ?sect30.inc?. insert the function label ?_timera0int? into the interrupt vector table at vector 21 as shown below. ;******************************************************************************* ; ; c compiler for m16c/62 ; ; copyright,2000 mitsubishi electric corporation ; and mitsubishi semiconductor system corporation ; and mitsubishi electric and electronics usa ; all rights reserved. ; ; written by t.aoyama ; modified for use on msv1632 starter kit. ; sect30.inc : section definition ; this program is applicable when using kd30 and the rom monitor. ;****************************************************************************** ;--------------------------------------------------------------- : : : : : an-dece-mcu-5-a february 2002 15
m16c/62 EVENT counter mode on the m16c/62 .lword dummy_int ; a-d(for user)(vector 14) .lword dummy_int ; uart2 transmit(for user)(vector 15) .lword dummy_int ; uart2 receive(for user)(vector 16) .lword dummy_int ; uart0 transmit(for user)(vector 17) .lword dummy_int ; uart0 receive(for user)(vector 18) .lword 0fcb6bh ; uart1 transmit(for user)(vector 19) .lword 0fcb6bh ; uart1 receive(for user)(vector 20) .glb _ timera0int .lword _timera0int ; timer a0(for user)(vector 21) .lword dummy_int ; timer a1(for user)(vector 22) .lword dummy_int ; timer a2(for user)(vector 23) .lword dummy_int ; timer a3(for user)(vector 24) .lword dummy_int ; timer a4(for user)(vector 25) .lword dummy_int ; timer b0(for user)(vector 26) .lword dummy_int ; timer b1(for user)(vector 27) .lword dummy_int ; timer b2(for user)(vector 28) .lword dummy_int ; int0 (for user)(vector 29) .lword dummy_int ; int1 (for user)(vector 30) .lword dummy_int ; int2 (for user)(vector 31) : : : : : an-dece-mcu-5-a february 2002 16
keep safety first in your circuit designs! ? mitsubishi electric corporation puts the maximum effort into ma king semiconductor products bette r and more reliable, but there is always a possibility of trouble occurring. trouble with semiconductors may lead to personal injury, fire, or property damage. remember to give due consideration to safety when making your circuit designs, with appropriate measures such as (i) placement of backup, auxiliary circuits, (ii) use of non- flammable material, or (iii) prEVENT ion against any malfunction or mishap. notes regarding this information ? this information is intended as a reference to assist our consumers in the selection of the mitsubishi semiconductor product best suited to the customer?s application; it does not convey any license under any intellectual property ri ghts, or any other righ ts, belonging to mitsubish i electric corpor ation or a third party. ? mitsubishi electric corporation assumes no responsibility for any damage, or infringement of any third- party?s rights, origi nating in the us e of any product data, diagrams, charts, progr ams, algorithms, or circuit application examples contained in these materials. ? all information c ontained in these materials, including pr oduct data, diagrams, charts, pr ograms and algorithms, represents info rmation on produ cts at the time of publication of these materials, and is subject to change by mitsubishi electric corporation without notice due to product improvements or other reasons. it is therefore recommended that customers contact mitsubishi electric corporation or an authorized mitsubishi semiconductor product distributor for the latest product information before purchasing a product listed herein. ? the information described herein may contain technical inaccuracies or typographical errors. mitsubishi electric corporation assumes no responsibility for any damage, liability, or other loss arising from these inaccuracies or errors. ? please also pay attention to information published by mitsubishi electric corporation by various means, including the mitsubishi se miconductor home page (http:// www.mitsubishichip s.com). ? when using any or all of the information c ontained in these materials, in cluding produ ct, data, diagrams, charts, programs, and algorithms, please be sure to evaluate all info rmation as a to tal system before making a final decision on the app licability of t he information and produ cts. mitsubishi electric corporation assumes no responsibility for any damage, liability, or other loss resulting from the information contained herein. ? mitsubishi electric corporation semiconductors are not designed or manufactured for use in a device or system that is used under circumstances in which human life is potentially at stake. please contact mitsubishi electric corporation or an authorized mitsubishi semiconductor product distributor when considering the use of a product contained herein for any specific purposes, such as apparatus or systems for transportation, vehicular, medical, aerospace, nuclear, or undersea repeater use. ? the prior written approval of mitsubishi electric corporation is necessary to reprint or reproduce these materials in whole or in part. ? if these products or technologies are subject to japanese export c ontrol restriction s, they must be exported under a license from the japanese government and cannot be imported into a country other than the approved destination. ? any diversion or reexport contrary to the export control laws and regulations of japan and/or the country of destination is prohibited. ? please contact mitsubishi electric corporation or an authorized mitsubishi semiconductor product distributor for further deta ils on these materials or t he produ cts contained therein.
mitsubishi electric & electronics usa, inc. electronic device group usa headquarters mitsubishi electric & electronics usa, inc. electronic device group 1050 east arques avenue sunnyvale, ca 94085-4601 phone: 408-730-5900 fax: 408-732-9382 direct sales offices ? usa northwest mitsubishi electric & electronics usa, inc. electronic device group 1050 east arques avenue sunnyvale, ca 94085-4601 phone: 408-730-5900 fax: 408-737-1129 southwest mitsubishi electric & electronics usa, inc. electronic device group 20 fairbanks, suite 181 irvine, ca 92618 phone: 949-859-9453 fax: 949-859-9450 rocky m ountain mitsubishi electric & electronics usa, inc. electronic device group po box 273377 fort collin s, co 80527 phone: 970-669-4068 fax: 970-669-4129 north central mitsubishi electric & electronics usa, inc. electronic device group 3300 edinborough way, suite 511 edina, mn 55435 phone: 952-837-9053 fax: 952-837-9059 mitsubishi electric & electronics usa, inc. (automotive market only) 50 west big beaver rd., suite 136 troy, mi 48084 phone: 248-526-9580 fax: 248-526-9583 south central mitsubishi electric & electronics usa, inc. electronic device group 8310 capital of texas hwy. n., suite 260 austin, tx 78731 phone: 512-346-4200 fax: 512-346-4434 northeast mitsubishi electric & electronics usa, inc. electronic device group 92 montvale avenue, suite 2500 stoneham, ma 02180 phone: 781-245-6956 fax: 781-245-4233 mid-atlantic mitsubishi electric & electronics usa, inc. electronic device group 92 montvale avenue, suite 2500 stoneham, ma 02180 phone: 781-245-6956 fax: 781-245-4233 south atlantic mitsubishi electric & electronics usa, inc. electronic device group 2625 meridian parkway, suite 100 durham, nc 27713 phone: 919-767-7900 fax: 919-767-7902 southeast mitsubishi electric & electronics usa, inc. electronic device group 2810 premiere parkway, suite 400 duluth, ga 30097 phone: 678-258-4518 fax: 678-258-4519 mexico inquiries western mexico mitsubishi electric & electronics usa, inc. electronic device group 20 fairbanks, suite 181 irvine, ca 92618 phone: 949-859-9453 fax: 949-859-9450 eastern mexico mitsubishi electric & electronics usa, inc. electronic device group 8310 capital of texas hwy. n., suite 260 austin, tx 78731 phone: 512-346-4200 fax: 512-346-4434 puerto rico inquiries puerto rico mitsubishi electric & electronics usa, inc. electronic device group 2810 premiere parkway, suite 400 duluth, ga 30097 phone: 678-258-4518 fax: 678-258-4519 mitsubishi electric sales canada, inc. jqa-qs0161 direct sales offices ? canada central & western canada mitsubishi electric sales canada, inc. 4299 14th avenue markham, ontario, canada l3r 0j2 phone: 905-475-7728 fax: 905-475-1918 eastern canada mitsubishi electric sales canada, inc. 340 march road, suite 300 kanata, ontario, canada k2k 2e4 mitsubishi electric mcu products sold into the automotive marketplace are qs-9000 certified. phone: 613-591-3348 fax: 613-591-3948 ? 2002 mitsubishi electric & electronics usa, inc., electronic device group. mitsubishi electric & electronics usa, inc. is a wholly owned subsidiary of mitsubishi electric corporation. all trademarks are the property of their respective owners. the information supplied by mitsubishi electric & electronics usa, inc. is believed to be accurate and relia ble but in no EVENT shall mitsubishi electric & electronics usa, inc. be liable for any damages whatsoever arising out of the use or inab ility to use the information or any errors that may appear in this publication. the information is provided as is without any warranties of any kind, either express or implied. mitsubishi electric & electronics usa, inc. reserves the right, without notice, to make changes to the information or to the design and specifications of its hardware and/or software products. products subject to availability. printed in u.s.a. www.mitsubishichips.com an-dece-mcu-5-a february 2002 18


▲Up To Search▲   

 
Price & Availability of EVENT

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

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


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