Arduino Forum

Using Arduino => Programming Questions => Topic started by: Hutzpah on Dec 15, 2018, 02:51 am

Title: Is their any difference in the connections?
Post by: Hutzpah on Dec 15, 2018, 02:51 am
I'm working on my first project and am having trouble uploading the sketch.
The project is built on an Arduino Uno but I am testing on a Mega 2560. Once working I will transfer to a nano.
Is their any difference in the connections?

Thanks

https://simple-circuit.com/arduino-weather-station-bme280-nokia-5110/
Title: Re: Is their any difference in the connections?
Post by: sterretje on Dec 15, 2018, 05:11 am
OP's attachement
(http://forum.arduino.cc/index.php?topic=585241.0)

Look at the pinouts (or schematics) for both Mega and Uno. The I2C pins are not on A4 and A5 on a Mega. On the header with the pins 8 to 13 are additional pins, two of them for the I2C interface. Those two signals are also available on pins 20 and 21.

Code: [Select]
S S                                                     S S
C D                                                     D C
L A                                                     A L
   
x x x x 1 1 1 1 0 0     0 0 0 0 0 0 0 0     1 1 1 1 1 1 2 2
        3 2 1 0 9 8     7 6 5 4 3 2 1 0     4 5 6 7 8 9 0 1


I think that on older Unos, the signals were only available on A4 and A5. For compatibility reasons the ones on the most left header were added in later versions (R3?).

Although I have done my best to not make mistakes in above 'drawing', please double check.
Title: Re: Is their any difference in the connections?
Post by: Hutzpah on Dec 15, 2018, 09:07 pm
Thanks you sterretje for all the information especially the comment
 "The I2C pins are not on A4 and A5 on a Mega."

I will do as you have said and study the pinouts. I will have to change the A4 and A5
once I find them in the code.

Hutzpah
Title: Re: Is their any difference in the connections?
Post by: Whandall on Dec 15, 2018, 09:13 pm
I will have to change the A4 and A5 once I find them in the code.
If you find references to A4 or A5 they are not connected to I2C (on an UNO),
but probably a problem for the usage of I2C.
Title: Re: Is their any difference in the connections?
Post by: Hutzpah on Dec 16, 2018, 07:29 am
I am well pleased my first project is working.
Thanks to the tutorial on simple-circuit.com.
A bit of a learning curve but I have managed with the help of this forum to get the very basics going.
 
Thanks again sterretje

PS: Added  pictures.
It looks a bit hairy but It works.