參數(shù)資料
型號(hào): MR80C32-20/883:D
廠商: ATMEL CORP
元件分類: 微控制器/微處理器
英文描述: 8-BIT, 20 MHz, MICROCONTROLLER, CQCC44
封裝: LCC-44
文件頁(yè)數(shù): 20/103頁(yè)
文件大?。?/td> 25028K
116
8272E–AVR–04/2013
ATmega164A/PA/324A/PA/644A/PA/1284/P
The following code examples show how to do an atomic write of the TCNTn Register contents.
Writing any of the OCRnA/B/C or ICRn Registers can be done by using the same principle.
Note:
1. The example code assumes that the part specific header file is included.
For I/O Registers located in extended I/O map, “IN”, “OUT”, “SBIS”, “SBIC”, “CBI”, and “SBI”
instructions must be replaced with instructions that allow access to extended I/O. Typically
“LDS” and “STS” combined with “SBRS”, “SBRC”, “SBR”, and “CBR”.
The assembly code example requires that the r17:r16 register pair contains the value to be writ-
ten to TCNTn.
16.3.1
Reusing the Temporary High Byte Register
If writing to more than one 16-bit register where the high byte is the same for all registers written,
then the high byte only needs to be written once. However, note that the same rule of atomic
operation described previously also applies in this case.
16.4
Timer/Counter Clock Sources
The Timer/Counter can be clocked by an internal or an external clock source. The clock source
is selected by the Clock Select logic which is controlled by the Clock Select (CSn2:0) bits
located in the Timer/Counter control Register B (TCCRnB). For details on clock sources and
Assembly Code Example
TIM16_WriteTCNT
n:
; Save global interrupt flag
in
r18,SREG
; Disable interrupts
cli
; Set TCNT
n to r17:r16
out
TCNT
nH,r17
out
TCNT
nL,r16
; Restore global interrupt flag
out
SREG,r18
ret
C Code Example
void
TIM16_WriteTCNT
n( unsigned int i )
{
unsigned char
sreg;
unsigned int
i;
/* Save global interrupt flag */
sreg = SREG;
/* Disable interrupts */
_CLI();
/* Set TCNT
n to i */
TCNT
n = i;
/* Restore global interrupt flag */
SREG = sreg;
}
相關(guān)PDF資料
PDF描述
MR80C32-36:RD 8-BIT, 36 MHz, MICROCONTROLLER, CQCC44
MQ80C32E-30/883:RD 8-BIT, 30 MHz, MICROCONTROLLER, CQFP44
MC80C32E-36/883 8-BIT, 36 MHz, MICROCONTROLLER, CDIP40
MC80C52TXXX-36/883:D 8-BIT, MROM, 36 MHz, MICROCONTROLLER, CDIP40
MD80C52TXXX-30SHXXX:D 8-BIT, MROM, 30 MHz, MICROCONTROLLER, CDIP40
相關(guān)代理商/技術(shù)參數(shù)
參數(shù)描述
MR80C32-25 制造商:未知廠家 制造商全稱:未知廠家 功能描述:8-Bit Microcontroller
MR80C32-30 制造商:未知廠家 制造商全稱:未知廠家 功能描述:8-Bit Microcontroller
MR80C32-36 制造商:未知廠家 制造商全稱:未知廠家 功能描述:8-Bit Microcontroller
MR80C51BH 制造商:ROCHESTER 制造商全稱:ROCHESTER 功能描述:CMOS SINGLE - CHIP 8-BIT MICROCOMPUTER 64K program Memory Space
MR80C86 制造商:INTERSIL 制造商全稱:Intersil Corporation 功能描述:CMOS 16-Bit Microprocessor