Close

ATtiny10 Nyan Cat

A project log for Nyan Board

A small ATtiny85 board playing the Nyan Cat tune.

ꝺeshipuꝺeshipu 01/04/2017 at 11:358 Comments

Just in time for the contest, the boards from OSHPark arrived today!

I immediately assembled one in order to test it.

During that process, I learned about a new revolutionary discovery by the Chinese scientists! In their secret laboratories they developed a new kind of copper wire, one that is utterly impossible to solder, no matter how much flux you use and how hot the soldering iron is. Apparently, I got some wires like that from them, possibly by mistake. Using wires from a different vendor made it finally work (I also had to remove the speaker from the clock pin during programming).

Once I finally managed to flash the code, I only got clicks. A quick inspection revealed, that I used wrong pins for the speaker and the LEDs! The code expected speaker to be on PB0 and the LEDs on PB1. But the PCB puts the speaker on PB1 and the LEDs on PB2. Changing the LEDs pin is trivial, but can I change the speaker pin? Turns out that yes, the PB1 pin also is connected to the timer, and I vaguely remember changing the pins while designing the PCB with this in mind. I must have completely forgotten about it afterwards. In any case, just changing COM0A0 to COM0B0 fixed the problem. I also fixed a small bug where I only cleared TCNT0L and not the whole TCNT0, and it works.

The last bugfix made the code 2 bytes bigger, but it still fits within the limits:

AVR Memory Usage
----------------
Device: attiny10

Program:     502 bytes (49.0% Full)
(.text + .data + .bootloader)

Data:          0 bytes (0.0% Full)
(.data + .bss + .noinit) 

Discussions

Travis Hardiman wrote 06/24/2018 at 04:47 point

Does the attiny10 branch on bitbucket have the latest source? I'm trying to use this: 
https://bitbucket.org/thesheep/nyan/src/tiny10/main/
But the Makefile specifies an attiny85 and the comment is "ATtiny13 code" - so I'm a bit confused. :-)

Regardless this is such an awesome project! Thanks!

  Are you sure? yes | no

ꝺeshipu wrote 06/24/2018 at 09:04 point

The code should be good, but I probably forgot to update the makefile. I don't quite remember after all this time, sorry about that. I think I simply didn't use it for flashing to the attiny10, but the changes should be trivial.

  Are you sure? yes | no

ꝺeshipu wrote 06/24/2018 at 12:29 point

It looks like the code is wrong too. I'm afraid I have lost the tiny10 code. I will try to re-create it, and update the repo with a working version. Sorry.

  Are you sure? yes | no

ꝺeshipu wrote 06/24/2018 at 13:03 point

I re-created the code and fixed the makefile, you can get it at https://bitbucket.org/thesheep/nyan/src/tiny9/main/ (it should work both for tiny9 and tiny10)

  Are you sure? yes | no

Travis Hardiman wrote 06/24/2018 at 17:09 point

Awesome, thank you so much! 

  Are you sure? yes | no

oshpark wrote 01/04/2017 at 18:39 point

Love it!  Well done 

  Are you sure? yes | no

davedarko wrote 01/04/2017 at 12:53 point

So what's your favorite version? What's the cheapest?

  Are you sure? yes | no

ꝺeshipu wrote 01/04/2017 at 13:02 point

I think the ATtiny10 is my favorite, and it's also the cheapest.  Not only ATtiny10 is the cheapest, but I also dropped the second resistor in this version, so you also have fewer parts. The 16-bit timer gives quite a nice range too, if you wanted to make it play some other tunes. I suppose I could shrink the PCB a little bit too, making it even cheaper, but that's not a priority. And there is one more free pin...

Or maybe it's just my most recent project, so I like it the most?

  Are you sure? yes | no