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