seandockray's blog

Arduino Bootloader with STK500

I followed this tutorial to burn the Arduino bootloader onto an AVR ATMEGA8. The one thing that I didn't like was going through all of the AVR Studio menus, clicking checkboxes, etc. Instead, I just wanted a batch file that would do everything all at once.

So here it is:

1) Get the bootloader hex file onto your desktop or in a folder or something.
2) Create a new batch file in the same directory and open it to edit.
3) Type this:

: Set fuse bits, lock bits, voltages
D:\\STK500\\Stk500.exe -dATmega8 -ut5.2 -ua5.0 -!3686400 -lFF -L -fCADF -F
: Burn Arduino hex bootloader file
D:\\STK500\\Stk500.exe -dATmega8 -pf -e -vf -ifbootloader.hex 
: Lock it down
D:\\STK500\\Stk500.exe -dATmega8 -lCF -L

4) Change the code for your setup. First, where is your stk500.exe? It might not be on a D drive! Second, what is the hex file called? I changed the name of the file to be "bootloader.hex"
5) Attach your STK500 and plop in a new ATMEGA8, set it up like in the tutorial above...
6) And double click your batch file to run it.

Categories: |

RF Link between two Arduinos

This tutorial shows how one Arduino can send data wirelessly to another Arduino. This can be accomplished in a number of ways, but I am showing how do to it using these 315MHz RF Link modules. When I bought mine it cost $11.95, but the price has gone up to $13.95. There are probably much better choices at the $20 range - these RF Link modules can only broadcast from transmitter to receiver, as opposed to creating a network of inter-communicating microcontroller. But if you're fine with one-way communication across an open space, then the RF Link is fairly easy to use - you just pretend it's a physical serial connection. (if a "serial connection" doesn't sound easy to you, then have a look at this tutorial).

Categories: | | | |

The Prophylactic Layer

Let's talk about protection. Your microcontrollers are actually quite fragile and although you can program them, they can't actually do much. Blink an LED or two? Big deal! But if you try to hook it up to a motor or an automobile, then your precious little integrated circuit will die. So what do you do? How can you actually get your microcontroller doing anything useful?

This introduces us to what I will call the prophylactic layer: the assortment of electronic components that sits in between your microcontroller and everything else. These components aren't so obviously useful. The microcontroller is like a brain and it controls stuff. The motor is like a muscle and it moves stuff. The light bulb is like a ... ok, but it illuminates stuff. They all do things that are pretty obvious to electronics novices. The transistor, the relay, the amplifier, the triac, the optoisolator. These components are a little more mysterious, but it might help to think that they are often like a prophylactic layer.

Categories:

Learn to Read (Datasheets!)

Today I will teach you how to read datasheets, how to go from schematics to a real circuit, and how to find more information about your parts using Google.

1. Let's say that you want to make something blink regularly. I already know that I would use a 555 timer (an integrated circuit whose job it is to do just that!) or a microcontroller (and program it to blink). If I didn't know any of that, I would search google with: blink LED circuit. You might try replacing "circuit" with "schematic" or "tutorial" or something like that. It takes a little bit of effort to find something good. But that second result has a pretty easy looking picture!

Categories: | |

Servo Motor Control with Arduino

*Great writeup on using a servo with Arduino and it has pictures and schemas!

* Two Arduino code examples from ITP. The first one shows one servo motor being controlled and the second one shows two being controlled.

The problem with both of the links above (which actually all are based on the exact same code) is that it assumes you have a potentiometer attached, and the servo timing is based on that. The first step would be a new function that strictly turns a servo:

Categories: |
Syndicate content