Home
Operation of Timer A (Timer Mode, Gate Function)
Contents
1. Function 4 Sample Program EEKE KKK ee k kk k k k kk k k k k k k k k k k k k k k k Ck k ck k ck ck ck k k ck ck kk k k k k k FILE NAME CPU M16C Tiny series e Function Operation of Timer A i Timer Mode Gate function i Version 1 00 Copyright C 2004 Renesas Technology Corp Copyright C 2004 Renesas Solutions Corp KKKKKKKKKKKKKKKKKKKKKK KKK KK KKK KK KKK KKK KK KK KK KK KK KK KK KK KKK KKK KKK if 8K KK KK kK include file TA A A A A A ko ke ke ke ke ke e e e e e e x x f include sfr28 h BORK k k k ke kk kc ke kk ke kk kc ke kk ke ke ke ek e ek m main XCKCkCk ck ck ck kckck I kk ke ke ke koe ke eee void main void pd7_3 0 Set the corresponding port direction register to 0 talmr 0x58 Selection of timer mode Pulse output function select bit 0 Pulse is not output Gate function select bit 11 Timer counts only when TAiIN pin is heold H Count source 01 f8 tal 2500 1 Setting counter value 1msec 20MHz 8 cpsrf 0 Setting clock prescaler reset flag 0 No effect tals 1 TimerAl count start while 1 REJ05B0607 0100 Rev 1 00 May 2005 Page 4 of 7 434 NE SAS M16C Tiny Series Operation of Timer A Timer Mode Gate Function 5 Reference Renesas Technology Corporation Home Page http www renesas com E mail Support E mail csc renesas com Hardware Manual M 16C 26 M 16C 26
2. and algorithms please be sure to evaluate all information as a total system before making a final decision on the applicability of the information and products Renesas Technology Corporation assumes no responsibility for any damage liability or other loss resulting from the information contained herein Renesas Technology 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 Renesas Technology Corporation or an authorized Renesas Technology Corporation 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 Renesas Technology Corporation is necessary to reprint or reproduce in whole or in part these materials If these products or technologies are subject to the Japanese export control restrictions 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 Renesas Technology Corporation for further details on these materials or the products contained therein REJ05B0607 0100 Rev 1 00 May 20
3. i 0 to 4 b7 bO j0 1 0 1 1 0 0 0 Ll TMOD1 TMODO Operation Mode Select Bit 00 Selection of timer mode MRO Pulse Output Function Select Bit 0 Pulse is not output TAiOUT pin is a normal port pin MR2 MR1 Gate Function Select Bit 11 Timer counts only when TAIIN pin is held H MR3 Set to 0 in timer mode TCK1 TCKO Count Source Select Bit Count Count source period 00 f1 or f2 source Xin 20MHz f Xcn 32 768kHz 01 f8 fj oe 50ns 10 f32 l fa Note 1 100ns 11 fca2 gous 1600ns 976 56ms Note 1 Count source is f2 if PCLKO bit in the PCLKR register is 0 2 Setting timer Ai register i 0 to 4 f1 if PCLKO bit in the PCLKR register is 1 b15 b8 b7 b0 b7 b0 L ca be set to 000016 to FFFF16 3 Setting clock prescaler reset flag This function is effective when fC32 is selected as the count source Reset the prescaler for generating fC32 by dividing the XCIN by 32 b7 bO L CPSR Clock Prescaler Reset Flag 0 No effect 1 Prescaler is reset When read the value is 0 4 Setting count start flag b7 bo E Timer AO Count Start Flag TAIS Timer A1 Count Start Flag TA2S Timer A2 Count Start Flag TA3S Timer A3 Count Start Flag TA4S Timer A4 Count Start Flag REJ05B0607 0100 Rev 1 00 May 2005 Page 3 of 7 434 NE SAS M16C Tiny Series Operation of Timer A Timer Mode Gate
4. 05 Page 7 of 7
5. 434 NE SAS APPLICATION NOTE M16C Tiny Series Operation of Timer A Timer Mode Gate Function 1 Abstract In timer mode choose functions from those listed in Table 1 Operations of the checked items are described below Table 1 Choosed Functions Item Set up Count source f1 or f2 Yes f8 f32 fC32 Pulse output function Yes No pulses output Pulses output Gate function No gate function Performs count only for the period in which the TAiy pin is at L level Yes Performs count only for the period in which the TAiiy pin is at H level 2 Introduction The explanation of this issue is applied to the following condition Applicable MCU M 16C 26 M 16C 26A M 16C 28 M 16C 29 Group This program can also be used when operating other microcomputers within the M 16C family provided they have the same SFR Special Function Registers as the M16C 26 M16C 26A M16C 28 M16C 29 microcomputers However some functions may have been modified Refer to the User s Manual for details Use functions covered in this Application Note only after careful evaluation 3 Operation of Timer A 1 When the count start flag is set to 1 and the TAiin pin inputs at H level the counter performs a down count on the count source 2 When the TAiin pin inputs at L level the counter holds its value and stops 3 If an underflow occurs the content of the reload registe
6. A M 16C 28 M 16C 29 Group Hardware Manual Use the latest version on the home page http www renesas com TECHNICAL UPDATE TECHNICAL NEWS Use the latest information on the home page http www renesas com REJ05B0607 0100 Rev 1 00 May 2005 Page 5 of 7 434 NE SAS REVISION HISTORY M16C Tiny Series Operation of Timer A Timer Mode Gate Function Rev Date Description Summary 1 00 2005 05 20 Page First edition issued REJ05B0607 0100 Rev 1 00 May 2005 Page 6 of 7 434 NE SAS M16C Tiny Series Operation of Timer A Timer Mode Gate Function Keep safety first in your circuit designs Renesas Technology Corporation puts the maximum effort into making semiconductor products better and more reliable but there is always the possibility that trouble may occur with them 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 substitutive auxiliary circuits ii use of nonflammable material or iii prevention against any malfunction or mishap Notes regarding these materials These materials are intended as a reference to assist our customers in the selection of the Renesas Technology Corporation product best suited to the customer s application they do not convey any license under any i
7. ntellectual property rights or any other rights belonging to Renesas Technology Corporation or a third party Renesas Technology Corporation assumes no responsibility for any damage or infringement of any third party s rights originating in the use of any product data diagrams charts programs algorithms or circuit application examples contained in these materials All information contained in these materials including product data diagrams charts programs and algorithms represents information on products at the time of publication of these materials and are subject to change by Renesas Technology Corporation without notice due to product improvements or other reasons It is therefore recommended that customers contact Renesas Technology Corporation or an authorized Renesas Technology Corporation product distributor for the latest product information before purchasing a product listed herein The information described here may contain technical inaccuracies or typographical errors Renesas Technology Corporation assumes no responsibility for any damage liability or other loss rising from these inaccuracies or errors Please also pay attention to information published by Renesas Technology Corporation by various means including the Renesas Technology Corporation Semiconductor home page http www renesas com When using any or all of the information contained in these materials including product data diagrams charts programs
8. r is reloaded and the count continues At this time thetimer Ai interrupt request bit goes to 1 4 Setting the count start flag to 0 causes the counter to hold its value and to stop Complement Make the pulse width of the signal input to the TAiin pin not less than two cycles of the count source Figure 1 shows the operation timing of timer mode gate function selected REJ05B0607 0100 Rev 1 00 May 2005 Page 1 of 7 RENESAS M16C Tiny Series Operation of Timer A Timer Mode Gate Function n reload register content 3 Underflow 4 FEFFie 1 Start count C Stop coin n 2 Stop count Counter content hex Set to 1 by program Set to 0 by program Count start flag TAIN pin input signal Set to O upon accepting an interrupt request or by writing in program Timer Ai interrupt 1 request bit 0 Figure 1 Operation Timing of Timer Mode Gate Function Selected REJ05B0607 0100 Rev 1 00 May 2005 Page 2 of 7 RENESAS M16C Tiny Series Operation of Timer A Timer Mode Gate Function 3 1 Register Setting To enable the operation defined in Section 3 Operation of timer A the following register settings must be taken place step by step For detail configuration of each register please refer to M 16C 26 Group hardware manual M 16C 26A Group hardware manual M16C 28 Group hardware manual M16C 29 Group hardware manual 1 Setting timer Ai mode register
Download Pdf Manuals
Related Search
Related Contents
Cerapur (ZWB 25-2C Acide ascorbique ADLER Legnopur 26211 suiv. - ADLER User Manual DP 30_42 Montaj ve Kullanım Kılavuzu C 150 C 155 DX 351-CT SCR Preselector-CAT manual Copyright © All rights reserved.
Failed to retrieve file