| Electronic Components Datasheet Search |
|
ATtiny261A Datasheet(PDF) 109 Page - ATMEL Corporation |
|
|
|||||||||||||||||||||||||||||
ATtiny261A Datasheet(HTML) 109 Page - ATMEL Corporation |
|
109 / 292 page ![]() 109 8197A–AVR–10/09 ATtiny261A/461A/861A The following code examples show how to do an atomic write of the TCNT1 register contents. Writing any of the OCR1A/B/C/D registers can be done by using the same principle. Note: See “Code Examples” on page 6. The assembly code example requires that the r17:r16 register pair contains the value to be writ- ten to TCNT1. Assembly Code Example TIM1_WriteTCNT 1: ; Save global interrupt flag in r18,SREG ; Disable interrupts cli ; Set TCNT 1 to r17:r16 out TC 1H,r17 out TCNT 1,r16 ; Restore global interrupt flag out SREG,r18 ret C Code Example void TIM1_WriteTCNT1( unsigned int i ) { unsigned char sreg; unsigned int i; /* Save global interrupt flag */ sreg = SREG; /* Disable interrupts */ _CLI(); /* Set TCNT1 to i */ TC1H = (i >> 8); TCNT1 = (unsigned char)i; /* Restore global interrupt flag */ SREG = sreg; } |
|
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 |