參數(shù)資料
型號(hào): R5F2138AEJFP
元件分類: 微控制器/微處理器
英文描述: FLASH, 20 MHz, MICROCONTROLLER, PQFP80
封裝: 12 X 12 MM, 0.50 MM PITCH, PLASTIC, LQFP-80
文件頁(yè)數(shù): 6/30頁(yè)
文件大?。?/td> 483K
代理商: R5F2138AEJFP
64
ATmega165A/PA/325A/PA/3250A/PA/645A/P/6450A/P [DATASHEET]
8285E–AVR–02/2013
Figure 14-4. Synchronization when reading a software assigned pin value.
The following code example shows how to set port B pins 0 and 1 high, 2 and 3 low, and define the port pins from
4 to 7 as input with pull-ups assigned to port pins 6 and 7. The resulting pin values are read back again, but as pre-
viously discussed, a nop instruction is included to be able to read back the value recently assigned to some of the
pins.
Assembly code example
...
; Define pull-ups and set outputs high
; Define directions for port pins
ldi
r16,(1<<PB7)|(1<<PB6)|(1<<PB1)|(1<<PB0)
ldi
r17,(1<<DDB3)|(1<<DDB2)|(1<<DDB1)|(1<<DDB0)
out
PORTB,r16
out
DDRB,r17
; Insert nop for synchronization
nop
; Read port pins
in
r16,PINB
...
C code example
unsigned char
i;
...
/* Define pull-ups and set outputs high */
/* Define directions for port pins */
PORTB = (1<<PB7)|(1<<PB6)|(1<<PB1)|(1<<PB0);
DDRB = (1<<DDB3)|(1<<DDB2)|(1<<DDB1)|(1<<DDB0);
/* Insert nop for synchronization*/
__no_operation();
/* Read port pins */
i = PINB;
...
out PORTx, r16
nop
in r17, PINx
0xFF
0x00
0xFF
SYSTEM CLK
r16
INSTRUCTIONS
SYNC LATCH
PINxn
r17
t
pd
相關(guān)PDF資料
PDF描述
R5F2138CGKFP FLASH, 20 MHz, MICROCONTROLLER, PQFP80
R5F21388HKFP FLASH, 20 MHz, MICROCONTROLLER, PQFP80
R5F2138AFKFP FLASH, 20 MHz, MICROCONTROLLER, PQFP80
R5F2138AHJFP FLASH, 20 MHz, MICROCONTROLLER, PQFP80
R5F2138CFJFP FLASH, 20 MHz, MICROCONTROLLER, PQFP80
相關(guān)代理商/技術(shù)參數(shù)
參數(shù)描述
R5F2138AMDFD 制造商:RENESAS 制造商全稱:Renesas Technology Corp 功能描述:The R8C/38M Group has data flash (1 KB × 4 blocks) with the background operation
R5F2138AMDFP 制造商:RENESAS 制造商全稱:Renesas Technology Corp 功能描述:The R8C/38M Group has data flash (1 KB × 4 blocks) with the background operation
R5F2138AMDFP#V0 制造商:Renesas Electronics Corporation 功能描述:IC MCU 16BIT 96KB FLASH 80LQFP
R5F2138AMDXXXFD 制造商:RENESAS 制造商全稱:Renesas Technology Corp 功能描述:The R8C/38M Group has data flash (1 KB × 4 blocks) with the background operation
R5F2138AMDXXXFP 制造商:RENESAS 制造商全稱:Renesas Technology Corp 功能描述:The R8C/38M Group has data flash (1 KB × 4 blocks) with the background operation