Pages: [1]   Go Down
Author Topic: Incorrect pin mapping fro Mega2560  (Read 3511 times)
0 Members and 1 Guest are viewing this topic.
Australia
Offline Offline
Sr. Member
****
Karma: 10
Posts: 396
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi All,

On the web page "http://arduino.cc/en/Hacking/PinMapping2560" it shows pin Arduino pins 52 & 51 (Atmega pins 20 & 21) as SDA and SCL.

Digital pins 21 & 20 (Atmega pins 43 & 44) are also labeled SCL and SDA.

I assume that the latter ones are correct but correct me if I am wrong.

Either way it is a bit confusing.

Also TX3 and RX3 are shown as being on Atmega pins 14 & 15 however they look like they should be on Atmega pins 64 & 63.
TX2 and RX2 are on Atmega pins 16 & 17 when they should be on Atmega pins 13 & 12 . TX1 and RX1 are on Atmega pins 18 & 19 when they should be on Atmega pins 46 & 45.

Could the Jpeg of the pin mapping be in a format where it does not go illegible (with all that chequerboarding) when I copy it from the website to my harddrive?

Cheers

« Last Edit: December 20, 2011, 03:41:38 am by lemming » Logged

Colorado
Offline Offline
Edison Member
*
Karma: 47
Posts: 1562
Reviving dead brain cells with Arduinos.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It's not a JPEG image, it's a PNG.  You need to save it out as the proper format.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 508
Posts: 31416
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
it shows pin Arduino pins 52 & 51 (Atmega pins 20 & 21) as SDA and SCL.

Digital pins 21 & 20 (Atmega pins 43 & 44) are also labeled SCL and SDA.

No the I2C lines are on pins 20 & 21, where as the clock and data for the SPI interface are on pins 51 & 52, it might not be clear but it is not wrong.
Logged

Australia
Offline Offline
Sr. Member
****
Karma: 10
Posts: 396
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
No the I2C lines are on pins 20 & 21, where as the clock and data for the SPI interface are on pins 51 & 52, it might not be clear but it is not wrong.

The I2C lines (SDA & SCL) are on pins 20 & 21 and are labelled as such; "Digital pin 21 (SCL)" and "Digital pin 20 (SDA)".

Why then does the PNG also state "Digital pin 52 (PWM)(SDA)" next to Atmega pin 20 (SCK) and "Digital pin 51 (PWM)(SCL)" next to pin 21 (MOSI)?

Unless there are two SDA and two SCL, one of them must be wrong. (Most likely the latter).

Logged

Australia
Offline Offline
Sr. Member
****
Karma: 10
Posts: 396
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
It's not a JPEG image, it's a PNG.  You need to save it out as the proper format.

Thanks for that. A bad case of brain fade!

Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 508
Posts: 31416
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Looking at the data sheet gives you the definitive explanation, the diagram on the web page is the same as in the data sheet.
Quote
Unless there are two SDA and two SCL, one of them must be wrong. (Most likely the latter).

There is no error in either. The pins 44 & 45 have an explanation as:-

Quote
•   INT3/TXD1 – Port D, Bit 3
INT3, External Interrupt source 3: The PD3 pin can serve as an external interrupt source to the MCU.
TXD1, Transmit Data (Data output pin for the USART1). When the USART1 Transmitter is enabled, this pin is configured as an output regardless of the value of DDD3.
•   INT2/RXD1 – Port D, Bit 2
INT2, External Interrupt source 2. The PD2 pin can serve as an External Interrupt source to the MCU.
RXD1, Receive Data (Data input pin for the USART1). When the USART1 receiver is enabled this pin is configured as an input regardless of the value of DDD2. When the USART forces this pin to be an input, the pull-up can still be controlled by the PORTD2 bit.
Logged

Korea
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

see red text in pin map image. red text in atmega2560 pin 21 and 22 about SDA and SCL is wrong.

and pin numbers on top and bottom side of the png image are messy, but downloaded svg file is ok about pin numbers.

And table below the image has bugs too. All Arduino RXs and TXs are wrong.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 508
Posts: 31416
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
All Arduino RXs and TXs are wrong.
Quite simply no they are not.

