Pages: 1 [2] 3 4 5   Go Down
Author Topic: How to program ATtiny2313, given an Arduino Duemillanove  (Read 11117 times)
0 Members and 1 Guest are viewing this topic.
Washington
Offline Offline
God Member
*****
Karma: 38
Posts: 789
Firefox & Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You are better off using avr-gcc and avrdude directly when programming an attiny.
Logged

Avoid throwing electronics out as you or someone else might need them for parts or use.
Solid state rectifiers are the only REAL rectifiers.
Resistors for LEDS!

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 197
Posts: 12744
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Excellent!  I'm glad you have it working.
Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 197
Posts: 12744
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You are better off using avr-gcc and avrdude directly when programming an attiny.

Why?
Logged

Romania
Offline Offline
Full Member
***
Karma: 0
Posts: 174
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@smeezekitty
well you are already using both of them smiley-razz cause even if your using arduino ide or other ide youll compile your code with avr-gcc same for avrdude even if you use the bootloder or not you still need avrdude
probably you meant programming the attiny in C but why , as Coding Badly asked, not sure what youll gain smiley
Logged


Washington
Offline Offline
God Member
*****
Karma: 38
Posts: 789
Firefox & Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You are better off using avr-gcc and avrdude directly when programming an attiny.

Why?

I wasn't even aware that the Arduino IDE could program non arduino-like boards until recently.
The boards.txt is not very flexible in built parameters.
Also, if you need to program both the Arduino and attiny on a regular basis, that would equate to alot of board switching.
Logged

Avoid throwing electronics out as you or someone else might need them for parts or use.
Solid state rectifiers are the only REAL rectifiers.
Resistors for LEDS!

0
Offline Offline
Full Member
***
Karma: 0
Posts: 117
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@smeezekitty, thanks for adding that spin. Apparently, there is lot of misinformation -- or let's say, just plain confusing information out there, that gives an impression that programming AVRs using Arduino IDE is actually 'suboptimal' compared to say programming it directly using plain'ol C using a compiler. What a coincidence, that I asked a specific question about it here on the exact same subject.

What I do continue to wonder about however, is, are there avr-libc alternatives that are smaller / lighter, which probably break-down the functionality in avr-libc into smaller modules, s.t. you can save on program memory on the extremely tiny attiny's like attiny13 ?

I see that Arduino-Tiny google-code pages seems to allude to support for attiny13's (figures as one of the search tags on the project). Is that a reality ? I don't see an option in the IDE, so thought of asking. Or is attiny13 one of those AVRs which cannot be programmed in C ? My understanding that is only for those which have no SRAM.
Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 197
Posts: 12744
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What I do continue to wonder about however, is, are there avr-libc alternatives that are smaller / lighter, which probably break-down the functionality in avr-libc into smaller modules, s.t. you can save on program memory on the extremely tiny attiny's like attiny13 ?

It is possible but very unlikely.  The folks who developed AVR Libc have done a fantastic job of balancing high performance and low memory consumption.

Quote
I see that Arduino-Tiny google-code pages seems to allude to support for attiny13's

Are you referring to this?
Quote
Sofian Audry and Samuel St-Aubin published a '13 core... http://accrochages.drone.ws/en/node/38

Quote
(figures as one of the search tags on the project)

I don't understand.

Quote
Is that a reality ?

It is on my computer.  Unfortunately, I have not had time to finish it for publication.

Quote
Or is attiny13 one of those AVRs which cannot be programmed in C ?

