Close
0%
0%

Nyan Board

A small ATtiny85 board playing the Nyan Cat tune.

Similar projects worth following
This is just a purely for fun project, that is supposed to get me into programming those small ATtiny chips. I got this idea when I looked at the ribbon cable of my programmer -- it's a rainbow!
The board doesn't do much, just blink the cat's eyes and play the tune on a buzzer.

gerber.zip

Gerber files for 6 nyan boards (5 for attiny45, one for attiny13).

Zip Archive - 92.57 kB - 11/28/2016 at 10:44

Download

View file

  • Crazy Custom Colors

    Radomir Dopieralski03/15/2017 at 10:46 4 comments

    At the beginning of this year, DirtyPCBs announced a new service: Mystery Color PCB Group Buy. The idea is similar to what OSHPark does -- you get 3 PCBs and get charged by the surface area. But there is a twist -- they are going to experiment with various soldermask color combinations, and you never know what you get.

    I decided to try this, and made an order for the single Nyan Board -- because I thought it would be fun to have it in a crazy color. The example PCB on the picture is pink, so I expected something flashy. I made my order on February 05, 2017. Today is March 15, 2017 and the PCBs arrived. I have to admit that this is a bit longer than I expected.

    But never mind that, what are the new exciting colors? I have to admit that I am a little bit disappointed here too. Here's a photo:

    First of all, the boards are mostly naked FR4. The soldermask is present only where there is either copper or silkscreen -- all the other areas are simply unpainted. That pretty much ruins everything.

    The soldermask itself is a kind of body color orange, which might be interesting for human figures or faces, if only you knew the color in advance and could somehow get the whole board covered in it. The silkscreen is pretty much standard unexciting black.

    On the plus side, I ordered 3 boards, and I received 11, which is a bit strange, but I guess a good deal for $4 with shipping.

    Update:

    After talking with DirtyPCBs, I examined my boards closely, and realized how wrong and unfair I was. The soldermask is not missing from between the copper traces. And it's not orange -- that orange is just the color of copper traces covered with it. Yes. The soldermask is transparent! This opens a lot of possibilities for novel designs, although I still have to say that it would look much better if the FR4 underneath was some other color than the default.

    Also, they refunded it to me completely, and now I feel like a complete jerk.

  • ATtiny10 Nyan Cat

    Radomir Dopieralski01/04/2017 at 11:35 3 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) 

  • ATtiny10 Board

    Radomir Dopieralski01/01/2017 at 15:01 0 comments

    I'm still waiting for this board to ship from OSHPark, but since I tested the code with the chip already, I'm quite confident it will work just fine. Since it will probably not get here before the contest, I will share the order link here: https://oshpark.com/shared_projects/CWLBdY8g


  • ATtiny10 Working

    Radomir Dopieralski12/31/2016 at 11:23 0 comments

    As soon as I posted the last log, I realized what the problem was. The TPICLK wire was loose all this time. After fixing that, programming with AVRdude and USBASP went without any problems, and I could test my music-playing code.

    Of course it didn't work properly at first. I had to change the timer initialization a little, use a different prescaler and adjust the octave. I also decided to run the timer at a higher frequency, because it's a 16-bit timer, so I can get better accuracy this way -- so I'm actually shifting the counts for the tones right a few bits.

    But I still got some very weird glitches here and there, and I couldn't quite see the problem, until I realized that they happen randomly, but only when a higher frequency sound goes after a lower frequency. Finally I realized, that when I'm changing the timer's match register, I'm not resetting the counter -- so if the counter is already past the point to which I'm setting the register, it will go all the way up to the full 16 bits before it resets. That also happened with the 8-bit counters on the other chips, but it wasn't so visible, because the distortion was very small. With a larger timer it became much easier to hear. A fix is trivial -- just reset the counter.

    And that extra code for resetting the counter took me exactly to 500 bytes of compiled code:

    AVR Memory Usage
    ----------------
    Device: attiny10
    
    Program:     500 bytes (48.8% Full)
    (.text + .data + .bootloader)
    
    Data:          0 bytes (0.0% Full)
    (.data + .bss + .noinit)
    

    I guess I could put more songs in there...

    In any case, now I'm just waiting for the PCBs to arrive. In retrospect, I could have made those new PCBs even smaller than currently -- with the puny ATtiny10 and a single resistor they are almost empty. But the piezo speaker takes some room, so I guess this size is fine.

  • ATtiny10

    Radomir Dopieralski12/30/2016 at 21:25 1 comment

    So the surprise chip, ATtiny10, arrived, and I started to work on programming it. I already have the code for it prepared, and the PCB has been ordered a week ago, so I just need to get the code on the chip somehow.

    The ATtiny10 is not like the larger ATtinys -- it doesn't use ISP (aka SPI) for programming, but instead uses something called TPI (tiny programming interface), which seems to be something like half-duplex SPI. When I was upgrading my USBASP programmer, I noticed that the firmware has added support for TPI, and that it's already in AVRdude too, so it should be simple, right?

    I soldered the tiny chip to a breakout board (the last row of pins uses two pads, because the alignment wasn't quite right, but the connections are good), I connected my programmer according to the schematic I found on some Polish blog (good thing I know the language) at http://mirekk36.blogspot.ch/2013/07/attiny10-tpi-usbasp-mkavrcalculator.html and I proceeded to upload the hex file with:

    avrdude -c usbasp-clone -p t10 -U flash:w:main.hex:i
    

    The result? Of course the well known and loved message error:

    avrdude: error: program enable: target doesn't answer.
    avrdude: initialization failed, rc=-1
             Double check connections and try again, or use -F to override
             this check.
    
    I tried with different clock speeds, with the "slow clock" jumper, I disconnected and reconnected the whole thing several times, I measured the resistances. It all checks. Should work. Doesn't.

    I even made a side trip to try and program it with a CP2102 USB2TTL, which AVRdude apparently can do, but that didn't work either.

    So now I'm sitting here after a whole day of trying to program this thing, looking at it, and considering giving up.

    If anybody has any experience with this, or some suggestions for things to try, I'm open for ideas.

  • ATtiny13

    Radomir Dopieralski12/21/2016 at 15:08 0 comments

    The ATtiny13 chips finally arrived, and I can test the code from the "tiny13" branch on real hardware (find it at https://bitbucket.org/thesheep/nyan/src/tiny13). After some struggling with getting my USBASP programmer to work with the chip (I needed a newer firmware and a -B option for avrdude to slow the clock), I got it flashed and playing:

    It's a bit too fast, but changing the clock definition in the Makefile to 1200000 fixed that. The tone is probably wrong too, but I'm tone-deaf, so I don't care.

    The difference from the regular Nyan Board is that it uses Timer0 (because there is no Timer1 on ATtiny13), and a different pin for the speaker. If you look at the six cats on the PCB, you will see that one is slightly different -- that's the ATtiny13 version.

    I still have one more chip to try for the Nyan Board, but that is going to be a surprise.

  • Nyan Boards in Singles (Actually Triplets)

    Radomir Dopieralski12/02/2016 at 18:37 3 comments

    So you want to try making your own Nyan Board, but you don't feel like ordering 60 of them and waiting a month? Here's a link to OSHPark for a version of the PCB with a single cat: https://oshpark.com/shared_projects/HUWiMrKc

    For me the price is $3 for 3 boards, which sounds reasonable. And it comes in any color you like, as long as it's purple.

  • Faulty Parts

    Radomir Dopieralski12/02/2016 at 10:24 0 comments

    I assembled the first of the new Nyan Boards. It could be programmed, but it didn't do anything. I spent an hour debugging all the connections and checking connectivity on an unpopulated board and all that -- nothing. So I assembled a second one. It couldn't even be programmed. So I removed the chip from it and tried another. Same. Then another. That one worked.

    I think that keeping my attinys loose at the bottom of the drawer might have been a mistake.

    (Oh, and I used yellow LEDs, because the green ones didn't arrive yet.)

  • Boards Arrived

    Radomir Dopieralski12/01/2016 at 17:18 6 comments

    Here they are:

    I broke off one, put the attiny, speaker and wires on it, and programmed it -- but no sound. No idea why yet.

  • Schematic

    Radomir Dopieralski11/28/2016 at 10:43 9 comments

    I just realized that I never wrote about the schematic of the board. Sure, it's very simple, but for completeness' sake:

View all 23 project logs

  • 1

    Separate a single cat from the rest of the board. You can use a rotary tool, a scroll saw, a hand saw or a file. For best effect, round off the edges.

  • 2

    If it's a cat with holes for the eyes, you need to get rid of the metallic layer inside the holes. Cut it with a knife until there is no electrical connection between the pads of the LED.

  • 3

    Solder all the parts onto the board. Also solder an additional wire for the reset.

    Pay attention to the polarization of the LEDs.

View all 7 instructions

Enjoy this project?

Share      

Discussions

Sabas wrote 02/06/2017 at 18:06 point

Hi, Could you publish the 'single' version in SVG please, thanks

  Are you sure? yes | no

Radomir Dopieralski wrote 02/06/2017 at 18:13 point

Sorry, I don't have it anymore, but it should be trivial to edit the 6-pack version and remove 5 copies.

  Are you sure? yes | no

Kaspar Johannes Schneider wrote 12/20/2016 at 14:38 point

What color should I choose for the eyes? I really can't decide ;-(  #FirstWorldProblems

  Are you sure? yes | no

Orlando Hoilett wrote 11/28/2016 at 12:10 point

You have to sell this. 

  Are you sure? yes | no

danjovic wrote 11/25/2016 at 00:37 point

It was necessary for me to put a 100nf capacitor between VCC and GND so the Tiny AVR could run fine.

  Are you sure? yes | no

bogdan wrote 11/23/2016 at 06:47 point

a nice feature would be to simulate R2D2 sounds :)

  Are you sure? yes | no

davedarko wrote 11/23/2016 at 07:50 point

Well than it has to be an r2d2 shaped board too :)

  Are you sure? yes | no

arief ibrahim adha wrote 12/11/2015 at 11:43 point

that's cute 

  Are you sure? yes | no

alpha_ninja wrote 12/07/2015 at 00:23 point

[verified: no design files missing]

  Are you sure? yes | no

alpha_ninja wrote 12/02/2015 at 00:47 point

This is your one-week reminder to upload design documents: https://hackaday.io/project/7813-the-square-inch-project/log/28566-design-deadline

  Are you sure? yes | no

Radomir Dopieralski wrote 12/02/2015 at 09:24 point

Um... I uploaded them all right when I started the project. Is there something missing?

  Are you sure? yes | no

alpha_ninja wrote 12/02/2015 at 14:04 point

I posted that comment on all entries. I just checked, and you're supplying all files necessary, though you must add gerbers for just one board (without panelization) since the 1x1 inch requirement isn't fulfilled otherwise.

  Are you sure? yes | no

alpha_ninja wrote 12/02/2015 at 14:07 point

Whoops—wrong project :P You're fine, though I'd like to suggest adding the approximate prices for your components.

  Are you sure? yes | no

Radomir Dopieralski wrote 12/02/2015 at 21:27 point

Thanks, I added the gerbers for a single board to the repository.

  Are you sure? yes | no

Adam Vadala-Roth wrote 11/11/2015 at 00:17 point

I need this 

  Are you sure? yes | no

weiman wrote 11/10/2015 at 15:13 point

YES! I need this in my life!

  Are you sure? yes | no

Karol Kucza wrote 10/25/2015 at 13:54 point

Can you share Gerbers or Fritzing project file? I would like to make it more colorful.

  Are you sure? yes | no

Radomir Dopieralski wrote 10/25/2015 at 14:05 point

Ah, I just realized I didn't! Sorry. Fixed now, should be listed in links.

  Are you sure? yes | no

Karol Kucza wrote 10/25/2015 at 14:14 point

I think repository you have just added is private.

  Are you sure? yes | no

Radomir Dopieralski wrote 10/25/2015 at 14:16 point

Fixed.

  Are you sure? yes | no

Karol Kucza wrote 10/25/2015 at 14:18 point

Thanks!

  Are you sure? yes | no

Erin RobotGrrl wrote 10/24/2015 at 16:28 point

Ahhh! So cute! Best use of ribbon cable!

  Are you sure? yes | no

danjovic wrote 10/24/2015 at 11:07 point

How Cute!!! Nice done, pal!

  Are you sure? yes | no

Radomir Dopieralski wrote 10/24/2015 at 12:22 point

Thank you. It's nice to do something simple that can actually be done in finite time for a change.

  Are you sure? yes | no

chaosbc wrote 10/23/2015 at 11:18 point

now shut up and take my money, I want one !

  Are you sure? yes | no

Aleksander Kawęczyński wrote 10/07/2015 at 08:12 point

Hello! I found Your project on Dirtypcb's, and looks fun :) Will it be possible to buy from You one pcb, when You get it?

  Are you sure? yes | no

Radomir Dopieralski wrote 10/07/2015 at 08:20 point

No, but I can just send it to you. I will let you and @Daniel Rojas know when they arrive.

  Are you sure? yes | no

Aleksander Kawęczyński wrote 10/07/2015 at 08:43 point

Thats awesome :) Maybe some of my last order from dirtypcbs.com you find interesting, and i send you too - http://dirtypcbs.com/view.php?share=8149&accesskey=121bb6955f968c75ed3919a7dfa0355d

  Are you sure? yes | no

Daniel Rojas wrote 10/06/2015 at 14:12 point

This thing is completely pointless. I WANT ONE!!!

Seriously though, nice project :-) Love the ribbon cable rainbow thingy.

  Are you sure? yes | no

Radomir Dopieralski wrote 10/06/2015 at 14:45 point

Thank you. I'm sure I will be giving out some of the 60 boards that I ordered, so you can get one, if you really want.

  Are you sure? yes | no

Daniel Rojas wrote 10/06/2015 at 15:31 point

:-D I would not say no...

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates