NEX Robotics
Note:
• 'X' represents port name – A, B, C, D, E, F, G, H, J, K, L.
• Tri-State is the floating pin condition.
• For more details, refer to ATMEGA2560 datasheet which is located in the "Datasheets"
folder in the documentation CD.
Example:
Make PORTA 0-3 bits as output and PORTA 4-7 bits input.
Add pull-up to pins PORTA 4 and PORTA 5.
Output of PORTA 0 and PORTA 2 = 1; PORT A 1 and PORT A 3 = 0;
Pin
PA7
DDRA
0 (i/p)
PORTA
0
Status
i/p
Floating
{
unsigned char k;
DDRA = 0x0F;
//Make PA4 to PA7 pins input and PA0 to PA3 pins output
PORTA = 0x35;
//Make PA7, PA6 floating; PA5, PA4 pulled-up; PA2, PA0 logic 0,
PA3, PA1 logic 1;
k = PINA;
//Reads all the data from PORTA
while (1);
}
All port pins have individually selectable pull-up resistors with a supply-voltage invariant
resistance. All I/O pins have protection diodes to both VCC and Ground as indicated in Figure.
www.nex-robotics.com
PA6
PA5
0 (i/p)
0 (i/p)
0
1 (↑)
i/p
i/p
Floating
Pull-up
Figure 3.1: I/O pin equivalent schematic.
Source: ATMEGA2560 datasheet
PA4
PA3
0 (i/p)
1 (o/p)
1 (↑)
0
i/p
o/p
Pull-up
Low
Table 3.3
Fire Bird V Software Manual
PA2
PA1
1 (o/p)
1 (o/p)
1
0
o/p
o/p
High
Low
PA0
1 (o/p)
1
o/p
High
48
Need help?
Do you have a question about the Fire Bird V ATMEGA2560 and is the answer not in the manual?