Friday, November 18, 2011

AVR Studio

So I decided to try something new, and downloaded the latest and greatest AVR Studio 5. Downloaded installed and created a new AVR C executable project, it asked for device, I told it and it made happy :).

As with anything it's hard to know where to start, so I just started playing around and found IO view.  First thing you'll want to do is Debug~>Options and Settings~>Text editor~>All Languages and check-mark line numbers. Yea I'm a noob and need line numbers. So I dropped in a simple blinky light, BUT I dropped one in from another chip. It was polite and let me know that certain ports were not defined, helped me correct it, compiled it to a hex file, ready for AVRDude to put it on the chip.
So I've downloaded and installed AVRStudio5 put in an incorrect program, built it, put it on a chip and had it work. It has a lot of tools that I don't yet fully understand, but I think I'll figure them out. But that... is another post.

USB to AVR interface.

Yes, I'm talking about sending data from an AVR chip to a USB port. I've been wanting to do this for awhile, to be able to log data over a time period, and creating custom interfaces for random... ok fine I don't have any damn good reason other than I just want to know how it works. I've been taking stuff apart for years to find out, now I'm putting things together to find out how it works. Regardless. Hackaday ran this I figured it's a good start, but I don't just want to keep repeating stuff everyone else does. BUT I figure I need a breakout board. Some sort of interface between the two.
Vcc pin goes to Vcc on the chip, and GND to the GND pins
Seems pretty simple, and it is. The Diodes are used as a cheap voltage regulator. That way the chip outputs 5v and the diode regulates it down to 3.6v to go into your USB port on your computer. (not something you want to burn out) The 100uF is probably just decoupling he put a 100nF on the chip between Vcc and ground, probably for the same reason. R1 and R2 feed the data pins on the chip.  Simple yes? In my infinite wisdom I for some reason chose the smallest protoboard I had XD So things got tight, not the most elegant solution, but it should work. I outputted everything to wires so I could breadbord it how I wanted with little problem. Now I just have make the chip work!





Tuesday, November 8, 2011

Tardis Light



So the wife and I throw a party every fall around Halloween, and we theme it. This year's theme was Time Travel, and I had intended to go as the time traveler from H.G.Well's book 'The Time Machine'. Well best laid plans of mice and men and all that, I was convinced to appear as Dr Who. Intrigued by the brilliantly geeky suggestion by someone who didn't even show up, I accepted the challenge. I don't have a Police Box. Neither do I have the time (given the amount of housework, homework, and... well, work I have at the moment) to build one. But the Doctor without a TARDIS is like being a vampire without teeth. Just ties the whole thing together. My origonial intent was to program a 'breather' on an ATTINY13, add power and enjoy the pulsing light of a TARDIS light atop my shed. I had a problem getting the program to do what I wanted it to, and then... for some reason (after I had several glasses of wine) I couldn't program the chip. (PROTIP: AVRDUDE cannot program a 555 timer). From nowhere I got a brilliant idea! I had found a spare 555 timer I had mislaid some time ago, I could use it! Next day at radioshack, I picked up one of these bad boys and figured I could use one of these too. I put the 555 in AStable mode the circuit looks something like this.




R1 is 1k, R2 (as you can see form the pics) is actually 2 10k in series. C is 100μF. So everything can be found at Radioshack. (and was). So your asking where the LED is... pin 3 outputs the signal, a 330 ohm resistor feeds the LED and the 4700μF inline cap that are connected in parallel. Caps don't like sudden changes in voltage, so when pin3 goes high, the cap robs some of the sudden voltage, and the effect is a slow turn on of the LED. the process is reversed when Pin3 is suddenly turned low. The Cap feels bad about having all the voltage, and lets it loose. The effect is a slow turnoff. It also makes people nervous to see a giant capacitor. Addmittedly its completly unneccessairy to have a 35V cap for a 5v chip... but that's whats at the shack. Actually there is only 4.5V, I used 3AAA batteries, it ran all evening with no probs. I was quite happy. Here's the effect while it was still on the Breadboard. By this point I had several stiff drinks, so instead of using the protoboard to solder on I deadbugged it... it's a miracle it works but it does.







Wednesday, November 2, 2011

AVR Dude

I've not been around for a bit, so I thought I would drop in some posts as to what I've been up to. As for the HAL project, HAL isn't up and running, I blew the 3.3v regulator on the Bus Pirate at some point when I was updating it to version 4.1. Undaunted I tried something else. I decided I needed to slip into a shallower end of the pool, and ordered 10 attiny13s. Yes ten. I found some good 'make the light flash' hex file and set about to dropping it into the chip. I also ordered (from my friends at Sparkfun) the pocket AVR programmer. I plugged the programmer into the computer, plugged the chip into the programmer and SHZAM! it worked!   Yea right.

The System is based around a series of programs called AVR Dude. And simply installing AVR Dude isn't enough. What I did was I installed the newest version of WinAVR (comes with AVR Dude, as well as programmer's notepad) now this is all command line stuff at this point, and requires the ability to use a makefile. I'm no Guru and there are most definitely more elegant ways to get the job done, but here's the pudding.

 
I make the light blink!

So that's the uC version of hello world. remember your 330k resistor. The chip is one of the attiny13s and FYI I had to define my usb port weird, 'avrdude -c usbtiny -p attiny13 -P #port_#0001.Hub_#005 -U flash:w:test1.hex' I would do a post as to how exactly I got it to work, but honestly I'm not bloody sure.

Saturday, April 23, 2011