TX and RX are defined differently depending on if the device is designated a data circuit-terminating equipment (DTE) or data-communication equipment (DCE)
See:-
http://en.wikipedia.org/wiki/Data_terminal_equipment
Logged

Korea
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you have Arduino Mega? Just SEE it.

Arduino pin 14 is TX3, Arduino pin 15 is RX3   

But in the table and pinmap image, TX3 is on the pin that doesn't mapped to Arduino Mega pin, it's on  Atmega2560 14 pin.

only TX0 and RX0 is right.  TX RX 1,2,3 is wrong.

Author of that document totally confused between Arduino pin and Atmega2560 pin.
Logged

North Queensland, Australia
Offline Offline
Edison Member
*
Karma: 53
Posts: 1782
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I use this chart, nice and easy.

Logged


Australia
Offline Offline
Sr. Member
****
Karma: 10
Posts: 396
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@ pYro_65
 You miss the point. We know that we can go elsewhere for the proper pinouts, but the point we make is that the official Arduino documentation is wrong and could mislead those take it for gospel. It should be corrected.

Quote
...pin numbers on top and bottom side of the png image are messy....

P.S. Would it be possible to clean up the pin numbering on the top side and bottom side of the chip in the PNG when the corrected version gets posted ?
« Last Edit: February 05, 2012, 08:52:21 pm by lemming » Logged

Australia
Offline Offline
Sr. Member
****
Karma: 10
Posts: 396
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@ Grumpy Mike

Quote
No the I2C lines are on pins 20 & 21, where as the clock and data for the SPI interface are on pins 51 & 52, it might not be clear but it is not wrong.

The diagram clearly shows 2 sets of I2C connections:

On pin 20 of the Atmega2560 chip it shows the Arduino designation as "Digital pin 52 (PWM)(SDA)"
On pin 21 of the Atmega2560 chip it shows the Arduino designation as "Digital pin 51 (PWM)(SCL)"

On pin 43 of the Atmega2560 chip it shows the Arduino designation as "Digital pin 21 (SCL)"
On pin 44 of the Atmega2560 chip it shows the Arduino designation as "Digital pin 20 (SDA)"

Therefore it indicates two sets of I2C connections for the Arduino Atmega2560. Either you have to argue that there are two sets of I2C connections for the Arduino Atmega2560 (good luck!) or that the diagram is wrong.

Why can't you see this?
« Last Edit: February 05, 2012, 08:54:43 pm by lemming » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 508
Posts: 31416
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Why can't you see this?
Because the terms SCL and SDA are not used exclusively to describe I2C pins.
They reffers to Serial Clock Line and Serial DAta, there is nothing in the convention that says these have to be I2C.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16514
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Why can't you see this?
Because the terms SCL and SDA are not used exclusively to describe I2C pins.
They reffers to Serial Clock Line and Serial DAta, there is nothing in the convention that says these have to be I2C.


Mike, the OP does have a valid point. Arduino pins 51 and 52 correspond to AVR mega2560 package pin
21 = PB2 (MOSI/PCINT2) and  pin 20 = PB1 (SCK/PCINT1) respectively. As MOSI and SCK are 'official' AVR names for two of the ICSP signals, there is no way they should be called out as SDA and SCL signals. The signals names SCL and SDA are not associated with those two pins in any AVR documentation. The 'official' Arduino schematic drawing for the Mega2560 does correctly call out these two pins as MOSI and SCK signals. As such the pin mapping document that the OP first posted is most definitely in error, and in conflict with both AVR datasheet and the Arduino mega2560 schematic drawing and should be corrected. But as with so many of the 'official' drawings, pictures, and written material in the arduino web site, getting anything corrected or updated seems to be an impossible task.

Lefty
« Last Edit: February 06, 2012, 10:31:37 am by retrolefty » Logged

North Queensland, Australia
Offline Offline
Edison Member
*
Karma: 53
Posts: 1782
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You miss the point. We know that we can go elsewhere for the proper pinouts, but the point we make is that the official Arduino documentation is wrong and could mislead those take it for gospel. It should be corrected.
Haha, no point to see.

Quite a few pages of the documentation is incorrect after the 1.0 upgrade.
Half a squillion post have been made about incorrect documentation with no response.
So I provided a simple and quick solution.
Logged


Pages: [1]   Go Up
Jump to: