參數(shù)資料
型號(hào): R5F64212KFB
元件分類: 微控制器/微處理器
英文描述: 32-BIT, FLASH, 64 MHz, MICROCONTROLLER, PQFP100
封裝: 14 X 14 MM, 0.50 MM PITCH, PLASTIC, LQFP-100
文件頁數(shù): 20/50頁
文件大?。?/td> 777K
代理商: R5F64212KFB
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描述
R5F64210LFB 32-BIT, FLASH, 64 MHz, MICROCONTROLLER, PQFP100
R5F6421EKFB 32-BIT, FLASH, 64 MHz, MICROCONTROLLER, PQFP100
R5F64212JFB 32-BIT, FLASH, 64 MHz, MICROCONTROLLER, PQFP100
R5F64210KFB 32-BIT, FLASH, 64 MHz, MICROCONTROLLER, PQFP100
R5F6421GJFB 32-BIT, FLASH, 64 MHz, MICROCONTROLLER, PQFP100
相關(guān)代理商/技術(shù)參數(shù)
參數(shù)描述
R5F64212LFB 制造商:RENESAS 制造商全稱:Renesas Technology Corp 功能描述:RENESAS MCU
R5F64213JFB 制造商:RENESAS 制造商全稱:Renesas Technology Corp 功能描述:RENESAS MCU
R5F64213KFB 制造商:RENESAS 制造商全稱:Renesas Technology Corp 功能描述:RENESAS MCU
R5F64213LFB 制造商:RENESAS 制造商全稱:Renesas Technology Corp 功能描述:RENESAS MCU
R5F64216JFB 制造商:RENESAS 制造商全稱:Renesas Technology Corp 功能描述:RENESAS MCU