giovedì 10 giugno 2010

Arduino IDE with ATTiny45 (porting)

form my pages here 
some notes to better use the board end the software

You HAVE to modify "board.txt" to include the Attiny45 processor, add this part to end of the file

attiny45.name=Arduino w ATtiny45

attiny45.upload.protocol=stk500
attiny45.upload.maximum_size=4096
attiny45.upload.speed=19200

attiny45.bootloader.low_fuses=0xdf
attiny45.bootloader.high_fuses=0xca
attiny45.bootloader.path= attiny45
attiny45.bootloader.file=ATmegaBOOT.hex
attiny45.bootloader.unlock_bits=0x3F
attiny45.bootloader.lock_bits=0x0F

attiny45.build.mcu=attiny45
attiny45.build.f_cpu=8000000L
attiny45.build.core=attiny45

these line will define the board giving max memory size for program (4096) and instruct the compiler to build code for the tiny45.

to know which mcu are supported by avr-gcc and their names use
avr-gcc --target-help
in a terminal window (works in Mac OSX and probably in Linux)

PIN MAPPINGThe best I can do for the pin mapping is in the pins_arduino.c in the core folder, the function are multiple per pin depends on the function you use to refer to the pin;
I.E. analogWrite (0,231) // output a pwn signal to real pin 5
digitalRead(5) // read a digital value from real pin 1
analogRead(5) // read an analog value from real pin 1
and so on ... like in a real arduino .