Hi, so good progress with this 1284p project, thanks for all your help All up and running on 3V3 @ 8mhz and responding well. My next task is to get the pin map sorted but I'm not sure what I'm doing.... does anyone know of a good tutorial or can help me match the pins_arduino.h below with my schematic below? Thanks.
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <avr/pgmspace.h>
// ATMEL ATMEGA1284P
//
//Â Â Â Â Â Â Â Â Â Â Â +---\/---+
//Â Â Â Â Â (D 8) PB0Â 1|Â Â Â Â |40Â PA0 (AI 5 / D29)
//Â Â Â Â Â (D 9) PB1Â 2|Â Â Â Â |39Â PA1 (AI 4 / D28)
//Â Â INT2 (D 14) PB2Â 3|Â Â Â Â |38Â PA2 (AI 3 / D27)
//Â Â Â PWM (D 15) PB3Â 4|Â Â Â Â |37Â PA3 (AI 2 / D26)
//Â PWM/SS (D 10) PB4Â 5|Â Â Â Â |36Â PA4 (AI 1 / D25)
//Â Â MOSI (D 11) PB5Â 6|Â Â Â Â |35Â PA5 (AI 0 / D24)
// PWM/MISO (D 12) PB6Â 7|Â Â Â Â |34Â PA6 (AI 6 / D30)
//Â PWM/SCK (D 13) PB7Â 8|Â Â Â Â |33Â PA7 (AI 7 / D31)
//Â Â Â Â Â Â Â Â RSTÂ 9|Â Â Â Â |32Â AREF
//Â Â Â Â Â Â Â Â VCC 10|Â Â Â Â |31Â GND
//Â Â Â Â Â Â Â Â GND 11|Â Â Â Â |30Â AVCC
//Â Â Â Â Â Â Â XTAL2 12|Â Â Â Â |29Â PC7 (D 23)
//Â Â Â Â Â Â Â XTAL1 13|Â Â Â Â |28Â PC6 (D 22)
//Â Â Â RX0 (D 0) PD0 14|Â Â Â Â |27Â PC5 (D 21) TDI
//Â Â Â TX0 (D 1) PD1 15|Â Â Â Â |26Â PC4 (D 20) TDO
//Â RX1/INT0 (D 2) PD2 16|Â Â Â Â |25Â PC3 (D 19) TMS
//Â TX1/INT1 (D 3) PD3 17|Â Â Â Â |24Â PC2 (D 18) TCK
//Â Â Â PWM (D 4) PD4 18|Â Â Â Â |23Â PC1 (D 17) SDA
//Â Â Â PWM (D 5) PD5 19|Â Â Â Â |22Â PC0 (D 16) SCL
//Â Â Â PWM (D 6) PD6 20|Â Â Â Â |21Â PD7 (D 7) PWM
//Â Â Â Â Â Â Â Â Â Â Â +--------+
//
/*
 PCINT15-8: D7-0 : bit 1
 PCINT31-24: D15-8 : bit 3
 PCINT23-16: D23-16 : bit 2
 PCINT7-0: D31-24 : bit 0
 */
