Support » Programming Orangutans and the 3pi Robot from the Arduino Environment »
2. ATmega168/328-Arduino Pin Mapping
- 2.a. Orangutan SV-xx8 and LV-168 Pin Mappings
- 2.b. Baby Orangutan B Pin Mappings
- 2.c. 3pi Robot Pin Mappings
<p>In our standard Orangutan and 3pi documentation, we use the same convention that Atmel uses in its ATmega168/328 datasheet, referring to pins by their associated ports. For example, pin PD7 is pin 7 of port D. This convention is used because each port is controlled by its own AVR registers, and the bits of these registers correspond to individual pins.</p>
<p>The Arduino insulates the user from this level of detail, referring to the I/O pins as digital pins 0 to 13 and analog inputs 0 to 7. Note that this terminology can be a bit misleading since analog inputs 0 to 5 can also be used as general purpose digital I/O pins (referred to as digital pins 14 to 19).</p>
<p>You can visit <a href="http://www.arduino.cc/en/Hacking/PinMapping168">http://www.arduino.cc/en/Hacking/PinMapping168</a> to see exactly how the mega168/328 pins are mapped to Arduino pins. Note that this page shows a 28-pin DIP package chip while the Orangutans carry smaller 32-pin MLF packages that contain two additional dedicated analog inputs: ADC6 and ADC7. In the Arduino environment, these pins become arduino analog inputs 6 and 7, respectively. The following diagram comes from the page linked above:</p>
<table class="picture_with_caption center wide"><tr><td><img alt="" class="wide" data-gallery-pictures="[{"id":"0J735","caption":"\u003cp\u003eArduino pin mapping for the ATmega168.\u003c/p\u003e","url_tiny":"https://a.pololu-files.com/picture/0J735.98x98.jpg?4b37558ca0d47cdce48dce4384d41382","url_medium":"https://a.pololu-files.com/picture/0J735.600x480.jpg?4b37558ca0d47cdce48dce4384d41382","url_full":"https://a.pololu-files.com/picture/0J735.1200.png?4b37558ca0d47cdce48dce4384d41382","longest_side":600}]" data-picture-id="0J735" data-picture-longest_side="600" src="https://a.pololu-files.com/picture/0J735.600.png?4b37558ca0d47cdce48dce4384d41382" /></td><p></tr></table></p>