Randcook:
@pico,
If this is tedious just say.
No, of course, not.
But thanks for the consideration! (You’d be surprised how many people never even say “thanks”.)
Randcook:
Interrupts ?.
http://arduino.cc/en/Reference/AttachInterrupt
On Uno/Mega Interrupt 0 is on D2.
Q.
Are the 644 interrupts mapped the same.
Scanned the pins_arduino.h … variants, but now on the limits of my Old grey cells.
You are right, it does depend on the pin mapping whether D2 is mapped to the hardware pin that corresponds to INT0.
For the “Calunium” mapping they are are showing in the pins_arduino.h in the “plus” directory, we can see that the D2 is mapped to physical pin PD2, which is also INT0 for the 1284p.
// ATMEL ATMEGA1284P on Calunium, PCB version
//
// +---\/---+
// (D 4) PB0 1 | | 40 PA0 (D 31) AI 7
// (D 5) PB1 2 | | 39 PA1 (D 30) AI 6
// INT2 (D 6) PB2 3 | | 38 PA2 (D 29) AI 5
// PWM (D 7) PB3 4 | | 37 PA3 (D 28) AI 4
// PWM/SS (D 10) PB4 5 | | 36 PA4 (D 27) AI 3
// MOSI (D 11) PB5 6 | | 35 PA5 (D 26) AI 2
// PWM/MISO (D 12) PB6 7 | | 34 PA6 (D 25) AI 1
// PWM/SCK (D 13) PB7 8 | | 33 PA7 (D 24) AI 0
// RST 9 | | 32 AREF
// VCC 10 | | 31 GND
// GND 11 | | 30 AVCC
// XTAL2 12 | | 29 PC7 (D 14)
// XTAL1 13 | | 28 PC6 (D 15)
// RX0 (D 0) PD0 14 | | 27 PC5 (D 16) TDI
// TX0 (D 1) PD1 15 | | 26 PC4 (D 17) TDO
// INT0 RX1 (D 2) PD2 16 | | 25 PC3 (D 18) TMS
// INT1 TX1 (D 3) PD3 17 | | 24 PC2 (D 19) TCK
// PWM (D 22) PD4 18 | | 23 PC1 (D 20) SDA
// PWM (D 9) PD5 19 | | 22 PC0 (D 21) SCL
// PWM (D 8) PD6 20 | | 21 PD7 (D 23) PWM
// +--------+
//
BTW, the “Bobuino” pin_arduino.h file also maps D2 onto the same pin, so Skinny Bob will also have the INT0 pin on D2.
But for the “Bobuino”, the SDA and SCL pins are mapped to D23 and D22 respectively, instead of D20/D21 on the “Calunium” mapping.
In this case, to make your code portable, probably better to use “SDA” and and “SCL” to refer to the pins in your sketches, rather than “D21”/“D20”, etc., if that makes sense.
It’s possible to mix amd match variant pin mappings when programming your chips, so you could conceivably program the Microduino using the “Bobuino” mapping, for example, and the chip wouldn’t care… but some pins would be assigned different “logical” pin names, and so you’d have to be careful and understand the implications of the different mapping with respect to you sketch.
Here’s the “Bobuino” pin mapping, for your reference. You will notice it shares many, but not all, of the same pin mappings as the “Calunium” (Microduino+) shown above. Note, for example, D8 and D9 would be reversed. And the mappings for D14-D31 are all over the shop between the two. But you could at least partly finesse that by referring to some of those pins by their “functional” names, e.g., A0 - A7, SDA, SCL etc., upon which they generally agree.
I chose to go with the “Bobuino” mapping for my 1284p dev board (hence the “Bob” in the “Skinny Bob” name) because I felt, on balance, it was the most compatible mapping with respect to the standard Arduino Uno R3 shield header layout. Obviously less of an issue with the little Microduinos!
// ATMEL ATMEGA1284P on Bobuino
//
// +---\/---+
// (D 4) PB0 1 | | 40 PA0 (D 21) AI 7
// (D 5) PB1 2 | | 39 PA1 (D 20) AI 6
// INT2 (D 6) PB2 3 | | 38 PA2 (D 19) AI 5
// PWM (D 7) PB3 4 | | 37 PA3 (D 18) AI 4
// PWM/SS (D 10) PB4 5 | | 36 PA4 (D 17) AI 3
// MOSI (D 11) PB5 6 | | 35 PA5 (D 16) AI 2
// PWM/MISO (D 12) PB6 7 | | 34 PA6 (D 15) AI 1
// PWM/SCK (D 13) PB7 8 | | 33 PA7 (D 14) AI 0
// 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
// INT0 RX1 (D 2) PD2 16 | | 25 PC3 (D 25) TMS
// INT1 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
// +--------+
//
BTW, did you get your “Skinny Bob” assembly instructions by email?