#define NUM_DIGITAL_PINSÂ Â Â Â Â Â 31
#define NUM_ANALOG_INPUTSÂ Â Â Â Â 8
//#define analogInputToDigitalPin(p)Â ((p < NUM_ANALOG_INPUTS) ? (p) + 24 : -1)
#define analogInputToDigitalPin(p)Â ((p < NUM_ANALOG_INPUTS) ? (p) + 24 : -1)
#define digitalPinToAnalogPin(p)Â Â ( (p) >= 24 && (p) <= 31 ? ((p) < 30 ? 5-((p)-24) : ((p) - 24)) : (((p)<=5) ? 5-(p) : (((p)<=7) ? (p) : -1 )) )
#define digitalPinHasPWM(p)Â Â Â Â ((p) == 4 || (p) == 5 || (p) == 6 || (p) == 7 || (p) == 10 || (p) == 12 || (p) == 13 || (p) == 15)
static const uint8_t SSÂ = 10;
static const uint8_t MOSI = 11;
static const uint8_t MISO = 12;
static const uint8_t SCKÂ = 13;
static const uint8_t SDA = 17;
static const uint8_t SCL = 16;
static const uint8_t LED = 23;
static const uint8_t A0 = 24;
static const uint8_t A1 = 25;
static const uint8_t A2 = 26;
static const uint8_t A3 = 27;
static const uint8_t A4 = 28;
static const uint8_t A5 = 29;
static const uint8_t A6 = 30;
static const uint8_t A7 = 31;
#define digitalPinToPCICR(p)Â Â ifpin(p,&PCICR,(uint8_t *)0)
#define digitalPinToPCICRbit(p) ifpin(p,digital_pin_to_pcint[p] >> 3,(uint8_t *)0)
#define digitalPinToPCMSK(p)Â Â ifpin(p,__pcmsk[digital_pin_to_pcint[]],(uint8_t *)0)
#define digitalPinToPCMSKbit(p) ifpin(p,digital_pin_to_pcint[p] & 0x7,(uint8_t *)0)
#ifdef ARDUINO_MAIN
#define PA 1
#define PB 2
#define PC 3
#define PD 4
const uint8_t digital_pin_to_pcint[NUM_DIGITAL_PINS] =
{
 24, // D0 PD0
 25, // D1 PD1
 26, // D2 PD2
 27, // D3 PD3
 28, // D4 PD4
 29, // D5 PD5
 30, // D6 PD6
 31, // D7 PD7
 8, // D8 PB0
 9, // D9 PB1
 12, // D10 PB4
 13, // D11 PB5
 14, // D12 PB6
 15, // D13 PB7
 10, // D14 PB2
 11, // D15 PB3
 16, // D16 PC0
 17, // D17 PC1
 18, // D18 PC2
 19, // D19 PC3
 20, // D20 PC4
 21, // D21 PC5
 22, // D22 PD6
 23, // D23 PC7
 5, // D31 PA7
 4, // D30 PA6
 3, // D24 PA5
 2, // D25 PA4
 1, // D26 PA3
 0, // D27 PA2
 6, // D28 PA1
 7, // D29 PA0
//Â 7, // D31 PA7
//Â 6, // D30 PA6
//Â 0, // D24 PA5
//Â 1, // D25 PA4
//Â 2, // D26 PA3
//Â 3, // D27 PA2
//Â 4, // D28 PA1
//Â 5, // D29 PA0
};
const uint16_t __pcmsk[] =
{
 (uint16_t)&PCMSK0,
 (uint16_t)&PCMSK1,
 (uint16_t)&PCMSK2,
 (uint16_t)&PCMSK3
};
// these arrays map port names (e.g. port B) to the
// appropriate addresses for various functions (e.g. reading
// and writing)
const uint16_t PROGMEM port_to_mode_PGM[] =
{
NOT_A_PORT,
(uint16_t) &DDRA,
(uint16_t) &DDRB,
(uint16_t) &DDRC,
(uint16_t) &DDRD,
};
const uint16_t PROGMEM port_to_output_PGM[] =
{
NOT_A_PORT,
(uint16_t) &PORTA,
(uint16_t) &PORTB,
(uint16_t) &PORTC,
(uint16_t) &PORTD,
};
const uint16_t PROGMEM port_to_input_PGM[] =
{
NOT_A_PORT,
(uint16_t) &PINA,
(uint16_t) &PINB,
(uint16_t) &PINC,
(uint16_t) &PIND,
};
const uint8_t PROGMEM digital_pin_to_port_PGM[] =
{
PD, /* 0 */
PD,
PD,
PD,
PD,
PD,
PD,
PD,
PB, /* 8 */
PB,
PB,
PB,
PB,
PB,
PB,
PB,
PC, /* 16 */
PC,
PC,
PC,
PC,
PC,
 PC,
PC,
PA, /* 24 */
PA,
PA,
PA,
PA,
PA,
PA,
PAÂ /* 31 */
};
const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] =
{
_BV(0), /* 0, port D */
_BV(1),
_BV(2),
_BV(3),
_BV(4),
_BV(5),
_BV(6),
_BV(7),
_BV(0), /* 8, port B */
_BV(1),
_BV(4),
_BV(5),
_BV(6),
_BV(7),
_BV(2),
_BV(3),
_BV(0), /* 16, port C */
_BV(1),
_BV(2),
_BV(3),
_BV(4),
_BV(5),
_BV(6),
_BV(7),
_BV(5), /* 24, port A */
_BV(4),
_BV(3),
_BV(2),
_BV(1),
_BV(0),
_BV(6),
_BV(7)
};
const uint8_t PROGMEM digital_pin_to_timer_PGM[] =
{
NOT_ON_TIMER, /* 1 - PD0 */
NOT_ON_TIMER, /* 2 - PD1 */
NOT_ON_TIMER, /* 3 - PD2 */
NOT_ON_TIMER, /* 4 - PD3 */
TIMER1B,  /* 5 - PD4 */
TIMER1A,  /* 6 - PD5 */
TIMER2B,  /* 7 - PD6 */
TIMER2A,  /* 8 - PD7 */
NOT_ON_TIMER, /* 8Â - PB0 */
NOT_ON_TIMER, /* 9Â - PB1 */
TIMER0B, /* 10 - PB4 */
NOT_ON_TIMER, /* 11 - PB5 */
TIMER3A, /* 12 - PB6 */
TIMER3B, /* 13 - PB7 */
NOT_ON_TIMER, /* 14 - PB2 */
TIMER0A,  /* 15 - PB3 */
NOT_ON_TIMER, /* 16 - PC0 */
NOT_ON_TIMER, /* 17 - PC1 */
NOT_ON_TIMER, /* 18 - PC2 */
NOT_ON_TIMER, /* 19 - PC3 */
NOT_ON_TIMER, /* 20 - PC4 */
NOT_ON_TIMER, /* 21 - PC5 */
NOT_ON_TIMER, /* 22 - PC6 */
NOT_ON_TIMER, /* 23 - PC7 */
NOT_ON_TIMER, /* 24 - PA0 */
NOT_ON_TIMER, /* 25 - PA1 */
NOT_ON_TIMER, /* 26 - PA2 */
NOT_ON_TIMER, /* 27 - PA3 */
NOT_ON_TIMER, /* 28 - PA4 */
NOT_ON_TIMER, /* 29 - PA5 */
NOT_ON_TIMER, /* 30 - PA6 */
NOT_ON_TIMERÂ Â /* 31 - PA7 */
};
#endif // ARDUINO_MAIN
#endif // Pins_Arduino_h
// vim:ai:cin:sts=2 sw=2 ft=cpp