Will it be/is it possible to use the Arduino IDE to code for ATtiny? (without a bootloader)
I read about changing the preferences.txt for using a Arduino sketch without a bootloader but this still targets ATmega , so i read the Hacking section about needing to change the Arduino core for other targets , having looked in that Arduino folder i'm left clueless, what files need changing?
I understand that Arduino is very similar to C but i am only just starting out in programming & electronics and like the simplicity & integration of Arduino IDE, trying to get Arduino to target the ATtiny is way beyond me right now.
For clarification what are the steps required & the files that need changing?
All the files?
Parts of specific files?
Has anybody done this already?
If you look in the lib/targets/arduino sub-directory of the Arduino application directory, you'll see the source code for the Arduino core. It needs to be modified to work with the ATtiny instead of the ATmega. It might actually require a few more changes for some of the ATtiny's, because they don't have any RAM.
What are you trying to do? Does it have to use an ATtiny?
Vaguely, i wish to make modular components such as individual sensors, controls, actuators, etc that can be grouped to form larger physical interfaces or devices.
Does it have to use an ATtiny?
The requirements for above example mean ATmega is maybe over sized and over spec & cost becomes an issue for a large number of them,I was thinking of ATtiny45 in 8 pin, if there is a ATmega of similar size that would do.
I literally have not programmed or tried electronics before purchasing Arduino & just about understand the Arduino examples, just to give you an idea of my ability & knowledge, hence asking the initial question.
So most of what i have in mind is just ideas right now.
If your as lazy as I am then I'd just buy a stack if Arduino Mini's.
I am that lazy. ;D
The Arduino Mini is too large for the applications i have in mind, too expensive for the numbers i have in mind & also has the bootloader which i think would stop me from commercializing them if i wanted, but thanks!
I noticed that ladyada has just been putting up some tuts so i shall look thru them & see how i get on.
The difference in cost between an ATmega chip ($2.50) and an ATtiny chip ($1.25) really isn't that much unless you're talking HUGE quantities, and in any case is likely to be dwarfed by the other costs in your device. The ATmegas are available in tiny MLF packages (smaller than a dip-8 by a significant amount), which should address physical size issues.
The core arduino environment is not very hard to port to other CPUs, but it might be more useful to point out that by the time you're capable of doing that, you'd probably also be capable of writing apps for the other CPU in "raw gcc" that didn't require any of the arduino environment.
The core arduino environment is not very hard to port to other CPUs, but it might be more useful to point out that by the time you're capable of doing that, you'd probably also be capable of writing apps for the other CPU in "raw gcc" that didn't require any of the arduino environment.
You are right,There are AVR tutorials i shall read over and i'll continue to use Arduino for prototyping as intended.
[edit]
That last sentence undervalues the Arduino somewhat, so i must say that Arduino & it's resources including this forum have been invaluable to me & the Arduino environment facilitates so much more.
[/edit]
My 2 bits. Start out writing your code for the Arduino. Once it is working, then start working on porting it to an attiny. Perhaps by staying with Arduino, and porting the arduino software to the attiny. Or perhaps by moving your code to avrstudio or winavr or gcc.
By starting with arduino you'll be able to start learning. Then learn a bit more. And then a bit more. Pretty soon you'll know enough to get where you really want to go.
I know that it would be "diluting" the whole arduino concept, but I too would love to see an offshoot of the arduino, where you could prototype using the existing atmega8/168/328, then just simply change the "target board" to be a tiny45/2313 and have it spit out a compatible hex code.
I'm glad this discussion was started--it's a very important issue!
I work with ATtinys because they're cheap and small, ideal for my projects (connecting them to RGB LEDs!). There's an unfortunate distinction between programming these chips with the GNU AVR toolchain (avr-gcc, avr-libc, avrdude, etc.) and programing Arduino boards.
The Arduino libraries can and should be made to work fine with any number of chips and programmers, without bootloaders and bulky boards. There's really no reason not to. True, different chips have different numbers of pins, feature sets, etc., but much of this can be abstracted and accounted for. I'm surprised it hasn't happened yet. It's very useful, as Arduino has all kinds of great libraries written for it that won't work as-is in the GNU toolchain.
It can be done in two different ways. The Arduino environment can be modified to accommodate other chip/programmer possibilities, or those of us using different chips can figure out the right Arduino code to include/modify to use without the environment. I guess we'll see what I get around to--the latter choice seems like less work!
Really, you should try Atmel chips without the Arduino board, it's cheap, tiny, and fun!
I ported the arduino core to an attiny84. This should work with all attinyx4 chips like the 24/44 and 84.
The Arduino IDE does not support attiny chips. Upload (sketches) is not possible, so I had to change some Java classes of the IDE. The modified Java code supports all attiny chips and all atmega chips.
I plan to publish my sources but since there are modifications in the Java files for the IDE, users have to compile their own IDE.