Now that the Leonardo is out, I thought I would start to look at modifying the digitalWriteFast library to cover the new board. I ordered a board and it hasn't come yet, so I'm trying to sort out how it works from looking at /Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/variants/leonardo/pins_arduino.h
and the website. At http://arduino.cc/en/Hacking/PinMapping32u4 there is clearly an error:
29 (PCINT5/OC1A/#OC4B/ADC12) PB5 Digital Pin 9 (PWM)
30 (PCINT6/OC1B/OC4B/ADC13) PB6 Digital Pin 9 (PWM)
PB5 and PB6 are not both Digital Pin 9. From pins_arduino.h it looks like the second one should be digital pin 10.
Good find. You are correct - PB6 is Digital Pin 10. I've passed this up the chain.
Look at the picture at http://arduino.cc/en/Main/ArduinoBoardLeonardo. To the left of AREF at the top left corner are pins labeled SDA and SCL but without digital numbers. Now look at http://arduino.cc/en/Hacking/PinMapping32u4 again. That would say that SDA and SCL are mapped to Digital 2 and 3. Are those 2 pairs of headers pins actually just connected together? That seems to be what the documentation says.
The schematic at http://arduino.cc/en/uploads/Main/arduino-leonardo-schematic_3b.pdf seems to show both sets of header pins connected to the same signals. This surprises me and suggests unique ways to short things out. Am I misunderstanding?
It appears that D2/3 and SDA/SCL are one and the same, just duplicated on the headers. Presumably because one day (with another processor maybe) the I2C signals will be on different pins so it makes sense to give them their own sockets even though on this board they are duplicated. This will break any existing shields that need I2C on A4/5 though.
Also it seems that SPI is no longer available on the sockets, just the ISP header. That may also break some shields although I think the main ones (Enet for example) use the ISP header anyway.
It will be interesting to see the Due socket pinout/schematics, but it looks to me as though we are heading for backplane version anarchy.
Rob