Go Down

Topic: using internal pullup resistors (Read 940 times) previous topic - next topic

drspectro

This is the schematic for LadyAda's Boarduino, but the pin references are the same.

http://www.ladyada.net/media/boarduino/usbboarduinosch.png

rodmac

drspectro: That schematic looks a lot like the one I have for my freeduino board, but with different pin numbers. But unless I am missing something here, these  only show how to physically connect to the analog or serial pins, and these are not the pin numbers I have a problem with.

The pin numbers I'm talking about are the "imaginary" ones I need to put into the code of an arduino sketch to address the correct "real" (electrical) connection on the board. I'm surprised that I can't seem to find a cross-reference for this anywhere.

Maybe I'm missing something obvious (wouldn't be the first time) because lots of people have made these things work.

To put the question another way: For example, what pin number do I use in a line of code if I want the result to appear on digital pin 0 of my board?

halley

#7
Jan 30, 2009, 03:17 pm Last Edit: Jan 30, 2009, 03:19 pm by halley Reason: 1
Look at the far right edge of this schematic for the Duemilanove.  You see the jumpers with their silkscreen names there.  And you can trace back to the pin numbers of the ATmega168 package.

http://arduino.cc/en/uploads/Main/arduino-duemilanove-schematic.pdf

The jumper that's not labeled is the six ADC pins, and you see their A0-A5 numbers in the ATMEGA8 [sic] part box.

retrolefty

"The pin numbers I'm talking about are the "imaginary" ones I need to put into the code of an arduino sketch to address the correct "real" (electrical) connection on the board. I'm surprised that I can't seem to find a cross-reference for this anywhere."

The concept of using 'virtual pin numbers' Vs physical package pin numbers is so that the software functions can stay consistent and internal software mapping functions can resolve the hardware differences between many otherwise software compatible AVR microprocessors.

Otherwise one would have to modify or load a completely different version of the Arduino IDE for each different board if it used a different mega chip.

Some people use the term 'leg number' when they are referring to the physical chip's pin numbers and 'pin numbers' when referring to the software virtual pin number. It may be confusing when first learning but in the long run it makes things a lot more easy to use and less to memorize when working with different versions of the AVR mega series. Most designers of Arduino boards label the 'virtual pin names' near the connector pins, so that one doesn't really need to know what physical pin number (leg number') that it routes to. One really only has to deal with this if there are building there own board from scratch.

Lefty


Go Up