wolfking:
Hi guys,
I've made Arduino as ISP and with avrdude I'm programing standalone AVRs. Everything works fine, however there are some small issues.
First I tried to program ATmega328p-pu with Arduino UNO. I load there just Blick example just to see how it goes. I works pretty well, but for example in function delay I had 1000 which is ok if I test it in Arduino, but on AVR this time duration was much more longer, (about 10seconds).
I think it will be because I compiled it for Arduino UNO, but I have no idea where I can select which Board or AVR I want program. My Arduino IDE shows only Arduino boards.
Do you know where I can find AVRs in Arduino IDE ?
Thank you! 
PS: Or maybe some other compiler where I can compile exactly same code and libaries as in Arduino IDE and get .hex from it
I use this for programming the ATtiny 25/45/85 chips.
ADD TO BOARDS.TXT FILE:
t25.name=ATtiny25 (8.0)
t25.upload.using=avrispmkii
t25.upload.maximum_size=2048
t25.upload.speed=115200
t25.build.mcu=attiny25
t25.build.f_cpu=8000000UL
t25.build.core=arduino
t25.build.variant=attiny_x5
For the tiny85, set the maximum size to 8192, and for the tiny45, set it to 4096.
Then, in your [b]arduino-x.x.x/hardware/arduino/variants[/b]
directory, create a new directory named "[b]attiny_x5[/b]
" and create a file named "[b]pins_arduino.h[/b]
" containing this text:
/////////////////////////////////////////////////////////////////////////////
//
// pins_arduino.h - Pin definition functions for Arduino
// Part of Arduino - http://www.arduino.cc/
//
// Copyright (c) 2015 Roger A. Krupski
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#if defined ( __AVR_ATtiny25__ ) || ( __AVR_ATtiny45__ ) || ( __AVR_ATtiny85__ )
#define NUM_DIGITAL_PINS 6
#define NUM_ANALOG_INPUTS 4
#define PORT_B_ID 1
#define NOT_A_PIN 0
#define NOT_A_PORT 0
#define NOT_ON_TIMER 0
#define digitalPinHasPWM(p)((p)==5||(p)==6)
static const uint8_t MOSI = 5;
static const uint8_t MISO = 6;
static const uint8_t SCK = 7;
static const uint8_t SDA = 5;
static const uint8_t SCL = 7;
static const uint8_t A0 = 1;
static const uint8_t A1 = 7;
static const uint8_t A2 = 3;
static const uint8_t A3 = 2;
#define digitalPinToInterrupt(p)(((p)==7)?1:NOT_AN_INTERRUPT)
#define digitalPinToPCICR(p)(((p)>=0&&(p)<=5)?(&GIMSK):((uint8_t *)NULL))
#define digitalPinToPCICRbit(p)(PCIE)
#define digitalPinToPCMSK(p)(((p)>=0&&(p)<=5)?(&PCMSK):((uint8_t *)NULL))
#define digitalPinToPCMSKbit(p)(p)
#ifdef ARDUINO_MAIN
//////////////////////////////////////////////////////
// ATTINY 25/45/85 TOP VIEW //
// -------- //
// RESET ADC0 PB5 |1* 8| VCC //
// XTAL1 ADC3 PB3 |2 7| PB2 ADC1 SCK INT0 //
// XTAL2 ADC2 PB4 |3 6| PB1 AIN1 MISO //
// GND |4 5| PB0 AIN0 MOSI AREF //
// -------- //
//////////////////////////////////////////////////////
// PB5 (PIN 1):___________________________________________________________________
// RESET Reset Pin
// dW debugWIRE I/O
// ADC0 ADC Input Channel 0
// PCINT5 Pin Change Interrupt, Source 5
//
// PB4 (PIN 3):___________________________________________________________________
// XTAL2 Crystal Oscillator Output
// CLKO System Clock Output
// ADC2 ADC Input Channel 2
// OC1B Timer/Counter1 Compare Match B Output
// PCINT4 Pin Change Interrupt 0, Source 4
//
// PB3 (PIN 2):___________________________________________________________________
// XTAL1 Crystal Oscillator Input
// CLKI External Clock Input
// ADC3 ADC Input Channel 3
// OC1B Complementary Timer/Counter1 Compare Match B Output
// PCINT3 Pin Change Interrupt 0, Source 3
//
// PB2 (PIN 7):___________________________________________________________________
// SCK Serial Clock Input
// ADC1 ADC Input Channel 1
// T0 Timer/Counter0 Clock Source
// USCK USI Clock (Three Wire Mode)
// SCL USI Clock (Two Wire Mode)
// INT0 External Interrupt 0 Input
// PCINT2 Pin Change Interrupt 0, Source 2
//
// PB1 (PIN 6):___________________________________________________________________
// MISO SPI Master Data Input/Slave Data Output
// AIN1 Analog Comparator, Negative Input
// OC0B Timer/Counter0 Compare Match B Output
// OC1A Timer/Counter1 Compare Match A Output (PWM1)
// DO USI Data Output (Three Wire Mode)
// PCINT1 Pin Change Interrupt 0, Source 1
//
// PB0 (PIN 5):___________________________________________________________________
// MOSI SPI Master Data Output/Slave Data Input
// AIN0 Analog Comparator, Positive Input
// OC0A Timer/Counter0 Compare Match A output (PWM0)
// OC1A Complementary Timer/Counter1 Compare Match A Output
// DI USI Data Input (Three Wire Mode)
// SDA USI Data Input (Two Wire Mode)
// AREF External Analog Reference
// PCINT0 Pin Change Interrupt 0, Source 0
const uint16_t PROGMEM port_to_mode_PGM[] = {
NOT_A_PORT,
(uint16_t) &DDRB,
};
const uint16_t PROGMEM port_to_output_PGM[] = {
NOT_A_PORT,
(uint16_t) &PORTB,
};
const uint16_t PROGMEM port_to_input_PGM[] = {
NOT_A_PORT,
(uint16_t) &PINB,
};
const uint8_t PROGMEM digital_pin_to_port_PGM[] =
{
NOT_A_PORT,
PORT_B_ID,
PORT_B_ID,
PORT_B_ID,
NOT_A_PORT,
PORT_B_ID,
PORT_B_ID,
PORT_B_ID,
NOT_A_PORT,
};
const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] =
{
NOT_A_PIN,
_BV(5),
_BV(3),
_BV(4),
NOT_A_PIN,
_BV(0),
_BV(1),
_BV(2),
NOT_A_PIN,
};
const uint8_t PROGMEM digital_pin_to_timer_PGM[] =
{
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,
TIMER0A, // OC0A
TIMER1A, // OC1A
NOT_ON_TIMER,
NOT_ON_TIMER,
};
#endif // ARDUINO_MAIN
#endif // ( __AVR_ATtiny25/45/85__ )
#endif // Pins_Arduino_h
I don't bother to support a bootloader since I use the ATtiny24 (only 2K of flash). Why suck up 1/4 of my flash when I can burn it directly?
Hope this helps.