Instructions

304Libraries
© 2013 Conrad Electronic
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.
Parameter
portbit port bit number (see Port Table)
val 0=Input, 1= Output
5.18.4 Port_Read (Mega)
Port Functions
Syntax
byte Port_Read(byte port);
Sub Port_Read(port As Byte) As Byte
Description
Reads a byte from the specified port. Only the Pins of port that are configured for input return a valid value
on their bit position (see Pin Assignment of M32 and M128).
Parameter
port port number (see Port Table)
Return Parameter
port byte value
5.18.5 Port_ReadBit
Port Functions
Syntax
byte Port_ReadBit(byte port);
Sub Port_ReadBit(port As Byte) As Byte
Description
The function Port_ReadBit reads the value of a Pin that is configured for input. (See Pin Assignment 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.