Playing with Arduino
A page to record my playing with Arduino
DDR

Abstract

The DDR(Data Direction Register)s are registers which determine if the digital pin is output mode or input mode. There are three registers called DDRB, DDRC and DDRD.

Source Code

The DDRB, DDRC and DDRD are defined in hardware/tools/avr/avr/include/avr/iom328p.h as below.

1
2
3
#define DDRB _SFR_IO8(0x04)
#define DDRC _SFR_IO8(0x07)
#define DDRD _SFR_IO8(0x0A)

0x04, 0x07, and 0x0A are I/O addresses of DDRB, DDRC and DDRD respectively. They call _SFR_IO8().

Version

Arduino 1.8.13/avr-gcc 7.3.0-atmel3.6.1-arduino

Last Update

June 19, 2020

inserted by FC2 system