background image

 

 

 

Disclaimer 

Headquarters  

International 

 

 

Atmel Corporation

 

2325 Orchard Parkway

 

San Jose, CA 95131

 

USA

 

Tel: 1(408) 441-0311

 

Fax: 1(408) 487-2600

 

 

 

Atmel Asia

 

Room 1219

 

Chinachem Golden Plaza

 

77 Mody Road Tsimshatsui

 

East Kowloon

 

Hong Kong

 

Tel: (852) 2721-9778

 

Fax: (852) 2722-1369

 

 

 
 
 
 
 
Product Contact

 

 

Atmel Europe

 

Le Krebs

 

8, Rue Jean-Pierre Timbaud

 

BP 309

 

78054 Saint-Quentin-en-
Yvelines Cedex

 

France

 

Tel: (33) 1-30-60-70-00 

 

Fax: (33) 1-30-60-71-11

 

 

Atmel Japan

 

9F, Tonetsu Shinkawa Bldg.

 

1-24-8 Shinkawa

 

Chuo-ku, Tokyo 104-0033

 

Japan

 

Tel: (81) 3-3523-3551

 

Fax: (81) 3-3523-7581

 

 

 

Web Site

 

www.atmel.com

 

 

Technical Support

 

[email protected]

 

 

Sales Contact

 

www.atmel.com/contacts

 

 

 
 

 

Literature Request

 

www.atmel.com/literature

 

 

 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Disclaimer:

 The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any 

intellectual property right is granted by this document or in connection with the sale of Atmel products. 

EXCEPT AS SET FORTH IN ATMEL’S TERMS AND 

CONDITIONS OF SALE LOCATED ON ATMEL’S WEB SITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED 
OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, 
FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, 
CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDENTAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, 
BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS 
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

 Atmel makes no representations or warranties with respect to the accuracy or completeness of the 

contents of this document and reserves the right to make changes to specifications and product descriptions at any time without notice. Atmel does not make any 
commitment to update the information contained herein. Unless specifically provided otherwise, Atmel products are not suitable for, and shall not be used in, 
automotive applications. Atmel’s products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life. 

 
 
 

© 2008 Atmel Corporation. All rights reserved

. Atmel®, logo and combinations thereof, AVR® and others, are the registered trademarks or 

trademarks of Atmel Corporation or its subsidiaries. Other terms and product names may be trademarks of others. 

 

 

8045A-AVR-02/08 

Summary of Contents for AVR1306

Page 1: ...ch Timer 1 Double buffered 32 bit operation with 32 bit input capture by timer cascading Event counter Timer overflow and error interrupts and events Input capture interrupts and events 1 Introduction...

Page 2: ...to I O pin Typical applications include Timing Periodic interrupt event generation Pulse Width Modulation Event time stamping Event counting Signal parameter measurements Period duty cycle etc 3 1 Tim...

Page 3: ...ed TC_CSEL_DIV1_gc fCLK SYS TC_CSEL_DIV2_gc fCLK SYS 2 TC_CSEL_DIV4_gc fCLK SYS 4 TC_CSEL_DIV8_gc fCLK SYS 8 TC_CSEL_DIV64_gc fCLK SYS 64 TC_CSEL_DIV256_gc fCLK SYS 256 TC_CSEL_DIV1024_gc fCLK SYS 102...

Page 4: ...ister CCxBUF H L Double buffered registers are covered in detail in section 3 7 When used for input capture the value of the PER register determines how input capture values are interpreted If bit 15...

Page 5: ...h buffer register has a related buffer valid flag in the CTRLE register The buffer valid flag is set when a new value is written to the corresponding buffer register The flag is cleared when the buffe...

Page 6: ...the counter value while the counter is running is allowed The write access has higher priority than count clear or reload and will be immediate However if the value written is outside the BOTTOM TOP...

Page 7: ...s Figure 3 4 shows in this mode of operation the counter counts from BOTTOM to TOP then restarts from BOTTOM The waveform generator output is set on the compare match between the count and compare reg...

Page 8: ...hown in Figure 3 5 The counter counts repeatedly from BOTTOM to TOP and then to BOTTOM When the counter hits BOTTOM or TOP the counter changes direction immediately holding the BOTTOM and TOP values f...

Page 9: ...pdate command only has effect on the PERBUF PER registers See section 3 7 for more information about double buffered registers 3 9 2 Force Restart The Force restart command clears the CNT H L register...

Page 10: ...apshot of the 16 bit CNT H L value at the time CNTL was read Figure 4 1 16 bit read access CNTH CNTL TEMP Rn CNTH CNTL TEMP R n 1 Rn R n 1 1 2 4 2 16 bit Write Figure 4 2 illustrates how to perform a...

Page 11: ...tes the write operation by writing to CNTH causing the corrupted low byte to be transferred from TEMP to CNTL There are two possible solutions to this problem 1 Make sure that every 16 bit access is p...

Page 12: ...ded in this way Figure 5 1 Cascading two 16 bit Timer Counter modules TCC1H TCC1L TCC0H TCC0L High word Overflow OVF EVMUX0 Low word OVF Clock signal for high word T C 5 2 Accessing the 32 bit Value W...

Page 13: ...nterrupt event occurs 2 Start TC by selecting a clock source CLKSEL in CTRLA In this configuration the current timer value can be read directly from the CNT H L register The TC overflow bit indicates...

Page 14: ...ite the new compare value to CCA H L 8 Wait for the TC Overflow Flag to be set OVFIF in INTFLAGS 9 Clear the TC Overflow flag 10 Go to step 6 Using this sequence the compare value will be updated once...

Page 15: ...register 11 Read high word input capture value from the TCC1 CCA H L register 12 Combine low word and high word to a 32 bit input capture value 13 Go to step 9 7 Advanced Features In this application...

Page 16: ...ten in ANSI C and should compile on all compilers with XMEGA support Note that this driver is not written with high performance in mind It is designed as a library to get started with the XMEGA Timer...

Page 17: ...ARRANTY RELATING TO ITS PRODUCTS INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTY OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE OR NON INFRINGEMENT IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIR...

Reviews: