I spent some time looking for a way to test the virtual USB ("V-USB") possibility and functionality of this board. I stumbled across the EasyLogger project that looked like a great example to show if V-USB would work. In looking through the source code, it was clear that my board used different USB pins to the ATtiny85 than the stock EasyLogger program did, so I was certain that I wouldn't be able to use the included .hex file as it was. I managed to find the directions to equip my linux box with AVG-GCC and associated libraries. I changed the EasyLogger source code header file to point to the right two pins I had set aside for USB D+ and D- on this board and compiled a new .hex file. I was so stoked that it actually compiled, then, even loaded to the chip with AVRDUDE. Subsequently, I was printing numbers to a notepad in Windows and had the ATtiny recognized as a HID keyboard device. Yay!
I used the same AVRDUDE version and config file that comes with Arduino 1.01 to upload my own hex file. I found the commands for this by enabling the verbose output in the Arduino preferences. It shows exactly the command line required when you upload a sketch using an external programmer. Just pointing it to a different .hex file works well.
Helpful Links:
EasyLogger:
http://www.obdev.at/products/vusb/easylogger.html
Requirements to compile for AVR under Linux:
http://tldp.org/HOWTO/Avr-Microcontrollers-in-Linux-Howto/x207.html
Setting up the fuse bits on the ATtiny85 properly for V-USB:
http://codeandlife.com/2012/02/22/v-usb-with-attiny45-attiny85-without-a-crystal/
Candle+
Saturday, September 22, 2012
Sunday, September 16, 2012
Arduino Sketch
This sketch seems to yield some good results. The flicker is kinda fast, but it sort of resembles a candle. I've had it "burning" here on my desk for about 4 hours on a 400mAh Lithium Polymer battery. I'm going to let it keep going until it just quits. I like it. Project success. I do plan to revise the hardware and make some changes, but an excellent first run.
Saturday, September 15, 2012
Hardware assembly and initial programming
The parts arrived about a week ago, but I've been busy working on another project. Needing a break from the other project, I spent time today getting the Candle+ soldered together and tested. I was pleased that it all came together rather easily and it all works. I spent a fair amount of time after the hardware assembly learning how to attach an Atmel MKII in-circuit system programmer to my computer and use it to flash code to the ATtiny85 chip. Since the programmer has a 2x6 header and my Candle+ board has a 1x6 header for programming, I needed to make a little adapter. I just soldered 26 gauge solid core wires between two properly sized header pin sets and it came out surprisingly sturdy and it works well. One thing that wasn't readily obvious is that the adapter makes for the same pin-out if you plug it in either way. Neat.
After working with this hardware and programming, I discovered that I cannot leave the LEDs attached while programming. Two of the LEDs I'm using share the MISO and MOSI programming lines. They must be disconnected if the programmer is to actually flash code to the ATtiny85. So, I think I'm going to configure some sort of switches (perhaps DIP switch block) into the next revision. For now, I just attached some tiny 30 gauge wires to each of the solder pads so that I can short them together when needed and separate them when programming. It isn't ideal, but works for now.
Links to helpful information:
Programming an ATtiny w/ Arduino 1.01
http://hlt.media.mit.edu/?p=1695
AVRISP mkII libusb drivers for Windows 7 / Vista x64
http://mightyohm.com/blog/2010/09/avrisp-mkii-libusb-drivers-for-windows-7-vista-x64/
How to configure the Atmel AVRISP MKii to work with Arduino IDE
http://arduino.cc/forum/index.php?topic=118089.0
Pictures:
Major features to notice: Yellow, Red & Blue large SMD domed LEDs in the center of the board. Battery connector on the left, micro-USB on the right. Power select switch at bottom for selecting between battery, USB or just off. Momentary push switch at about the 1:00 position.
After working with this hardware and programming, I discovered that I cannot leave the LEDs attached while programming. Two of the LEDs I'm using share the MISO and MOSI programming lines. They must be disconnected if the programmer is to actually flash code to the ATtiny85. So, I think I'm going to configure some sort of switches (perhaps DIP switch block) into the next revision. For now, I just attached some tiny 30 gauge wires to each of the solder pads so that I can short them together when needed and separate them when programming. It isn't ideal, but works for now.
Links to helpful information:
Programming an ATtiny w/ Arduino 1.01
http://hlt.media.mit.edu/?p=1695
AVRISP mkII libusb drivers for Windows 7 / Vista x64
http://mightyohm.com/blog/2010/09/avrisp-mkii-libusb-drivers-for-windows-7-vista-x64/
How to configure the Atmel AVRISP MKii to work with Arduino IDE
http://arduino.cc/forum/index.php?topic=118089.0
Pictures:
Major features to notice: Yellow, Red & Blue large SMD domed LEDs in the center of the board. Battery connector on the left, micro-USB on the right. Power select switch at bottom for selecting between battery, USB or just off. Momentary push switch at about the 1:00 position.
Sunday, August 26, 2012
Candle+ is born and the feature creep is running wild
This project started as simple projects do, but then kept growing with inevitable feature creep. The good news is that Candle+ meets all of the original needs with only minimal costs to really expand its usefulness tremendously.
I started with the need to make an electronic candle that is programmable so I can make it flicker and look like a regular flame from a candle. This will support a project my wife and I have been working on, which is a hanging glass lantern. We wanted to place two candles, one in the middle and another further down to make nice looking colored glass hanging ornament for your back porch in the evening. As we started working through the how-to mechanics, I was concerned that the lower candle was going to heat the upper candle just too much. So, why not do a faux candle out of some really bright LEDs and a tiny microprocessor? The concept was born.
So, in the span of about two evenings, I discovered that the ATtiny45/85 series of processors can be used with Arduino if you have an external programmer and it supports PWM, so I was on my way. After the first PCB design was complete, I noticed that I'd have to expose several pins for the ICSP programmer. Then the feature creep hit me like a wet fish: "hey, if I just expose a few more pins on here, I'll end up with a ATtiny break-out board". Then: "hey, since I have a micro-USB port here for recharging the battery, why not just add a couple of pull-up resistors to enable the virtual USB capability"? "Oh, and hey, it would be nice if this could be used on a breadboard? So, I'll need to line the pins up in a 0.1 pattern". "Doh, what if I don't want those LEDs or pull-ups on my circuit? Better put some solder jumpers in there to disconnect them if needed". And lastly, "hey, what if I want to have multiple blink patterns stored in flash? How 'bout a little momentary switch to change the flicker patterns or colors?" Thus, this is how the "plus" part of the candle project got there.
While it started as a utilitarian effort to provide a virtual candle for a lantern, it quickly grew into a prototyping platform for an ATtiny85 while still maintaining the original rechargeable candle idea I started with.
Specs:
The board is round (about 1.3 inches in diameter) with a flat spot on one side. The thought is that the whole board will sit on top of a lithium polymer battery down inside a frosted shot glass and the power cord can slip under the board where the flat spot is. I'll probably just use a piece of double sided sticky foam tape to attach the battery to the bottom of the board. That should keep from shorting out the vias with the foil shell of the battery and keep everything together in a nice neat package. Below is a picture of the design from Eagle. I'm currently waiting for the board to be fabricated and shipped to me from my favorite prototyping PCB shop OSHpark.
Subscribe to:
Comments (Atom)




