I started fooling around with the ATtiny13 using Sam's incredible development module but found myself rapidly limited as a programmer. I wanted to use the useful functions millis(), delay(), etc. from the Arduino, which I find pretty convenient for advanced development.
So I simply got the files that I needed which can be found along with the arduino source code, in: hardware/cores/arduino/
You then have to include the right files:
#include "WProgram.h"
void setup() {
//...
}
void loop() {
//...
}
#include "main.cxx"
In order to get things working with the ATtiny13 I had to patch the wiring.c file. For the moment, I only patched it to support what is in wirinc.c, ie. the init(), delay() and millis() functions. I put the patch here in attachment.
| Attachment | Size |
|---|---|
| wiring.c_attiny13.patch.txt | 1.88 KB |
Comments
how to use patch file? can
how to use patch file?
can you upload the modified wiring.c ?
Patch too old
Normally you just need to save the file to directory containing the wiring.c and go to that dir using the cd command. Then you should just need to run:
BUT I tested it with the latest version of the Arduino's wiring.c file and it fails:
patching file wiring.c Hunk #1 FAILED at 127. Hunk #2 FAILED at 140. Hunk #3 FAILED at 152. Hunk #4 FAILED at 189. 4 out of 4 hunks FAILED -- saving rejects to file wiring.c.rejThis means the wiring.c file has changed and the patch is thus too old. I would recommend you try to do it "by hand" by looking at the patch and the new wiring.c file and patching it. It basically involves just making some specific settings for the ATtiny.
Does this mean you're now
Does this mean you're now using an ATtiny13 with the Arduino IDE? i guess it would be a matter of matching the pins and only using the hardware available for the tiny13 in your programs.
Do I just need to append that patch to the wiring.c file?
thank you, it'll be nicer to have simpler programs running on an 8 pin dip and still use Arduino IDE.
Old post
Hmmm that was an old post. I'm not even sure if it was fully tested.
But, yup, it would be great to adapt the Arduino IDE to other platforms such as ATTiny and ATmega16, 128, 164, etc.
Yes, you just need to patch your wiring.c file with the provided patch. It basically makes the delay()/millis() functions work, which is very useful.
Keep me posted on your experiments/problems/achievements. Good luck!