Instructions

306Libraries
© 2013 Conrad Electronic
port port number (see Port Table)
5.18.8 Port_Write (Mega)
Port Functions Example
Syntax
void Port_Write(byte port, byte val);
Sub Port_Write(port As Byte, val As Byte)
Description
Writes a byte to the specified port. Only the Pins of port that are configured for output will show their value
as port output on their bit position (see Pin Assignment of M32 and M128). Is a Pin configured as input,
this will set an internal pull-up resistor on (bit = 1) or off (bit = 0). See Pin Assignment of M32 and
M128.
In older IDE versions PORT_ON and PORT_OFF were incorrectly defined, which is now correc-
ted.
Parameter
port port number (see Port Table)
val output byte
5.18.9 Port_WriteBit
Port Functions
Syntax
void Port_WriteBit(byte portbit, byte val);
Sub Port_WriteBit(portbit As Byte, val As Byte)
Description
The function Port_WriteBit sets the value of a Pin that is configured for output. Is a Pin configured as in-
put, a Port_WriteBit() will set an internal pull-up resistor on (bit = 1) or off (bit = 0). See Pin Assign-
ment of AVR32, M32 and M128.
Port Bit access is always significant slower than the normal Port access that transfers 8 Bit. If the de-
sired values of all Port Bits are known, 8-Bit Port access is always preferable.
At the C-Control Pro AVR32Bit the internal pullup is switched with the command Port_Attribute.
In older IDE versions PORT_ON and PORT_OFF were incorrectly defined, which is now correc-