AT90S8515

Manufacturer Part NumberAT90S8515
Description8-bit microcontroller with 8K bytes in-system programmable flash, 2.7-6.0V
ManufacturerATMEL Corporation
AT90S8515 datasheet
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Page 61
62
Page 62
63
Page 63
64
Page 64
65
Page 65
66
Page 66
67
Page 67
68
Page 68
69
Page 69
70
Page 70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
Page 65/112:

Port B

Download datasheet (3Mb)Embed
PrevNext

Port B

Port B Data Register – PORTB
Port B Data Direction Register
– DDRB
Port B Input Pins Address –
PINB
0841G–09/01
Port B is an 8-bit bi-directional I/O port.
Three I/O memory address locations are allocated for the Port B, one each for the Data
Register – PORTB, $18($38), Data Direction Register – DDRB, $17($37) and the Port B
Input Pins – PINB, $16($36). The Port B Input Pins address is read-only, while the Data
Register and the Data Direction Register are read/write.
All port pins have individually selectable pull-up resistors. The Port B output buffers can
sink 20 mA and thus drive LED displays directly. When pins PB0 to PB7 are used as
inputs and are externally pulled low, they will source current if the internal pull-up resis-
tors are activated.
The Port B pins with alternate functions are shown in Table 20.
Table 20. Port B Pin Alternate Functions
Port Pin
Alternate Functions
PB0
T0 (Timer/Counter 0 External Counter Input)
PB1
T1 (Timer/Counter 1 External Counter Input)
PB2
AIN0 (Analog Comparator positive input)
PB3
AIN1 (Analog Comparator negative input)
SS
PB4
(SPI Slave Select Input)
PB5
MOSI (SPI Bus Master Output/Slave Input)
PB6
MISO (SPI Bus Master Input/Slave Output)
PB7
SCK (SPI Bus Serial Clock)
When the pins are used for the alternate function, the DDRB and PORTB registers have
to be set according to the alternate function description.
Bit
7
6
5
$18 ($38)
PORTB7
PORTB6
PORTB5
Read/Write
R/W
R/W
R/W
Initial Value
0
0
0
Bit
7
6
5
$17 ($37)
DDB7
DDB6
DDB5
Read/Write
R/W
R/W
R/W
Initial Value
0
0
0
Bit
7
6
5
$16 ($36)
PINB7
PINB6
PINB5
Read/Write
R
R
R
Initial Value
N/A
N/A
N/A
The Port B Input Pins address (PINB) is not a register; this address enables access to
the physical value on each Port B pin. When reading PORTB, the Port B Data Latch is
read and when reading PINB, the logical values present on the pins are read.
AT90S8515
4
3
2
1
PORTB4
PORTB3
PORTB2
PORTB1
R/W
R/W
R/W
R/W
0
0
0
0
4
3
2
1
DDB4
DDB3
DDB2
DDB1
R/W
R/W
R/W
R/W
0
0
0
0
4
3
2
1
PINB4
PINB3
PINB2
PINB1
R
R
R
R
N/A
N/A
N/A
N/A
0
PORTB0
PORTB
R/W
0
0
DDB0
DDRB
R/W
0
0
PINB0
PINB
R
N/A
65