Instructions
302Libraries
© 2013 Conrad Electronic
input then the pull-up resistor (Reference Level VCC) is activated and the input is defined.
Atmel AVR32Bit
The Atmel AVR32Bit provides the ports A to D, which are each 32 bits in width. Each bit of every
port can be configured as input or output. In addition, it is possible to enable a pullup, pulldown, and
adjust the drive strength. The functions Port_DataDir, Port_Toggle and Port_Write known by the At-
mel Mega were omitted at the AVR32Bit, since in practice working with the complete 32-bit port is
very unwieldy.
It is important to study the pin assignment before programming, as important peripheral func-
tions lie on certain ports. When these ports are reprogrammed, it may happen that the development
environment can no longer transmit programs to the C-Control Pro.
Use the Port_Attribute function at the AVR32Bit instead of Port_DataDirBit to switch between
input and output.
If a function such as a PWM is used only temporarily on a port pin, it is usually recommended
to set the pin later to a defined level with Port_Attribute, after the function is no longer used.
5.18.1 Port_Attribute
Port Functions
Syntax
void Port_Attribute(byte portbit, word attribute);
Sub Port_Attribute(portbit As Byte, attribute As Word)
Description
The function Port_Attribute configures the properties of a port. Multiple attribute values can be or'ed. See
Example.
Parameter
portbit port bit number (see Port Table)
attribute Portbit Attribute
Attribut Table
Function
Definition
Value (Hex)
Port set to Input
PORT_ATTR_INPUT
00
Port set to Output
PORT_ATTR_OUTPUT
01
set output low
PORT_ATTR_INIT_LOW
00
set output high
PORT_ATTR_INIT_HIGH
02
set PullUp
PORT_ATTR_PULL_UP
04