AT90S/LS2333 and AT90S/LS4433
64
Port C
Port C is a 6-bit bi-directional I/O port.
Three I/O memory address locations are allocated for the Port C, one each for the Data Register - PORTC, $15($35), Data
Direction Register - DDRC, $14($34) and the Port C Input Pins - PINC, $13($33). The Port C 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 C output buffers can sink 20mA and thus drive LED dis-
plays directly. When pins PC0 to PC5 are used as inputs and are externally pulled low, they will source current if the
internal pull-up resistors are activated.
Port C has an alternate function as analog inputs for the ADC. If some Port C pins are configured as outputs, it is essential
that these do not switch when a conversion is in progress. This might corrupt the result of the conversion.
During Power Down Mode, the schmitt triggers of the digital inputs are disconnected. This allows an analog voltage close
to V
CC
/2 to be present during power down without causing excessive power consumption.
Port C Data Register - PORTC
Port C Data Direction Register - DDRC
Port C Input Pins Address - PINC
The Port C Input Pins address - PINC - is not a register, and this address enables access to the physical value on each
Port C pin. When reading PORTC, the Port C Data Latch is read, and when reading PINC, the logical values present on the
pins are read.
Port C As General Digital I/O
All 6 pins in Port C have equal functionality when used as digital I/O pins.
PCn, General I/O pin: The DDCn bit in the DDRC register selects the direction of this pin, if DDCn is set (one), PCn is con-
figured as an output pin. If DDCn is cleared (zero), PCn is configured as an input pin. If PORTCn is set (one) when the pin
configured as an input pin, the MOS pull up resistor is activated. To switch the pull up resistor off, PORTCn has to be
cleared (zero) or the pin has to be configured as an output pin.The port pins are tristated when a reset condition becomes
active, even if the clock is not running
Bit
7
6
5
4
3
2
1
0
$15 ($35)
-
-
PORTC5
PORTC4
PORTC3
PORTC2
PORTC1
PORTC0
PORTC
Read/Write
R
R
R/W
R/W
R/W
R/W
R/W
R/W
Initial value
0
0
0
0
0
0
0
0
Bit
7
6
5
4
3
2
1
0
$14 ($34)
-
-
DDC5
DDC4
DDC3
DDC2
DDC1
DDC0
DDRC
Read/Write
R
R
R/W
R/W
R/W
R/W
R/W
R/W
Initial value
0
0
0
0
0
0
0
0
Bit
7
6
5
4
3
2
1
0
$13 ($33)
-
-
PINC5
PINC4
PINC3
PINC2
PINC1
PINC0
PINC
Read/Write
R
R
R
R
R
R
R
R
Initial value
Q
Q
Hi-Z
Hi-Z
Hi-Z
Hi-Z
Hi-Z
Hi-Z