Smart A Worklog

Written by eipromb on April 22, 2008 – 1:51 pm -

This is not really guide but more of a worklog. After hearing and seeing complaints about the difficulty of the Multicoloured A Button Backlight mod, I decided to make it a bit easier. This is where the Smart A Button Backlight comes in, its the Multicoloured A Button Backlight at heart but powered by a microcontroller instead of the wiimote. Its interface to the wiimote would use a similar method as most of the newer modchips dubbed the ‘Quick-Solder’ method.

Choosing Components:
The mod would consist of 4 multi-coloured LEDs, appropriate current limiting resistors, a circuit board and a microcontroller to drive it. The 4 LEDs were an easy choice, I would use the same 0603 LEDs in blue, red, green and yellow at the original mod. For the resistors, it would have to be a value to keep the power consumption to a minimum, again using the same 0603 package as the LEDs. The circuit board would probably be the most expensive individual component as it is with most electronics of this nature, it’s design would have to incorporate the ‘Easy-Solder’ method of installation. And finally the microcontroller, my choice with this project was the Atmel ATTiny12. It’s a tiny and inexpensive chip at roughly $2 each, the chip also contains onboard eeprom memory, which its smaller brother the ATTiny11 doesn’t have. Why is eeprom memory important? It will be used to store the user’s preferred LED colour when the wiimote is powered down.

Schematic:
This is the schematic I came up with for this project, it’s rather simple.

Normally you would see LEDs being individually driven by a single pin on the microcontroller, the ATTiny12 has 6 I/O pins - 3 on each side. In this project however the LEDs aren’t driven by a dedicated pin, they’ve been charlieplexed to drive 4 LEDs using 3 pins. I’ve designed it this way to prevent a problem with designing the circuit board, I’ll explain it in futher detail in the board design section of this log.

Because this mod is mostly independent from the wiimote, there needed to be a way to set the colour of the LED. On the original Multicoloured A Button Backlight mod there were wires directly connected to each of the wiimote’s original LEDs, however this mod’s purpose was to avoid that problem all together. To solve this program I’ve used the PB1 pin of the microcontroller, this pin will be used as an input to set the colour of the LED and will be connected to the ‘home’ button on the wiimote. If you’re wondering why I used PB1 instead of the other 5 pins, it’s because this pin is the only pin on the ATTiny12 that can be used as an external interrupt. I’ll explain more about the interrupts, if you’re not familiar, once we get to the programming portion of the work log.

At this time the work log is only completed to this section, I’ll continue it and eventually get to the final product over the next few days. For the impatient ones, you can watch a short clip of the prototype over on youtube.

Circuit Board:
The circuit board was designed in PADS, which isn’t as popular as Eagle or OrCad but was what I was trained in and comfortable working with. There were obvious restrictions when designing the circuit board; it needed to fit in the wiimote, all the components and circuit traces had to work around the QuickSolder installation pads, and to make it DIY friendly it had to be done on a single layer.

The image above shows the layout I was able to design. Since the board would be designed single-sided, using 4 pins would have forced me to use a via (a plated hole that connects two or more copper layers) and be double-sided. Some may notice that there are 2 pins not being used, why didn’t I just use those? PB5 (pin 1) as an output can only act open-drain, meaning it is unable to directly drive an LED. PB0 (pin 5) would have worked, but would have required a second layer.

Smart A Button Firmware:
Here’s the source code for the Smart A Button’s microcontroller. It’s in assembler and was programmed in AVR studio, I realize that it may not be the neatest or most optimized code, but it is open for everyone to see and update if you desire.

If you’re not familiar with assembler, or just don’t want to bother looking over it, I’ll explain it’s function.

Upon powerup, the ucontroller looks for the pattern ‘01010101′ in the eeprom. If the ucontroller finds this code it will then retrieve the last saved setting in the eeprom and turn on the appropriate LED. If it does not find the pattern, it assumes that either this is the first time powering on, or the eeprom has been corrupted. It will then write the pattern, and a valid save setting into memory.

After powering on, and initializing the LED, the ucontroller goes into idle mode and does nothing. This is to keep the ucontroller from wasting power. A press on the ‘home’ key will activate an interrupt and awaken the ucontroller, it then waits for 1 second to pass before it allows the user to change the LED setting. It will turn off the LED as a visual indication that it is able to change settings, further presses on the ‘home’ button will cycle through the LEDs. After 2 seconds of inactivity, the ucontroller saves the setting in eeprom and returns to idle mode.

Pretty simple no? That also explains how to use it; hold the ‘home’ button down until the LED turns off, then keep pressing the ‘home’ button until the Mod has cycled to the LED you want to leave on. Leave the ‘home’ button for 2 secs and the value will be saved.

Here’s the source code for those who want to make your own, or edit it to make the mod do fancy tricks. I’ll post any user submission I get, so please send them in!

What you’ll need:
1x Blue 0603 LED
1x Red 0603 LED
1x Green 0603 LED
1x Yellow 0603 LED
3x 15ohm 0603 resistors
1x Atmel ATTiny12 SOIC8 package
1x Etched Circuit Board

If you have access to a programmer to program the ATTiny12 - the source code can be downloaded.  And if you’re etching your own board - a 1:1 photopositive PDF of the board can be downloaded.That should be enough info to make your own for those who can, if you’re not able then you can get yours on the mod kits page.


Tags: , , ,
Posted in Guides |

8 Comments to “Smart A Worklog”

  1. Sam Force Says:

    these are NEVER in stock! I have LEDs and can solder but cannot etch a board or program a micro controler. Please get this back in stock (make some more) or offer it as a kit (just the microcontroler, resistors and board) so people can add their own colors (I have pink and purple 0603 LEDs that I want to use)

  2. Ben Says:

    Good post. Your posts are really interesting. To have a good blog you should not only to post something, but do it with your soul. You do your best.

  3. johnny Says:

    lMEZ6R Thanks for good post

  4. Boullie Says:

    Same here!
    I understand that the pre-built sets would be a problem, for mass production, but the diy-kits shouldn’t have to be a problem…

    please, make the kits available!

    tnx

  5. Kylie Batt Says:

    Могу порекомендовать зайти на сайт, где есть много информации на интересующую Вас тему….

    Менеджер по снабжению. This is where the Smart A Button Backlight comes in, its the Multicoloured A Button Backlight at heart but powered by a […….

  6. Kylie Batt Says:

    Браво, замечательная идея и своевременно…

    Инструктор групповых программ,инструктор тренажерного зала,акваэробики This is where the Smart A Button Backlight comes in, its the …

  7. HENRY Says:


    PillSpot.org. Canadian Health&Care.Special Internet Prices.No prescription online pharmacy.Best quality drugs. Low price pills. Buy pills online

    Buy:Advair.Cozaar.SleepWell.Aricept.Lasix.Female Cialis.Buspar.Amoxicillin.Zocor.Acomplia.Ventolin.Lipothin.Lipitor.Nymphomax.Wellbutrin SR.Seroquel.Zetia.Prozac.Benicar.Female Pink Viagra….

  8. Driving Says:

    lead http://mfurniturekqbd7.ACEHARDWAREE.INFO/tag/lead+Driving+led/ : led…

    Driving…

Leave a Comment

Visit the shop!

  • Play-Asia.com - Buy Video Games for Consoles and PC - From Japan, Korea and other Regions!