Okay, with fat16lib's & pito's help I was came up with the following change to Sd2PinMap.h
#elif defined(__AVR_ATmega1284P__)
// add this if use these other chips
// ||defined(__AVR_ATmega644P__) || defined(__AVR_ATmega324P__)
// ATMEL ATMEGA1284P / BOBUINO
//
// Make it agree with the as-built hardware & pins_arduino.c
//
// +---\/---+
// INT0 (D 4) PB0 1| |40 PA0 (AI 0 / D14)
// INT1 (D 5) PB1 2| |39 PA1 (AI 1 / D15)
// INT2 (D 6) PB2 3| |38 PA2 (AI 2 / D16)
// PWM (D 7) PB3 4| |37 PA3 (AI 3 / D17)
// PWM (D 10) PB4 5| |36 PA4 (AI 4 / D18)
// MOSI (D 11) PB5 6| |35 PA5 (AI 5 / D19)
// MISO (D 12) PB6 7| |34 PA6 (AI 6 / D21)
// SCK (D 13) PB7 8| |33 PA7 (AI 7 / D22)
// RST 9| |32 AREF
// VCC 10| |31 GND
// GND 11| |30 AVCC
// XTAL2 12| |29 PC7 (D 29)
// XTAL1 13| |28 PC6 (D 28)
// RX0 (D 0) PD0 14| |27 PC5 (D 27) TDI
// TX0 (D 1) PD1 15| |26 PC4 (D 26) TDO
// RX1 (D 2) PD2 16| |25 PC3 (D 25) TMS
// TX1 (D 3) PD3 17| |24 PC2 (D 24) TCK
// PWM (D 30) PD4 18| |23 PC1 (D 23) SDA
// PWM (D 8 ) PD5 19| |22 PC0 (D 22) SCL
// PWM (D 9) PD6 20| |21 PD7 (D 31) PWM
// +--------+
//
// NOT_ON_TIMER, /* 0 - PD0 */
// NOT_ON_TIMER, /* 1 - PD1 */
// NOT_ON_TIMER, /* 2 - PD2 */
// NOT_ON_TIMER, /* 3 - PD3 */
// NOT_ON_TIMER, /* 4 - PB0 */
// NOT_ON_TIMER, /* 5 - PB1 */
// NOT_ON_TIMER, /* 6 - PB2 */
// TIMER0A, /* 7 - PB3, PWM */
// TIMER1A, /* 8 - PD5, PWM */
// TIMER2B, /* 9 - PD6, PWM */
// TIMER0B, /* 10 - PB4, PWM */
// NOT_ON_TIMER, /* 11 - PB5 */
// NOT_ON_TIMER, /* 12 - PB6 */
// NOT_ON_TIMER, /* 13 - PB7 */
// NOT_ON_TIMER, /* 14 - PA0 */
// NOT_ON_TIMER, /* 15 - PA1 */
// NOT_ON_TIMER, /* 16 - PA2 */
// NOT_ON_TIMER, /* 17 - PA3 */
// NOT_ON_TIMER, /* 18 - PA4 */
// NOT_ON_TIMER, /* 19 - PA5 */
// NOT_ON_TIMER, /* 20 - PA6 */
// NOT_ON_TIMER, /* 21 - PA7 */
// NOT_ON_TIMER, /* 22 - PC0 */
// NOT_ON_TIMER, /* 23 - PC1 */
// NOT_ON_TIMER, /* 24 - PC2 */
// NOT_ON_TIMER, /* 25 - PC3 */
// NOT_ON_TIMER, /* 26 - PC4 */
// NOT_ON_TIMER, /* 27 - PC5 */
// NOT_ON_TIMER, /* 28 - PC6 */
// NOT_ON_TIMER, /* 29 - PC7 */
// TIMER1B, /* 30 - PD4, PWM */
// TIMER2A /* 31 - PD7, PWM */
// Two Wire (aka I2C) ports
uint8_t const SDA_PIN = 23; // C1 23
uint8_t const SCL_PIN = 22; // C0 22
// SPI port
uint8_t const SS_PIN = 18; // D 30
// uint8_t const SS_PIN = 21; // D 31 Swap when testing the other SD card
uint8_t const MOSI_PIN = 6; // D 11 MOSI
uint8_t const MISO_PIN = 7; // D 12 MISO
uint8_t const SCK_PIN = 8; // D 13 SCK
have also tried the SPI section above as:
// SPI port
uint8_t const SS_PIN = 30; // D 30
// uint8_t const SS_PIN = 31; // D 31 Swap when testing the other SD card
uint8_t const MOSI_PIN = 11; // D 11 MOSI
uint8_t const MISO_PIN = 12; // D 12 MISO
uint8_t const SCK_PIN = 13; // D 13 SCK
and the actual port to pin mapping:
static const pin_map_t digitalPinMap[] = {
{&DDRD, &PIND, &PORTD, 0}, // D0 0
{&DDRD, &PIND, &PORTD, 1}, // D1 1
{&DDRD, &PIND, &PORTD, 2}, // D2 2
{&DDRD, &PIND, &PORTD, 3}, // D3 3
{&DDRB, &PINB, &PORTB, 0}, // B0 4
{&DDRB, &PINB, &PORTB, 1}, // B1 5
{&DDRB, &PINB, &PORTB, 2}, // B2 6
{&DDRB, &PINB, &PORTB, 3}, // B3 7
{&DDRD, &PIND, &PORTD, 5}, // D5 8
{&DDRD, &PIND, &PORTD, 6}, // D6 9
{&DDRB, &PINB, &PORTB, 4}, // B4 10
{&DDRB, &PINB, &PORTB, 5}, // B5 11
{&DDRB, &PINB, &PORTB, 6}, // B6 12
{&DDRB, &PINB, &PORTB, 7}, // B7 13
{&DDRA, &PINA, &PORTA, 0}, // A0 14
{&DDRA, &PINA, &PORTA, 1}, // A1 15
{&DDRA, &PINA, &PORTA, 2}, // A2 16
{&DDRA, &PINA, &PORTA, 3}, // A3 17
{&DDRA, &PINA, &PORTA, 4}, // A4 18
{&DDRA, &PINA, &PORTA, 5}, // A5 19
{&DDRA, &PINA, &PORTA, 6}, // A6 20
{&DDRA, &PINA, &PORTA, 7}, // A7 21
{&DDRC, &PINC, &PORTC, 0}, // C0 22
{&DDRC, &PINC, &PORTC, 1}, // C1 23
{&DDRC, &PINC, &PORTC, 2}, // C2 24
{&DDRC, &PINC, &PORTC, 3}, // C3 25
{&DDRC, &PINC, &PORTC, 4}, // C4 26
{&DDRC, &PINC, &PORTC, 5}, // C5 27
{&DDRC, &PINC, &PORTC, 6}, // C6 28
{&DDRC, &PINC, &PORTC, 7}, // C7 29
{&DDRD, &PIND, &PORTD, 4}, // D4 30
{&DDRD, &PIND, &PORTD, 7} // D7 31
};
and commented out 1284 in the 644/1284 part:
#elif defined(__AVR_ATmega644P__)||\
defined(__AVR_ATmega644__)
// || defined(__AVR_ATmega1284P__)
// Sanguino
Result with either set of SPI pins is the sketches (SdFormatter, Bench, QuickStart) get to this line
if (!card.init(spiSpeed, chipSelect)) {
and stop.
What am I missing still?
If I run "Blink" with D11, 12, 13, 30 I can see the lines toggling at the SD socket on the right pins, so I know the signals are getting there.