これでとりあえずコンパイル出来たが・・・
Arduino -Extras/cores/arduino/pins_attimy861.cxx
<<ファイルpins_attimy861.cxx>>
Arduino -Extras/cores/arduino/pins_attimy861.cxx
<<ファイルpins_attimy861.cxx>>
/*
pins_arduino.c - pin definitions for the Arduino board
Part of Arduino / Wiring Lite
Copyright (c) 2005 David A. Mellis
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
$Id$
*/
#include <avr/io.h>
#include "wiring_private.h"
#include "pins_arduino.h"
// On the Arduino board, digital pins are also used
// for the analog output (software PWM). Analog input
// pins are a separate set.
// ATMEL ATTINY861
//
// +-\/-+
// SDA (D 0) PB0 1| |20 PA0 (D14) A0
// OC1A (D 1) PB1 2| |19 PA1 (D13) A1
// SCL (D 2) PB2 3| |18 PA2 (D12) A2 Int1
// OC1B (D 3) PB3 4| |17 PA3 (D11) Aref
// VCC 5| |16 AGND
// GND 6| |15 AVCC
// Xtal (D 4) PB4 7| |14 PA4 (D10) A3
// Xtal (D 5) PB5 8| |13 PA5 (D 9) A4
// Int0 (D 6) PB6 9| |12 PA6 (D 8) A5
// Reset PB7 10| |11 PA7 (D 7) A6
// +----+
//
//#undef PB
#define PA 1
#define PB 2
//#define REPEAT8(x) x, x, x, x, x, x, x, x
//#define BV0TO7 _BV(0), _BV(1), _BV(2), _BV(3), _BV(4), _BV(5), _BV(6), _BV(7)
//#define BV7TO0 _BV(7), _BV(6), _BV(5), _BV(4), _BV(3), _BV(2), _BV(1), _BV(0)
// 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,
NOT_A_PORT,
&DDRA,
&DDRB,
};
const uint16_t PROGMEM port_to_output_PGM[] = {
NOT_A_PORT,
NOT_A_PORT,
&PORTA,
&PORTB,
};
const uint16_t PROGMEM port_to_input_PGM[] = {
NOT_A_PIN,
NOT_A_PIN,
&PINA,
&PINB,
};
const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
PB,
PB,
PB,
PB,
PB,
PB,
PA,
PA,
PA,
PA,/* 10 */
PA,
PA,
PA,
PA, /* 14 */
};
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(6),
_BV(5),
_BV(4),/* 10 */
_BV(3),
_BV(2),
_BV(1),
_BV(0), /* 14 */
};
const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
TIMER1A, /* 0 - port D */
TIMER1B,
TIMER2A,
TIMER2B,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER, /* 8 - port B */
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER, /* 14 - port C */
};
Arduino -Extras/cores/arduino/pins_arduino.cに数行足した。
<<ファイルpins_arduino.c>>
#elif defined(__AVR_ATtiny861__)|| defined(__AVR_ATtiny861v__)
//* pin defs for ATtiny861 board
#include "pins_attimy861.cxx"
Arduino -Extrasのpins_arduino.cは良くできててboard,txtの
attiny861.build.mcu=attiny861
行から得た、mcu情報からPinsファイルを切り替えてくれる。
無いMCUを追加するのは、GCCが対応してれば、簡単で、自分の作った基板に合わせて、D0-D14とかを変更する事が出来るみたい。
タイマーのとこで、ちょっとはまった。(正しく無いかも知れない)
tiny84Vでちょっとはまったので、ついでに、秋月で売り出した、tiny861も書いてみた。
とりあえず、m8u2 m32u2 tiny45 tiny85 tiny861 tiny84は、コンパイル出来てるみたい。
tiny861はまだうちに無いから、試して見ないと解らないが、エラーは無くなった。(シリアル無いから、ソフトシリアルにしないと、当然そこはエラー出るが)
面白そうだとは思っていたのだけど、コアが無くて・・
コアって言うより、ピンアサインとタイマー関係の正誤表なんだけどねこれ・・・
現状、bootloaderが無いけど、optibootで作れると思う。
いじり始めると、Arduinoって柔軟でいいなあ・・・と思う。
コメント
コメントを投稿