I2C / SPI UNO vrs MEGA.

Ran out of memory with the UNO. Had to move to the MEGA.

What is the deal with SPI and I2C moving to new pin on the board.

I have a RTC / SD shield for a UNO that I wanted to use.

I have UNO SPI PIN working with software SPI.

I still have to find a solution to I2C on the MEGA using the UNO pins. Is there a software lib for this also?

Why did they not just leave them where they were?

Robert Wynkoop

(deleted)

Have a read. Pg 32 for changes to use the mega.

https://cdn-learn.adafruit.com/downloads/pdf/adafruit-data-logger-shield.pdf#page31

The changes they make may be applicable for you. I cut the pins and soldered on fly leads on my shield.

G

rwynkoop: What is the deal with SPI and I2C moving to new pin on the board.

Presumably the designers of your RTC\SD Shield did not use the pins for SPI and I2C interfaces that are compatible between the UNO, Mega and Due bases.

You would have to ask them why they did that.

srnet: Presumably the designers of your RTC\SD Shield did not use the pins for SPI and I2C interfaces that are compatible between the UNO, Mega and Due bases.

Yes, my RTC/SD card does not use any of the special I2C / SPI pins. Older retired boards not have these pins, possibly the designer wanted to be compatible(at the time, 2012) with the older boards.

I''m really just trying to understand the connection between certain Analog/Digital pins and the special connections.

Why are the I2C / SPI connectors also mapped to specific analog / digital pins? Is this mapping between the I2C / SPI electrical or logical through software.

If one uses the I2C / SPI headers, do I still have to leave the A4,A5 and D11,12,13 free and unused?

spycatcher2k: Because they were never there!

Both the R3 Uno and R3 Mega have SPI and I2C connector. I'm wondering why they chose to map the connectors to different analog and digital pins on each board. Also, are the mapped pins usable when the I2C or SPI connectors are being used.

Robert Wynkoop

rwynkoop: I'm wondering why they chose to map the connectors to different analog and digital pins on each board.

The designers of the Arduino bases are resticted as they can only use pins in the way that the designer of the processors (Atmel) allows.

Are you actually wondering why, for academic interest, or are you suggesting there is a better way ?

srnet: The designers of the Arduino bases are resticted as they can only use pins in the way that the designer of the processors (Atmel) allows.

Are you actually wondering why, for academic interest, or are you suggesting there is a better way ?

I'm not sure I understand why the I2C and SPI connector are also mapped to certain pins on the UNO, then on the MEGA they go to different pins.

Not saying there is a better way, just not understanding why the I2C and SPI connectors do not map to the same pins on the arduino pinout.

Robert Wynkoop

rwynkoop: I'm not sure I understand why the I2C and SPI connector are also mapped to certain pins on the UNO, then on the MEGA they go to different pins.

As mentioned in #6.

The processors used are different, with different functions on the processors pins.

Study the datasheets of the appropriate processors for more information.

why they did that.

At the time when the MEGA was designed, the theory was that SPI was most universally accessible via the ISP connector (since MEGA has plenty of pins.)

At the time when most shields were designed, there were no standard I2C pin locations.

The SPI and I2C pin locations on Uno (and pre-Uno 28-pin AVR-based arduinos) is essentially accidental and due to an overall shortage of pins (ie: if you're going to have 6 analog inputs, you only have one choice of pins, and they happen to include the pins also used for I2C.)