Is there any chance this pins_arduino.h variant may work?
/*
pins_arduino.h - Pin definition functions for use with Arduino IDE
Part of RPUadpt project http://epccs.org/indexes/Board/RPUadpt/
Copyright (C) 2015 Ronald S. Sutherland
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
*/
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <avr/pgmspace.h>
//
// 20SOICpin ATTINY1634reg-bit {PCINT} (ArduinoDigital) function #notes [RPUadpt]
// 9 PA0 {0} (D 15) [RX_!RE]
// 8 PA1 {1} (D 16) [TX_DE]
// 7 PA2 {2} (D 17) [DTR_!RE]
// 6 PA3 {3} (D 0) ADC0 [DTR_DE]
// 5 PA4 {4} (D 1) ADC1 [status led]
// 4 PA5 {5} (D 2) ADC2 OC0B [FTDI_!DSR]
// 3 PA6 {6} (D 3) ADC3 OC1B [MGNT_!RST]
// 2 PA7 {7} (D 4) ADC4 RXD0 [DTR_RO]
//
// 1 PB0 {8} (D 5) ADC5 TXD0 [DTR_DI]
// 20 PB1 {9} (D 6) ADC6 SDA [SDA_TINY icsp MOSI]
// 19 PB2 {10} (D 7) ADC7 DO [icsp MISO]
// 18 PB3 {11} (D 8) ADC8 OC1A [FTDI_!RTS]
//
// 17 PC0 {12} (D 9) ADC9 OC0A [FTDI_!CTS]
// 16 PC1 {13} (D 10) ADC10 ICP1 SCL [SCL_TINY icsp SCK]
// 15 PC2 {14} (D 11) ADC11 INT0 [FTDI_!DTR]
// 14 PC3 {15} (D 12) !RESET
// 13 PC4 {16} (D 13) XTAL2
// 12 PC5 {17} (D 14) XTAL1
// Arduino IDE 1.6.5 has the needed /avr/iotn1634.h from avr-libc
// thus its core might work, as a variant.
#define TINY_1634_VARIANT "RPUADPT"
#define NUM_DIGITAL_PINS 17
#define NUM_ANALOG_INPUTS 12
#define analogInputToDigitalPin(p) ((p < NUM_ANALOG_INPUTS) ? (p) : -1)
#define ifpin(p,what,ifnot) (((p) >= 0 && (p) < NUM_DIGITAL_PINS) ? (what) : (ifnot))
#define digitalPinHasPWM(p) ifpin(p,pgm_read_byte(digital_pin_to_timer_PGM + (p)) != NOT_ON_TIMER,1==0)
#define digitalPinToAnalogPin(p) ( (p) >= 0 && (p) <= 12 ? (p) : -1 )
// retrun the channel rather its the digital pin # or an analog pin #, e.g. analogRead(A0) should work as expected
#define analogPinToChannel(p) ( (p) < NUM_ANALOG_INPUTS ? (p) : -1 )
static const uint8_t SS = -1;
static const uint8_t MOSI = 6;
static const uint8_t MISO = 7;
static const uint8_t SCK = 10;
static const uint8_t SDA = 6;
static const uint8_t SCL = 10;
static const uint8_t LED_BUILTIN = 1; // status LED
static const uint8_t A0 = 0;
static const uint8_t A1 = 1;
static const uint8_t A2 = 2;
static const uint8_t A3 = 3;
static const uint8_t A4 = 4;
static const uint8_t A5 = 5;
static const uint8_t A6 = 6;
static const uint8_t A7 = 7;
static const uint8_t A8 = 8;
static const uint8_t A9 = 9;
static const uint8_t A10 = 10;
static const uint8_t A11 = 11;
static const uint8_t A12 = 12;
#define PORT_NDX_TO_PCMSK(x) ((x) == 0 ? &PCMSK0 : ((x) == 1 ? &PCMSK1 : ((x) == 2 ? &PCMSK2 : (uint8_t )0)))
// These are macros to associate pins to pin change interrupts
#define ifpin(p,what,ifnot) (((p) >= 0 && (p) < NUM_DIGITAL_PINS) ? (what) : (ifnot))
#define digitalPinToPCICR(p) ifpin(p,&PCICR,(uint8_t *)0)
#define digitalPinToPCICRbit(p) ifpin(p,digital_pin_to_pcint[p] >> 3,0)
#define digitalPinToPCMSK(p) ifpin(p,(uint8_t *)PORT_NDX_TO_PCMSK(digital_pin_to_pcint[p] >> 3),(uint8_t *)0)
#define digitalPinToPCMSKbit(p) ifpin(p,digital_pin_to_pcint[p] & 0x7,0)
#define PA 1
#define PB 2
#define PC 3
// specify port for each pin D0-D17
#define PORT_D0 PA
#define PORT_D1 PA
#define PORT_D2 PA
#define PORT_D3 PA
#define PORT_D4 PA
#define PORT_D5 PB
#define PORT_D6 PB
#define PORT_D7 PB
#define PORT_D8 PB
#define PORT_D9 PC
#define PORT_D10 PC
#define PORT_D11 PC
#define PORT_D12 PC
#define PORT_D13 PC
#define PORT_D14 PC
#define PORT_D15 PA
#define PORT_D16 PA
#define PORT_D17 PA
// specify port bit for each pin D0-D17
#define BIT_D0 3
#define BIT_D1 4
#define BIT_D2 5
#define BIT_D3 6
#define BIT_D4 7
#define BIT_D5 0
#define BIT_D6 1
#define BIT_D7 2
#define BIT_D8 3
#define BIT_D9 0
#define BIT_D10 1
#define BIT_D11 2
#define BIT_D12 3
#define BIT_D13 4
#define BIT_D14 5
#define BIT_D15 0
#define BIT_D16 1
#define BIT_D17 2
// macro equivalents of PROGMEM arrays port_to_mode_PGM[] etc. below
#define PORT_TO_MODE(x) (x == 1 ? &DDRA : (x == 2 ? &DDRB : (x == 3 ? &DDRC : NOT_A_PORT)))
#define PORT_TO_OUTPUT(x) (x == 1 ? &PORTA : (x == 2 ? &PORTB : (x == 3 ? &PORTC : NOT_A_PORT)))
#define PORT_TO_INPUT(x) (x == 1 ? &PINA : (x == 2 ? &PINB : (x == 3 ? &PINC : NOT_A_PORT)))
#ifndef ARDUINO_MAIN
extern const uint8_t digital_pin_to_pcint[];
#else
// this pin lookup table gives PCINT value
const uint8_t digital_pin_to_pcint[NUM_DIGITAL_PINS] =
{
3, // D0 PD0
4, // D1 PD1
5, // D2 PD2
6, // D3 PD3
7, // D4 PB0
8, // D5 PB1
9, // D6 PB3
10, // D7 PC7
11, // D8 PD6
12, // D9 PD5
13, // D10 PD4
14, // D11 PD7
15, // D12 PB6
16, // D13 PB7
17, // D14 PB5
0, // D15 PC6
1, // D16 PC5
2, // D17 PC4
};
// 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,
};
const uint16_t PROGMEM port_to_output_PGM[] =
{
NOT_A_PORT,
(uint16_t) &PORTA,
(uint16_t) &PORTB,
(uint16_t) &PORTC,
};
const uint16_t PROGMEM port_to_input_PGM[] =
{
NOT_A_PORT,
(uint16_t) &PINA,
(uint16_t) &PINB,
(uint16_t) &PINC,
};
const uint8_t PROGMEM digital_pin_to_port_PGM[NUM_DIGITAL_PINS] =
{
PORT_D0,
PORT_D1,
PORT_D2,
PORT_D3,
PORT_D4,
PORT_D5,
PORT_D6,
PORT_D7,
PORT_D8,
PORT_D9,
PORT_D10,
PORT_D11,
PORT_D12,
PORT_D13,
PORT_D14,
PORT_D15,
PORT_D16,
PORT_D17
};
const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[NUM_DIGITAL_PINS] =
{
_BV(BIT_D0),
_BV(BIT_D1),
_BV(BIT_D2),
_BV(BIT_D3),
_BV(BIT_D4),
_BV(BIT_D5),
_BV(BIT_D6),
_BV(BIT_D7),
_BV(BIT_D8),
_BV(BIT_D9),
_BV(BIT_D10),
_BV(BIT_D11),
_BV(BIT_D12),
_BV(BIT_D13),
_BV(BIT_D14),
_BV(BIT_D15),
_BV(BIT_D16),
_BV(BIT_D17)
};
// OC0A (D 9), OC0B (D 2)
// OC1A (D 8), OC1B (D 3)
// search for the usage of TIMER0B in arduino github to see how it is used
// e.g. it is defined in Arduino.h and used in wiring_digital.c to select a
// case statement to clear bit function e.g. cbi(TCCR0A, COM0B1)
const uint8_t PROGMEM digital_pin_to_timer_PGM[NUM_DIGITAL_PINS] =
{
NOT_ON_TIMER, // D0 PD0
NOT_ON_TIMER, // D1 PD1
TIMER0B, // D2 PD2
TIMER1B, // D3 PD3
NOT_ON_TIMER, // D4 PB0
NOT_ON_TIMER, // D5 PB1
NOT_ON_TIMER, // D6 PB3
NOT_ON_TIMER, // D7 PC7
TIMER1A, // D8 PD6
TIMER0A, // D9 PD5
NOT_ON_TIMER, // D10 PD4
NOT_ON_TIMER, // D11 PD7
NOT_ON_TIMER, // D12 PB6
NOT_ON_TIMER, // D13 PB7
NOT_ON_TIMER, // D14 PB5
NOT_ON_TIMER, // D15 PC6
NOT_ON_TIMER, // D16 PC5
NOT_ON_TIMER // D17 PC4
};
#endif // ARDUINO_MAIN
#endif // Pins_Arduino_h
//
Not tried it yet, so clueless I am.