The ATtiny13 can be programmed in C.  It has (just barely) enough resources for non-trivial applications.  For example, I built a "tea timer" (basically, it's a specialized kitchen timer) for my wife using an ATtiny13A, the Arduino IDE, the Tiny Core 2, and an Uno acting as a programmer.
Logged

Washington
Offline Offline
God Member
*****
Karma: 38
Posts: 789
Firefox & Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset



What I do continue to wonder about however, is, are there avr-libc alternatives that are smaller / lighter, which probably break-down the functionality in avr-libc into smaller modules, s.t. you can save on program memory on the extremely tiny attiny's like attiny13 ?
I would agree with Coding Badly. avr-libc is written in highly optumized ASM and C. Most the the functions are plenty small the a attiny13.
Some are too large such as floating point, stdio and dynamic memory allocation but with 1K of flash and 64b of ram that isn't too bad smiley
Quote
I see that Arduino-Tiny google-code pages seems to allude to support for attiny13's (figures as one of the search tags on the project). Is that a reality ? I don't see an option in the IDE, so thought of asking.
I do think this is the case.
But working with PORTB and stuff like that isn't that hard once you learn about it. Its faster too.
Quote
Or is attiny13 one of those AVRs which cannot be programmed in C ?
I am  playing with one programmed in C right now smiley-wink
Logged

Avoid throwing electronics out as you or someone else might need them for parts or use.
Solid state rectifiers are the only REAL rectifiers.
Resistors for LEDS!

0
Offline Offline
Full Member
***
Karma: 0
Posts: 117
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks @Coding-Badly and @smeezekitty.

Coding-Badly, would be great if you could publish the attiny13 support in Arduino-Tiny. Maybe just count this as a +1 up vote for the request.

Smeezekitty, would like to take that approach of dealing with PORTB, but getting there, slowly. Right now, the direct port manipulation seems a bit daunting (not scary though!).
Logged

Belgium
Offline Offline
Full Member
***
Karma: 0
Posts: 144
Just Do it (with Arduino of course)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@falcon74, I'm not sure what you exactly look for as "more optimal libraries", but you could take a look at the work done by the "MHV" guys (make hack void) in Australia. I believe they did some kind of optimisations. Not sure what kind, nor on which libraries, though.
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 117
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@falcon74, I'm not sure what you exactly look for as "more optimal libraries",

Well what I meant is based on an impression I've formed (without deep insights) reading various posts is that Arduino libraries are often, not the most optimal because of the fact that the software tries to cater to several AVR uC's, with varying parametrics/functionalities. A solid case in point, which I've encountered first hand is the difference between "DigitalWriteFast" lib and the standard Digital I/O library bundled with Arduino (or as part of the core).

but you could take a look at the work done by the "MHV" guys (make hack void) in Australia. I believe they did some kind of optimisations. Not sure what kind, nor on which libraries, though.

Thanks, will check this out. Other such libraries seem to be the spin around Timer1 library which people apparently have used to get higher resolution / reliability delays, when say PWM function is not required. This one I am citing from memory, so I could be wrong, as I've not yet been successful in using Timer1 (though I do want to).
Logged

Washington
Offline Offline
God Member
*****
Karma: 38
Posts: 789
Firefox & Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Well what I meant is based on an impression I've formed (without deep insights) reading various posts is that Arduino libraries are often, not the most optimal because of the fact that the software tries to cater to several AVR uC's, with varying parametrics/functionalities. A solid case in point, which I've encountered first hand is the difference between "DigitalWriteFast" lib and the standard Digital I/O library bundled with Arduino (or as part of the core).
avr-libc is not Arduino specific.
Logged

Avoid throwing electronics out as you or someone else might need them for parts or use.
Solid state rectifiers are the only REAL rectifiers.
Resistors for LEDS!

0
Offline Offline
Full Member
***
Karma: 0
Posts: 117
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, what I meant was something like this. Found pretty recently.
Does anyone here have experience with this, and any feedback to share regarding it ?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

will the exact above procedure work on Linux(Ubuntu)..?
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 117
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@technodict, if your question is about the procedure for using Arduino-as-ISP to program attiny2313A's, then the answer is YES. The only thing different is selection of USB device for Arduino (since windows and Linux device naming and access is different... Windows being COM1, COM2... and Linux being /dev/ttyUSB0, /dev/ttyUSB1...), and the pathnames.. especially the Sketchbook path.
Logged

Pages: 1 [2] 3 4 5   Go Up
Jump to: