| Motore di ricerca datesheet componenti elettronici |
|
ATtiny261A Scheda tecnica(PDF) 108 Page - ATMEL Corporation |
|
|
|||||||||||||||||||||||||||||
ATtiny261A Scheda tecnica(HTML) 108 Page - ATMEL Corporation |
|
108 / 292 page ![]() 108 8197A–AVR–10/09 ATtiny261A/461A/861A The following code examples show how to do an atomic read of the TCNT1 register contents. Reading 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 returns the TCNT1 value in the r17:r16 register pair. Assembly Code Example TIM1_ReadTCNT 1: ; Save global interrupt flag in r18,SREG ; Disable interrupts cli ; Read TCNT 1 into r17:r16 in r16,TCNT 1 in r17,TC 1H ; Restore global interrupt flag out SREG,r18 ret C Code Example unsigned int TIM1_ReadTCNT1( void ) { unsigned char sreg; unsigned int i; /* Save global interrupt flag */ sreg = SREG; /* Disable interrupts */ _CLI(); /* Read TCNT1 into i */ i = TCNT1; i |= ((unsigned int)TC1H << 8); /* Restore global interrupt flag SREG = sreg; return i; } |
|
Link URL |
| Lei ha avuto il aiuto da alldatasheet? [ DONATE ] |
Di alldatasheet | Richest di pubblicita | contatti | Privacy Policy | Collegamento alla scheda tecnica | scambio Link | Ricerca produttore 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 |