ATtiny13 POV display: same hardware, different message

ATtiny13 POV display: same hardware, different message


St. Patrick’s Day is coming up and I thought it’s already time to update the original Valentine’s Day POV display with a new message and make use of the second PCB I had done at BatchPCB. Also, fortunately, John “smeezekitty” (the author of the Attiny13 core used for programming it in Arduino IDE) stopped by my blog and pointed out to an issue with the original firmware, which prompted me to take another hard look at it and the result has been a saving of whopping 20 or so bytes – it was just enough to fit the word “BEER” which, as I mentioned in the original post, we did not have any space in flash left for. Well, now we do and below is the new software

Oscillating POV display circuit diagram

Oscillating POV display circuit diagram

Please note that the Arduino sketch has two sets of array definitions in the beginning – for LEDs wired straight and LED wired in a reversed order (i.e. LED1 is at the top, not at the bottom). This is just a result of my boneheaded mistake throwing LEDs on the board without taking a second of my time to realize their actual spacial position on the final board. So, the PCBs that I got from BatchPCB ended up with LEDs flipped (LED1 – top, LED6 – bottom) and it was very easy to adjust the software accordingly. But if you’ve built your POV display using the original schematics (here it is on the left, one more time).

I have tried to comment as much of the code as I could in case you are making adjustments.

There’s still some space for an even longer message now although it’s getting really hard to fit them into the physical space now – since this is an oscillating POV display, you are limited by the path your arm is plotting while going back and forth – it’s probably only about a foot (30 cm) before it starts looking like a pretty vigorous cardio exercise :) In other words it’s very unlikely that it’s going to be very convenient to swing a POV display with “I ❤ HOMEWORK” even though there’s probably just enough memory left in Attiny13 to fit it all in.

OK, enough talk, here is the new code with the “I ❤ BEER” message.

POV display on Attiny13 – I HEART BEER message

Cheers!

4 Responses to “ATtiny13 POV display: same hardware, different message”

  • Phil:

    Hi,

    I have try to make your “skaky POV” this weekend.
    I have use the µC I have : ATTINY85.

    I believe that the way to do interrupts on ATTINY85 is different on ATTINY13… It can explain my failure…

    Can you explain me a little more the usage you made of the external interrupt on your code ?
    In your source code I see were you enable interrupts
    (
    sbi(GIMSK,PCIE); // Turn on Pin Change interrupt
    sbi(PCMSK,PCINT3); // Which pins are affected by the interrupt
    )
    but I don’t understand the action that are linked to this external interrupt.

    Do you think it is possible to do the same thing with “pure arduino instruction” like attachInterrupt() ?

    • I think the interrupt implementation is the same in ATtiny85 (although I have to admit I haven’t checked yet). The sleep mode functions set_sleep_mode(), sleep_mode() come from an external library called sleep.h – make sure your sketch has it included in the beginning. As far as action linked to the interrupt – there is no special function linked (one reason not to use attachinterrupt() ) – because nothing should be happening before the interrupt occurs, so the linked action is essentially the main loop. Until the interrupt comes, the MCU sleeps and executes no code whatsoever.

      Another reason I did not use attachinterrupt() was that I was not sure if the function was implemented in the Attiny13 core I’ve used for compiling the sketch. It may be there, actually, I just didn’t look because there was an alternative way to do the sleep without relying on the feature. When I had just started smeezkitty’s ATtiny13 core, it had only the bare essentials in it. I know that John had done more work on it and it’s more “polished” now – perhaps the function is there by now. But, nevertheless, since you’re using a different MCU and therefore a different core, the standard attachInterrupt() may be implemented there. In fact, I’d be surprised if it’s not in the MIT core for ATtiny85.

      Thanks for stopping by my blog!

      • Phil:

        Thanks you for your anwser.

        I think I have understood the usage you make of interupts.
        But after tring several setups (software and hardware), I haven’t reach a functional state. Maybe it’s due to my tilt sensor.
        Can you tell me if you are using a tilt sensor like this one : http://www.ebay.com/itm/370516344093?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649 ?

        Best regards

        Phil

        • The sensor itself is fine, I’ve used exactly the same. They are incredibly simple devices – just a small metal ball bouncing around a metal cylinder with another isolated metal contact at one end. Take a look at the way the switch is hooked up – perhaps it’s missing a pull-up resistor? Maybe you’re connecting to a different pin on Attiny? You can also temporarily replace it with just a pushbutton and see if the LEDs start to blink very rapidly after you press it.

Leave a Reply

Or use the Forums ! If your comment is a question, please consider posting it to a matching section of our Electronics Forums. The forums allow for a more natural conversation flow, especially if multiple replies are required. Additionally, you'll be able to style your writing (bold font, italics etc.) and post images which can help with a good answer.

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Tools

Coming soon ...

Recent Comments
  • admin: I’ve used this TTL-controlled laser diode driver
  • John Chase: What kind of power source are you using?
  • Ezequiel França dos Santos: Thank you very Much!
  • Deives: Hello friend, first I would like to congratulate you on an excellent project. Well I am Brazilian and I have...
  • admin: Well, I did give it some thought and have been meaning to try for some time now. But, in general, the approach...
  • Adi Soffer: Hey there. Great post and thank you for sharing. I’m trying to figure out how to control a...
  • Tony: So many thanks!
  • admin: Thanks for stopping by, Tony. I’ve posted an LTSpice model of the driver some time ago, check it out:...
  • Tony: a little question: I am using Multisim to simulate your circuit and what load should I use? When I use a...
  • admin: The sensor itself is fine, I’ve used exactly the same. They are incredibly simple devices – just a...
Meta