1
votes

I have a problem with an arduino mega. I am playing with an SPI Bus.

If a connect MOSI to D11 pin, MISO on D12 and D13 on SCK, it does not work.

BUT, if i connect MOSI, MISO and SCK on the small connector (6 pins next CPU), everything works !

I do not understand why this 6 pins connector is connected to SPI whereas D11-D12-D13 are not connected.

Is there something to do (hardware/software) in order to activate spi bus on D11-D12-D13 pins ?

Thanks a lot

1

1 Answers

0
votes

According to the official Arduino SPI reference, you are using the wrong pins for Arduino Mega:

  • pin 51 or ICSP-4: MOSI
  • pin 50 or ICSP-1: MISO
  • pin 52 or ICSP-3: SCK
  • pin 53 : SS (slave)

Pins 11, 12 and 13 are used for Arduino Uno, 101, Duemilanove.


I conclude with two observations:

  • the ICSP header, shown in the following picture, is consistent among all boards. enter image description here
  • the board connections operate at different voltage levels, so it always a good idea to check the documentation before connecting any cable