Google Analytics

Tuesday, June 26, 2012

Banjo on - AVR Bootloader with USBtinyISP

I've been really struggling with something that just didn't make sense. Part of the reason is incomplete information on my part.  But part of that blame goes to those that are selling ISP programmers in not making this clear.

I'm going to put this here in the hopes that it helps someone, and also so I can refer back to it in the future!  However, this post is going to be subject to change as I learn more or need to correct it.


I built this Minimilast EvilMadScientist board for ISP programming, an ISP (In System Programmer).  Only it didn't work for me.  There wasn't a problem with the board; there was a problem with my understanding.

I had this device (USBtinyISP) to use to with the board above.

I never could get things to work...until I found out ONE THING...

When you buy an ATMega328P without a bootloader, by default it comes with the fuse set for using the internal crystal.  However, if you place a bootloader on this chip via an ISP such as the USBtinyISP above,   then it changes the fuse to use an external crystal....at least that's my understanding right now, and it appears to be right based on ability to now place a bootloader on a chip.


Burning a Bootloader
So, here's my understanding of how to place a bootloader onto a chip that doesn't have a bootloader.  It will use the AVRDUDE to load the data, and it will need to have an device driver installed for Windows (I don't know about Linux of Mac).  See this for details and a link, and scroll down to the Description section for info on this.

Now:

  1. Place the chip onto the device that will hold the chip, such as the Minimalist EMS board above.
  2. If it's a new chip and doesn't have a bootloader on it, then you can use the USBtinyISP to program it by connecting the USBtinyISP to the header on the board.
  3. Using the Arduino 1.0 IDE, select: Tools->Board->Arduino Duemilanove.  This is what I have to do on mine to get it to work....not sure why this matters; I could be wrong, since we aren't communicating to a board in this case.
  4. Again, on the Arduino 1.0 IDE, select: Tools->Programmer->USBtinyISP.
  5. Again, on the Arduino 1.0 IDE, select: Tools->Burn Bootloader.  If this doesn't work for you, then I can't help you yet as I don't know enough yet!  So have a look at this site and also anything else you can dig up via google.
If you've got a chip that you want to add code to it, and it has had a bootloader on it before, and for some reason it won't work anymore (e.g., gets a synch problem from the Arduino 1.0 IDE), then you may need to reload a bootloader.  However, if you need to do so, the fuse may have been set to use an external crystal.  So now, you are going to have to add an external crystal to the board, and then you will be able to push a bootloader onto it, and then use it in an Arduino board.  

NEEDS SOME MORE WORK

To transfer a file to a chip via the ISP and the USBtinyISP, you'll need to open a command prompt and use avrdude.  Note that this approach, not using the Arduino IDE, and directly using avrdude, means you are going to be transferring a HEX file.

How do you get a .hex file?  Well, it's actually produced each time by the Arduino 1.0 IDE.  You don't normally see it because it's placed into (at least on my computer!  Your's may differ!) C:\Users\\AppData\Local\Temp\.  (Note: you can probably change the Arduino 1.0 IDE preferences.txt to put it somewhere easier to get to).  (Note: AppData is a hidden directory, so you'll have to enable it in your file folders setting to even be able to find it! - one way to locate it is to do a file search for the file.)

On my sysem, doing the compile under Arduino 1.0 IDE for my Blinky2.ino produces a hex file named Blink2.cpp.hex, and places this into a new file folder (see the date/time stamp on the folder) in the AppData folder.  This is the file I'm going to transfer!

And here's how I'm going to transfer it to the chip.  If the chip has a bootloader on it, this is going to overlay it, so the bootloader won't work now on a Arduino.  So you just got 2K back from not having a bootloader.  However, if this chip had a bootloader on it at some point, then the fuse is set for external crystal, and won't run unless you either change the fuse setting (I'm not getting into that here - search google), or have a crystal on the target board.  It's also going to have to be there for the transfer to work!

Here's the command line (in a command window) that's going to do the transfer (make sure you've installed WinAVR per the link above with the driver info - if you get a 'command not found' error, then either your PATH isn't set up in your environment variables, or you haven't installed the drivers and WinAVR).  
        
         avrdude -p m328p -c usbtiny -U flash:w:Blink2.cpp.hex

Vertical Smoker Mod

Making my vertical smoker breath right!

I have several smokers, one of which is a 'Great Outdoors - Smoky Mountain Series'.

Some things I really like about this smoker, but some things were really, really wrong with it.  So this post is about fixing the things that were wrong!

1st Picture: Leaky Vertical Smoker
As you can see from the first picture, there is exactly one door latch on the smoker, located on the right side of the door at the midway point - the coil spring you see.  This latch holds the door against the frame - at this point only!

The top and bottom aren't pulled tight, so inlet air comes in at bottom half of the door, and exhaust air goes out the top half of the door.  Ican see it leaking the exhaust smoke.  Of course, I can't see the inlet air going in, but I know it's there because it's difficult to control the temperature!











2nd Picture: Left side
Inlet air damper control
(with modification)
There are two (2) inlet dampers (see second picture of left side - it has some holes that are part of the modification), one on the left side (at the bottom), and one at the right side of the smoker.  Turning this plate allows more air in, or less air in.  There is one (1) outlet (exhaust) damper located on the top of the smoker (not shown).  Turning this plate allows more air out, or less air out.
















I was consistently having problems with this smoker.  Once it started warming up, even with the inlet dampers fully closed, and the exhaust damper fully closed, the temperature would keep climbing, and of course I could see lots of exhaust smoke coming out around the door, and I knew that air had to be drawn in at the bottom to feed the fire, making the temperature rise, past where I wanted it...


So, if I was going to ever make good BBQ with this smoker, I had to figure out a way to either make the whole smoker air tight, or I was going to have to enclose the fire in such a way that the fire was air tight.  After considering different ways to accomplish this, I opted for what I thought would balance the multiple goals of easiest, cheapest, least time involvement, while ensuring success.  I decided to enclose the fire, by placing the fire inside a piece of black stovepipe.  I would use the existing inlet air to feed air into the stove pipe, and the other end of the stove pipe would be the exhaust, with the charcoal and fire being in the middle.  I decided to also use a T stove pipe piece to facilitate adding charcoal and lighting it.

Imprecise temperature control makes for bad BBQ!


Here's How I Fixed the Problem
I went to Lowes hardware store and bought a 6" T stove pipe connector, and two (2) 6" stove pipe endcaps (one male, one female).  The stove pipe T has two female 'ports' - one end and middle; the other end is male.

3rd Picture: Smoker after mod.
Black stove pipe T
at bottom, connected to left
sidewall of smoker via
end-cap.  Right side is
capped off with end-cap.
Brick under right end to
support weight of T.
This is a picture of the modification after installation.  Simple, quick, and most important....it works!

There's charcoal in the T, and it's producing some smoke, which is rising up from the middle 'port' of the T.  The right end is capped off with an end-cap, and there's a brick under the right end to support the right side of the T.























STEPS
- One end of the T is going to be closed off; in this case, it's the right end.  I slipped an end-cap onto that end.
- The middle of the T is going to be the exhaust.  I didn't do anything with this opening, except to make sure it was pointing up when everything was finished.
- The left end of the T is going to connect to the left-side inlet air damper control.  To simplify this connection, I used the other end-cap, where I first drilled holes in it to correspond to the opening on the control damper, where air could flow in when the damper is in the open position.  I secured this using the same screw that attaches the inlet air damper to the sidewall.
- Once I had the left end-cap secured to the left-side of the smoker, I slipped the T into position, and inserted it into the left side end-cap.
- I made sure the middle of the T was pointed up - this is the exhaust.
- I filled up the T with charcoal, and lit a couple of pieces on the top of the stack of charcoal that is within the T.

I use another end cap that I have sitting around to put wood sawdust into for smoking, or just place whole chunks directly into the middle of the T where the charcoal is burning.  Adding charcoal or smoking-wood is easy as opening the door and placing into the middle of the T.

Sometimes, I found that using an end-cap upside down, I can block some of the exhaust coming off of the T, and that helps cut down on the smoke coming out of the door.  It also lets me use the top damper with more precision.

Hope this helps you if you have a similar problem!

Tuesday, June 19, 2012

Banjo's Stove Pipe Smoker - BBQ Smoker


This will track my design and build of my new Stove Pipe Smoker.  It will utilize single wall black stove pipe for the combustion chamber, and a small barrel for the smoking chamber.  I'll update as I move along with this project.  Have included a conceptual design for reference.


Banjo's Stove Pipe Smoker
-Conceptual Drawing-

Banjo's Stove Pipe Smoker
-Combustion Chamber Detail-



















First, the title is 'Stove Pipe Smoker', because the stove pipe will be a major component (the combustion chamber), but I will also be using a small barrel with grates for holding the meat.  I wanted to keep the title short, so hope you feel OK with that for the title, and also it is the major difference between this smoker and any I've ever seen.

Design goal:
This will primarily be used as a smoker for ribs, and only a couple of racks - maybe 4 max.  I want to be able to burn charcoal in it (lately have been impressed with Kingsford Competition Grad), for about 3 hours or so, without having to add any charcoal.  I hope to have a premeasured amount of charcoal that will be good for 3 hours at 225 dF before it starts to taper off.  I want it to be air tight in the combustion chamber, so I can easily control the temperature.  For an average day (wind wise), I want to be able to set-and-forget the temperature controls (inlet and outlet dampers) for the whole burn.  I want it to be inexpensive and easy to build for anyone that wants to build one.

Design  
I will be using:

1 - a small barrel, standing upright on three (3) legs, for the smoke chamber.  I'm not sure of the dimensions of this barrel (yet), but I have a couple downstairs.  They are much smaller than a 55 gal drum, about 3 feet tall, about 2 feet diameter.  Will publish dimensions later.
2 - a 6" or 8" length of black single-wall stove pipe, connected on the bottom of the upright barrel, which will be the combustion chamber.  This will also be oriented vertical.
3 - bottom of the combustion stove pipe will have a stove pipe end-cap.  Removable for ash dumping.
4 - small valve (something like used on the UDS I've seen) inlet air control on bottom, possible offset to decrease ash disturbance.
5 - wire supports to support charcoal about 4 inches off of the bottom to allow for ash collection.  Will fine-tune placement after testing.
6 - handle on combustion stove pipe to aid in removal from smoke chamber.
7 - combustion stove pipe connects to bottom of smoke chamber via stove pipe end-cap, held with screws, into bottom of smoke chamber.  2" hole in this end-cap to allow smoke to move from combustion chamber to smoke chamber.
8 - 2" hole in bottom of smoke chamber to allow for entry of smoke from combustion chamber.  Lines up with hole in combustion chamber.
9 - exact size of hole that mates combustion chamber to smoke chamber to be determined via testing.
10 - diffuser plate in in bottom of smoke chamber, over inlet smoke hole, to create turbulence in smoke so it doesn't flow straight up.  This also blocks any direct infrared from combustion chamber.  Can also sit a drippings pan here, or up one level on grate.
11 - exhaust with damper located on top of smoke chamber
12 - no doors on smoke chamber nor on combustion chamber
13 - removable lid on smoke chamber.
14 - combustion chamber removable from smoke chamber, held in place through wire-dogs.
15 - ground clearance of at about 6" below bottom of combustion chamber, more if testing dictates.
16 - 3 legs, connected to sidewall of smoke chamber, tall enough to provide clearance under combustion chamber to ground.
17 - handles for ease of moving.
18 - meat racks from weber-style round grills, 2 or 3.  One may  be used for drip pan on bottom.  Supported by L-brackets (3 per rack) placed into sidewall of smoke chamber.  All will lift out via removing top of smoke chamber.


I've got the barrel, and some of the black single wall stove pipe.  Hope to pick up any additional parts needed today from Lowes or HD.

My plan is to provide pictures and a build-log as I go, with updates on any day I've worked on it.

Banjo

Some concept pictures:
Major parts - 6" stove pipe (left - combustion chamber)
small barrel (middle - smoke chamber 27" x 14.5")
lid(right).  Will be using a slightly larger barrel (28" x 19"),
but this was what I had at hand for the test build.


Concept, but without the legs (3 attaching to
barrel sidewall).  Looks a little unwieldly. May
switch to 8" stove pipe, which will allow me to
shorten height by 1/2.

Monday, June 18, 2012

Market change confirmed!

An interesting observation.


On June 8th, I posted a blog that I thought we might be at a market turning point.  This past Friday, June 15th, Investor's Business Daily (Investors.com) announced we had in fact turned.


When I'm daytrading (as opposed to my longer term investments), sometimes I'm long (buying first, then selling later, with the expectation that the market is going up), and sometimes I'm short (selling first, then buying later, with the expectation that the market is going down). At any given point on any given day, I will be long or short. I will typically be long and short at some point during the same day.

My day-trading futures strategy makes money, until it doesn't. 

Recently, after consistently generating profits, it started consistently generated losses. 

Which begs the question: how can something be consistently making money, then consistently losing money, with no change to the strategy, unless something is different about the market? I became convinced that there was something different about how the market was trading that was causing my to move from success to failure.

I pulled my daytrading logs, and did a little research from trades over the past year. 

I found that I go through this same change when the market is making a change from one direction to another. If I was successful while it was going up, then when it hovered prior to switching to going down, during this transition I experienced failures. Likewise, if I was successful while it was going down, then when it hovered prior to switching to going up, during that transition I experienced failures.

This was a very big surprise to me - not only that a strategy could suddenly switch like this, but it was also capable of prediction. In other words, the fact that my trading strategy moved from success to failure meant that the market was going to change direction. Once it moved from failure to success, then the new direction had been shown.

From my logs, I had been successful at trading until the end of July 2011, when the market bottomed, then I wasn't again until October, when the market moved out of a sideways correction to an uptrend. I started experiencing failures again at the end of November, when the market turned, and started being successful again at the end of December, when the market turned. I started experiencing failures again in April, then success again in May, followed by problems at the first of June, followed by successes again last week. 

On June 8th, 10 days ago, I noted on my blog that, based on the shift of my trading strategy from success to failure, the market was at a turning point, changing from 'downtrend' to 'uptrend'. The market had been in a downtrend since the first part of April, 2012.

This past Friday, as noted by Investor's Business Daily (Investors.com), the market has changed from 'Market in Correction' to 'Market in Confirmed Uptrend'.

So, in other words, my trading strategy's shift from loss to profit, led me to predict on June 8th, that the market had changed direction from downtrend to uptrend, and on Friday, June 15th, the Investor's Business Daily announced this change in market direction.

So - here's what I've learned:
1 - my strategy is successful when the market is moving in a direction, up or down.
2 - my strategy fails when the market is in a transition, moving sideways.
3 - my strategy predicts the turn from a direction to moving sideways.
4 - my strategy predicts the turn from moving sideways to a direction.
5 - I need to employ a different strategy while the market is moving sideways, and abandon my original trading strategy, when the market is in a transition. 

This has been pretty fascinating to me!

Thursday, June 14, 2012

Banjo cooking BBQ Ribs

Well, I'm stunned. I've been cooking BBQ for 26 years, but never cooking what I consider to be competition grade ribs....until tonight! 

Yes!

As I mentioned about a month ago, I was starting a series of test on cooking BBQ ribs, until I got it right. I bought a rib package from Costco, which contained three (3) racks of St. Luis style pork spareribs. I split these in two, and cooked that half rack for a test. Pat and I then split that 1/2 rack, so we ended up with a 1/4 rack each - or 3 ribs each, which is about 4 oz of meat. So 1 package from Costco was good for 6 tests, with six small portions for two people over the past month.

Tonight was Test #10! And it was a success! I have never had ribs this good, any where, any time. No sauce, nothing to hide the flavor or mask the mistakes. No rubs, no seasonings, just naked ribs.

They aren't perfect. The smoker I'm using has some air leaks, so I am having some difficulty controlling the temperature. It's looking like I may have to weld-up my own rib smoker in order to have complete control over the temperature - I've been working on some plans.

But they're still the best ribs I've ever had, any where, any time...and when I have full control over the smoker, I looking for the champs!

Friday, June 8, 2012

A Market Turn?

A couple of weeks back I posted an entry in this blog that I was declaring success in my daytrading of the E-mini S&P 500 futures.

And then suddenly, the style that was giving so much success, quit being successful.

So I pulled my trading logs, and reviewed the last year, and noted something that I feel is important for me: I start losing at market turns.  In other words, during an uptrend, and during a downtrend, I consistently make money.  But at the point where the market is turning, I consistently lose money.

One way to look at this, is I have a tool that says the market is turning!


And, assuming this insight is correct, then it is saying we are having a market turn right now, starting with Monday June 4 2012. That day was the last day, that I made money all day long, on every trade.  Every day since then, Tue - Fri, I lost.  And it was the first loosing week in a month.


It doesn't say for how long it will be heading up, just that it is turning!

UPDATE: Investors.com (Investor's Business Daily), on Friday June 15th, said the market changed to an uptrend.  Here's my new post on this.