| Electronic Components Datasheet Search |
|
ATTINY817-MFR. Datasheet(PDF) 147 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
ATTINY817-MFR. Datasheet(HTML) 147 Page - Microchip Technology |
|
147 / 492 page ![]() 20.3.2 Initialization To start using the timer/counter in a basic mode, follow these steps: • Write a TOP value to the Period register (TCA.PER) • Enable the peripheral by writing a '1' to the ENABLE bit in the Control A register (TCA.CTRLA). The counter will start counting clock ticks according to the prescaler setting in the Clock Select bit field (CLKSEL) in TCA.CTRLA. • Optional: By writing a '1' to the Enable Count on Event Input bit (CNTEI) in the Event Control register (TCA.EVCTRL), Event inputs are counted instead of clock ticks. • The counter value can be read from the Counter bit field (CNT) in the Counter register (TCA.CNT). 20.3.3 Operation 20.3.3.1 Normal Operation In normal operation, the counter is counting clock ticks in the direction selected by the Direction bit (DIR) in the Control E register (TCA.CTRLE), until it reaches TOP or BOTTOM. The clock ticks are from the peripheral clock CLK_PER, optionally prescaled, depending on the Clock Select bit field (CLKSEL) in the Control A register (TCA.CTRLA). When up-counting and TOP is reached, the counter will wrap to zero at the next clock tick. When down- counting, the counter is reloaded with the Period register value (TCA.PER) when BOTTOM is reached. Figure 20-4. Normal Operation CNT written "update" CNT DIR MAX TOP BOTTOM It is possible to change the Counter value in the Counter register (TCA.CNT) when the counter is running. The write access to TCA.CNT has higher priority than count, clear, or reload, and will be immediate. The direction of the counter can also be changed during normal operation by writing to DIR in TCA.CTRLE. 20.3.3.2 Double Buffering The Period register value (TCA.PER) and the Compare n register values (TCA.CMPn) are all double buffered (TCA.PERBUF and TCA.CMPnBUF). Each buffer register has a Buffer Valid flag (PERBV, CMPnBV) in the Control F register (TCA.CTRLF), which indicates that the buffer register contains a valid, i.e. new, value that can be copied into the corresponding Period or Compare register. When the Period register and Compare n registers are used for a Compare operation, the BV flag is set when data is written to the buffer register, and cleared on an UPDATE condition. This is shown for a Compare register in below. ATtiny417/817 © 2017 Microchip Technology Inc. Datasheet Complete DS40001901B-page 147 |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |