Arduino beginners often face compatibility problems between UNO and MEGA board. The truth is that the UNO and MEGA board are not compatible with each other in some ways, for example, UNO SPI port pins are 10,11,12,13, and I2C port pins are A4, A5, while Mega board SPI port pins are 50,51,52,53, and I2C port pins are 20,21. Actually the UNO and MEGA boards made some changes from the R0 version to the R3 version to make the I2C interface compatible.

ArduCAM shield uses a hardware I2C interface, which is A4(SDA), A5(SCL) on the UNO board, and 20(SDA),21(SCL) on the MEGA board. Arduino UNO R3 and MEGA2560 R3 add additional pins for the I2C interface but the R0 version doesn’t.
If you have MEGA 2560 R0 or R2 version, you have to re-wire the I2C and make some changes in the sketch.

Mega2560_I2C_rewire-1
Mega2560_I2C_rewire-2

The sketch should be modified as follows:

void Setup()
{
  ....
  pinMode(A4, INPUT);
  pinMode(A5, INPUT);
  ...
}

ArduCAM shield use hardware SPI interface for SD/TF read and write, which is 10(SS),11(MOSI),12(MISO),13(SCK) on UNO board. But on the MEGA2560 board, they are 53(SS),51(MOSI),50(MISO),52(SCK). When ArduCAM shield used on MEGA board, the user should use software SPI, changes should be made as follows:

Open the file …\Arduino\libraries\SD\utility\Sd2Card.h and changed “#define MEGA_SOFT_SPI 0” to “#define MEGA_SOFT_SPI 1”. Then added “pinMode(53, OUTPUT); in the Setup() function.

0
Your Cart is empty!

It looks like you haven't added any items to your cart yet.

Browse Products