参数资料
型号: R5F2138CFJFP
元件分类: 微控制器/微处理器
英文描述: FLASH, 20 MHz, MICROCONTROLLER, PQFP80
封装: 12 X 12 MM, 0.50 MM PITCH, PLASTIC, LQFP-80
文件页数: 6/30页
文件大小: 483K
代理商: R5F2138CFJFP
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
相关PDF资料
PDF描述
R5F2138CHJFP FLASH, 20 MHz, MICROCONTROLLER, PQFP80
R5F2138AFJFP FLASH, 20 MHz, MICROCONTROLLER, PQFP80
R5F2138CCNFP 8-BIT, FLASH, 20 MHz, MICROCONTROLLER, PQFP80
R5F21386CNFP 8-BIT, FLASH, 20 MHz, MICROCONTROLLER, PQFP80
R5F213G1DDSP 8-BIT, FLASH, 20 MHz, MICROCONTROLLER, PDSO24
相关代理商/技术参数
参数描述
R5F2138CMDFD 制造商:RENESAS 制造商全称:Renesas Technology Corp 功能描述:The R8C/38M Group has data flash (1 KB × 4 blocks) with the background operation
R5F2138CMDFP 制造商:RENESAS 制造商全称:Renesas Technology Corp 功能描述:The R8C/38M Group has data flash (1 KB × 4 blocks) with the background operation
R5F2138CMDFP#30 制造商:Renesas Electronics Corporation 功能描述:IC MCU 16BIT 128KB FLASH 80LQFP
R5F2138CMDFP#V0 制造商:Renesas Electronics Corporation 功能描述:IC MCU 16BIT 128KB FLASH 80LQFP
R5F2138CMDXXXFD 制造商:RENESAS 制造商全称:Renesas Technology Corp 功能描述:The R8C/38M Group has data flash (1 KB × 4 blocks) with the background operation