so i took another module, this time modifying it for
#define slaveSDA 11
#define slaveSCL 13
still doesnt work as slave. tried both 6K and 1K pullups. seems to just lockup after a short while.
so i tried another approach: hardcoding the interface into the variant file... and it works?! so i think i have pretty much proven that onReceive and onRequest only work in the hard defined i2c pins?? why might this be? is there a workaround?
// Digital High
{ PORTA, 6, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER|PIN_ATTR_ANALOG), ADC_Channel6, PWM1_CH0, TCC1_CH0, EXTERNAL_INT_6 }, // TCC1/WO[0]
{ PORTA, 7, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER|PIN_ATTR_ANALOG), ADC_Channel7, PWM1_CH1, TCC1_CH1, EXTERNAL_INT_7 }, // TCC1/WO[1]
{ PORTA, 18, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM3_CH0, TC3_CH0, EXTERNAL_INT_2 }, // TC3/WO[0]
{ PORTA, 16, PIO_SERCOM, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_0 }, // TCC2/WO[0] D11 SDA U11
{ PORTA, 19, PIO_TIMER_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER_ALT), No_ADC_Channel, PWM0_CH3, TCC0_CH3, EXTERNAL_INT_3 }, // TCC0/WO[3]
// 13 (LED)
{ PORTA, 17, PIO_SERCOM, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_1 }, // TCC2/WO[1] D13 SCL U13
/*
* Wire Interfaces
*/
#define WIRE_INTERFACES_COUNT 3
#define PIN_WIRE_SDA (26u)
#define PIN_WIRE_SCL (27u)
#define PERIPH_WIRE sercom3
#define WIRE_IT_HANDLER SERCOM3_Handler
static const uint8_t SDA = PIN_WIRE_SDA;
static const uint8_t SCL = PIN_WIRE_SCL;
#define PIN_WIRE1_SDA (11u) //D11
#define PIN_WIRE1_SCL (13u) //D13
#define PERIPH_WIRE1 sercom1
#define WIRE1_IT_HANDLER SERCOM1_Handler
static const uint8_t SDA1 = PIN_WIRE1_SDA;
static const uint8_t SCL1 = PIN_WIRE1_SCL;
#define PIN_WIRE2_SDA (28u) //D22 PA12
#define PIN_WIRE2_SCL (39u) //D38 PA13
#define PERIPH_WIRE2 sercom2
#define WIRE2_IT_HANDLER SERCOM2_Handler
static const uint8_t SDA2 = PIN_WIRE2_SDA;
static const uint8_t SCL2 = PIN_WIRE2_SCL;