參數(shù)資料
型號(hào): MR80C154-L16/883R
廠商: ATMEL CORP
元件分類: 微控制器/微處理器
英文描述: 8-BIT, 16 MHz, MICROCONTROLLER, CQCC44
封裝: LCC-44
文件頁數(shù): 3/14頁
文件大?。?/td> 61013K
代理商: MR80C154-L16/883R
100
ATmega165A/PA/325A/PA/3250A/PA/645A/P/6450A/P [DATASHEET]
8285E–AVR–02/2013
The following code examples show how to access the 16-bit Timer Registers assuming that no interrupts updates
the temporary register. The same principle can be used directly for accessing the OCR1A/B and ICR1 Registers.
Note that when using “C”, the compiler handles the 16-bit access.
Note:
The assembly code example returns the TCNT1 value in the r17:r16 register pair.
It is important to notice that accessing 16-bit registers are atomic operations. If an interrupt occurs between the two
instructions accessing the 16-bit register, and the interrupt code updates the temporary register by accessing the
same or any other of the 16-bit Timer Registers, then the result of the access outside the interrupt will be corrupted.
Therefore, when both the main code and the interrupt code update the temporary register, the main code must dis-
able the interrupts during the 16-bit access.
The following code examples show how to do an atomic read of the TCNT1 Register contents. Reading any of the
OCR1A/B or ICR1 Registers can be done by using the same principle.
Assembly code examples (1)
...
; Set TCNT
1 to 0x01FF
ldi
r17,0x01
ldi
r16,0xFF
out
TCNT
1H,r17
out
TCNT
1L,r16
; Read TCNT
1 into r17:r16
in
r16,TCNT
1L
in
r17,TCNT
1H
...
C code examples (1)
unsigned int
i;
...
/* Set TCNT
1 to 0x01FF */
TCNT
1 = 0x1FF;
/* Read TCNT
1 into i */
i = TCNT
1;
...
相關(guān)PDF資料
PDF描述
MQ83C154CXXX-L16P883R 8-BIT, MROM, 16 MHz, MICROCONTROLLER, CQFP44
MR83C154CXXX-20P883R 8-BIT, MROM, 20 MHz, MICROCONTROLLER, CQCC44
MR83C154TXXX-20/883D 8-BIT, MROM, 20 MHz, MICROCONTROLLER, CQCC44
MQ83C154TXXX-L16/883D 8-BIT, MROM, 16 MHz, MICROCONTROLLER, CQFP44
MQ80C154-25/883R 8-BIT, 25 MHz, MICROCONTROLLER, CQFP44
相關(guān)代理商/技術(shù)參數(shù)
參數(shù)描述
MR80C31BH 制造商:ROCHESTER 制造商全稱:ROCHESTER 功能描述:CMOS SINGLE - CHIP 8-BIT MICROCOMPUTER 64K program Memory Space
MR80C31BH/B 制造商:n/a 功能描述:8506401XA
MR80C31BHB 制造商:n/a 功能描述:8506401XA
MR80C32-16 制造商:未知廠家 制造商全稱:未知廠家 功能描述:8-Bit Microcontroller
MR80C32-20 制造商:未知廠家 制造商全稱:未知廠家 功能描述:8-Bit Microcontroller