Skip to content

Commit 1e45c14

Browse files
authored
Update content.md
Re-ordered section under 'DDR and PORT registers may be both written to, and read. PIN registers correspond to the state of inputs and may only be read.'
1 parent c9e80d3 commit 1e45c14

File tree

1 file changed

+8
-8
lines changed
  • content/retired/08.hacking/01.software/PortManipulation

1 file changed

+8
-8
lines changed

content/retired/08.hacking/01.software/PortManipulation/content.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@ Each port is controlled by three registers, which are also defined variables in
1616

1717
DDR and PORT registers may be both written to, and read. PIN registers correspond to the state of inputs and may only be read.
1818

19-
**PORTD** maps to Arduino digital pins 0 to 7
20-
21-
DDRD - The Port D Data Direction Register - read/write
22-
23-
PORTD - The Port D Data Register - read/write
24-
25-
PIND - The Port D Input Pins Register - read only
26-
2719
**PORTB** maps to Arduino digital pins 8 to 13 The two high bits (6 & 7) map to the crystal pins and are not usable
2820

2921
DDRB - The Port B Data Direction Register - read/write
@@ -40,6 +32,14 @@ PORTC - The Port C Data Register - read/write
4032

4133
PINC - The Port C Input Pins Register - read only
4234

35+
**PORTD** maps to Arduino digital pins 0 to 7
36+
37+
DDRD - The Port D Data Direction Register - read/write
38+
39+
PORTD - The Port D Data Register - read/write
40+
41+
PIND - The Port D Input Pins Register - read only
42+
4343
Each bit of these registers corresponds to a single pin; e.g. the low bit of DDRB, PORTB, and PINB refers to pin PB0 (digital pin 8). For a complete mapping of Arduino pin numbers to ports and bits, see the diagram for your chip: [ATmega8](/hacking/hardware/PinMapping), [ATmega168](/hacking/hardware/PinMapping168). (Note that some bits of a port may be used for things other than i/o; be careful not to change the values of the register bits corresponding to them.)
4444

4545
## Examples

0 commit comments

Comments
 (0)