damellis / attiny

ATtiny microcontroller support for the Arduino IDE
722 stars 227 forks source link

Add ATtiny13 w/ four internal frequencies. #44

Closed Marcussacapuces91 closed 8 years ago

Marcussacapuces91 commented 10 years ago

Add ATtiny13 with 4 internal frequencies

NicoHood commented 9 years ago

Dont we need a special variant here or is the pin function exactly the same?

rsp commented 8 years ago

This PR has been open for over 2 years. Any updates?

damellis commented 8 years ago

The pull request looks obsolete at this point because the boards.txt file has been reorganized. I'm not opposed to adding other ATtiny variants, if someone wants to do a new pull request.

For this particular case, it would also be good to explain why the CPU speeds are different than the other processors.

I'm going to close this pull request but leave the corresponding issue, #74, open.

rsp commented 8 years ago

@damellis Fair enough. I was wondering myself why the speeds were so strange.

ATtiny13 variants can be clocked at: ATtiny13A: 0-4 MHz @ 1.8-5.5V, 0-10 MHz @ 2.7-5.5V and 0-20 MHz @ 4.5-5.5V ATtiny13V: 0-4 MHz @ 1.8-5.5V, 0-10 MHz @ 2.7-5.5V ATtiny13: 0-10 MHz @ 2.7-5.5V, 0-20 MHz @ 4.5-5.5V So for all of those chips 4, 10 and 20 MHz seem to be most needed and yet none of those values were present in the patch.

I'd be interested in adding the ATtiny13 support but in a way that could be accepted and merged to this project. Could you give me any hint on how should I do it right?

My understanding is that I should check with the spec if the variants/tiny8 is compatible with ATtiny13 and reference it if it is or make a new variant if it isn't, and add suitable data to boards.txt. Is that correct? Should I watch for anything in particular checking the variant compatibility or just the pin functions? Thanks for any hints.

damellis commented 8 years ago

One important issue is pin numbering. It might be good to be consistent with the ATtiny25/45/85, unless there are significant differences in the pin functionality. Maybe look to see if there are existing ATtiny13 Arduino files and follow those conventions?

But yes, generally it should be a question of creating / adapting the variant files and adding the right entries to boards.txt. Generally, as much consistency as possible with the existing boards / processors would be good -- or, at least, explanations for divergences.

rsp commented 8 years ago

@damellis Thanks. I'll post a PR if I have something working.

bmcewen commented 8 years ago

I have successfully programmed sketches (IDE) and raw .hex files (using avrdude via command-line) on ATTiny13A at multiple clock frequencies using each of: https://github.com/MCUdude/MicroCore and https://sourceforge.net/projects/ard-core13/files/latest/download

both repos have boards.txt and /hardware folder structure content suitable for IDE 1.6.X.
I am using both IDE 1.6.11 and avrdude on OS X at time of this writing, no other OS tested.