Go Down

Topic: Is their any difference in the connections? (Read 279 times) previous topic - next topic

Hutzpah

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/

sterretje

#1
Dec 15, 2018, 05:11 am Last Edit: Dec 15, 2018, 05:12 am by sterretje
OP's attachement


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.
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

Hutzpah

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

Whandall

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.
Ah, this is obviously some strange usage of the word 'safe' that I wasn't previously aware of. (D.Adams)

Hutzpah

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.


Go Up