Mini Fume Extractor

 I don't have a lot of money, especially since I have an hour to commute and gas is at a bazillion dollars a gallon. I started building my own equipment. I've a bird and i don't want it dead... wife would come unglued at me if it was my fault. So I started looking at options for the fumes created by the soldering iron. I came across this and decided to build one. I've an old tin I had used for my bus pirate, and an old hard-drive enclosure that had a small 12v fan.
 I picked up the voltage regulator, and some 9v connectors, started putting this thing together. The 9v batteries are wired in parallel to give 18v. The regulator can take 37v, I was tempted not to regulate it. and just let it eat 18v but I figured it's better to stick with directions this time.  The best way to keep things from shorting is a bit of shrink tubing.. I'm not supposed to solder in the dining room anymore... so I used the kitchen.
 The extra wire goes to the fan. I wired the switch into the ground side floating it. really the hardest part was the switch. I used one that I had lying around, it was pretty small. My el-cheapo iron is all clunky it's like tapping in a finishing nail with a cinder-block.
 Here it is all wired together 18v on the high side of the regulator, fan on the low side, switch floating the ground. I managed to source a filter by using a sponge type fish filter. It was stopping the fan though. What I did was took some wire and folded it over, going from the middle of each side to compress it down. I forgot a picture of it, but it's figureoutable.
so here is a sideways picture of the finished product. I dremmeled a design on one side, (not in the dining room this time, I went into the kitchen to do it) the other side is just straight-ish lines. You can see the switch on the side (top) I secured it in to place with hot glue. Painted it red... cuz I had red paint. So that is the Altoids mini fume extractor. I call it a success!

Sunday, April 17, 2011

a quest for a home for TBP

I had it housed in an Altoids can (thought it fitting) but I was at the store and saw Altoids smalls... The can looked like it was the right size, so I bought one and brought it home. I'm pretty generous with them so it doesn't take me long to go through them. Before I knew it I had it cleaned out and was trying to fit the bus pirate in... and it didn't fit. 
 So not wanting to start over, and being SO close.. I picked up my trusty dremmel and started shaving off the corners, being careful not to shave off anything important... A few minutes and an annoyed wife later it fit snugly in the tin. (protip: the wife doesn't like you grinding pcb board in the dining room)
 After finishing with the board, I marked where the holes for the I/O cable and the USB cable were. I don't have some fancy calipers or anything... I have a jusabout. That hole goes jusabout here... this hole goes jusabout there... another dremmeling and I have two new holes... the holes aren't perfect but neither am I. Just ask my wife... (another ProTip: if your not allowed to grind PCB in the dining room, you probably aren't supposed to cut metal either, so make sure the wife isn't home.)
So to keep it from shorting out I added some electrical tape. I'd like to put in some tiny holes and use some hotglue and perhaps even some fiberoptic wire I have somewhere to make light pipes for the status lights, but this works so far. It's much more compact, fits in the box I keep it in better. Now to find things to use it on... MUAHAHAHHAHHAAA!

Monday, March 21, 2011

A note on the Alchemical creation of wine.

Although It's probably not good for me, I decided that it would be effective if I made wine. So I began (rather blindly I might add) an odd rotation of wine. What I've done is purchased a gallon of wine, and emptied it (the fun part) then I filled it back up with a mixture of yeast and sugar and flavor... and gave it time. The Yeast converts the sugar to alcohol the flavor makes it tolerable, and time.... is of the essence. How is this done? I'll explain.
Cleanliness is next to godliness. Wine is doubly so. I boil the bottle. usually for 20-30 min. that seems excessive but in actuality it's not going to hurt anything and it gives me a chance to do something else for a while. that's a big pot... and a lot of water... it takes a while for it to come up to temperature. So put the kettle on and have a nice cup of tea while you wait for it to boil. We've some other things to take care of too.
Not so simple syrup. Incorrectly made can introduce an unpleasant taste to your wine, as well as your cocktails. I bring to a boil, and put in a half cup of sugar, then stir till it's all dissolved. For my wine I put in four cups this way. Any more and the sugar starts to act as a preservative. That is bad. There is a process to make a high alcohol content wine. when I get it to work I'll post it. for now stick with four cups of sugar.
again... I can not stress enough to be sterile. Bleach water is your friend. If you buy an airlock (the airlock and bung are like two bucks) don't boil it. It will melt it... trust me. I let it soak for a bit in this and rinse VERY thoroughly. The rubber bung is a #6 and fits Carlo Rossi bottles perfectly. The little cup thing fits over the tube inside the big cup thing, a little water is placed in the big cup, the cap is placed on it and it's fitted into the bung hole. You don't need TeePee for your bunghole. The airlock lets CO2 out but not the outside air in. My first few bottles were done with a balloon and a hair tie (or rubber band. something to secure it)
so, you've put the (boiling) syup into the container (I use a funnel to do this) and a can of frozen juice concentrate. filled it up with water. At this point... go do something else. Really. let it sit and normalize the temperature for a few hours. If you add the yeast now it will hinder it because all of it's food is Uber hot. You don't like that, but it kills yeast. Also don't turn your bottle sideways. I use localized gravitational fields.
you can use baking yeast. The active dry yeast in the store will work. If you have a brew shop or winemaking supply this LALVIN was recommended to me, so far so good. keep your future wine in a cool dark place. I'd say 8 weeks, but really its to taste. 8 weeks makes a very dry wine.  I've heard as little as 15weeks. I'll edit this post when my first batch is finished :) give you an on-the-spot rating.