background preloader

ArduinoISP

ArduinoISP
Learning Examples | Foundations | Hacking | Links This tutorial explains how to use an Arduino board as an AVR ISP (in-system programmer). This allows you to use the board to burn the bootloader onto an AVR (e.g. the ATmega168 or ATmega328 used in Arduino). The code in this example is based on the mega-isp firmware by Randall Bohn. Instructions To use your Arduino board to burn a bootloader onto an AVR, you need to follow a few simple steps. Open the ArduinoISP firmware (in Examples) to your Arduino board. Circuit (targeting Arduino Uno, Duemilanove, or Diecimila) An Arduino board serving as an ISP to program the ATmega on another Arduino board. Circuit (targeting Arduino NG or older) On NG or older boards, connect the reset wire to pin 1 of the Atmega chip on the board, as shown above. Circuit (targeting an AVR on a breadboard) See the Arduino to Breadboard tutorial for details.

playground - Gyro This is just a basic code snippet for the time being, but please feel free to contribute more information Gyroscopes measure the rate of change of a particular axis at the current moment in time. This means that to keep track of our angle, we need to sum all of the rates of change over a given period of time. We're essentially looking for the integral of our gyro data. In the sample code below we'll be looking at just one gyro axis. First off, you'll want to set the voltage of your gyro (typically 3.3v or 5v) for the gyroVoltage variable. Next you'll need to know the zero voltage of your gyro. The other value you'll need from the datasheet is the sensitivity. The Arduino has 10 bit ADC which can represent a voltage (0-5V) in values from 0 to 1023. /* Keep track of gyro angle over time * Connect Gyro to Analog Pin 0 * * Sketch by eric barch / ericbarch.com * v. 0.1 - simple serial output * */ float currentAngle = 0; //Keep track of our current angle void setup() { Serial.begin (9600);}

Program PIC with Arduino This is just another "show and tell", but once again, there are gerber files and so on included. This Arduino shield is a PCB version of a circuit designed by Rhys Weatherley. When used in conjunction with two arduino sketches and a host program also designed by Rhys, it provides a pretty neat way of programming various 8 and 18 pin PIC micros using an Arduino as the programmer. The circuit is the same as the one on that site, except that I have added a jumper to allow you to select pin 9 or 10 as the program pin. If you are not comfortable with command line interfaces or you are not willing to play around a bit to teach yourself how to use this hardware and software, this is probably not the project for you. PCB was designed using free designSpark software by RS components and manufactured by SEEED Studio. Gerbers and other resources at the end.

ArduinoToBreadboard This tutorial explains how to migrate from an Arduino board to a standalone microcontroller on a breadboard. It's similar to this tutorial, but uses an Arduino board to program the ATmega on the breadboard. Unless you choose to use the minimal configuration described at the end of this tutorial, you'll need four components (besides the Arduino, ATmega328, and breadboard): a 16 MHz crystal, a 10k resistor, and two 18 to 22 picofarad (ceramic) capacitors. Uploading Using an Arduino Board Once your ATmega328p has the Arduino bootloader on it, you can upload programs to it using the USB-to-serial convertor (FTDI chip) on an Arduino board. Uploading sketches to an ATmega on a breadboard. Minimal Circuit (Eliminating the External Clock) If you don't have the extra 16 MHz crystal and 18-22 picofarad capacitors used in the above examples, you can configure the ATmega328 to use its internal 8 MHz RC oscillator as a clock source instead. Attention This procedure works on Arduino 1.0.x software.

Environment (redirected from Tutorial.Bootloader) The Arduino development environment contains a text editor for writing code, a message area, a text console, a toolbar with buttons for common functions, and a series of menus. It connects to the Arduino hardware to upload programs and communicate with them. Writing Sketches Software written using Arduino are called sketches. These sketches are written in the text editor. NB: Versions of the IDE prior to 1.0 saved sketches with the extension .pde. Additional commands are found within the five menus: File, Edit, Sketch, Tools, Help. Edit Copy for Forum Copies the code of your sketch to the clipboard in a form suitable for posting to the forum, complete with syntax coloring. Sketch Verify/Compile Checks your sketch for errors. Tools Auto Format This formats your code nicely: i.e. indents it so that opening and closing curly braces line up, and that the statements inside curly braces are indented more. Sketchbook Tabs, Multiple Files, and Compilation

playground - RegulatedPositiveVoltageBooster Outputs 1/4 Watt, up to +60V DC Max Accepts any input voltage (1V minimum) Uses a simple, flexible circuit Warning: If you don't follow the instructions carefully, wiring this circuit wrong can damage your Arduino. The output voltage of this circuit must not be applied to the digital IO of the Arduino. Arduino Project and Schematic Download RegVoltageBooster.zip Schematic Pictures The Arduino 5V boosted to 40V, with a hand made inductor. The same circuit, with the Arduino regulating at 9V instead. Circuit Theory Inductors resist changes in current. There are many ways to explain the relationship between PWM (analog output) and output voltage. Don't worry about the gain of the transistor. The exact inductance of L1 doesn't matter. If you're trying to get more than one watt, then use a darlington pair. Software Summary The Arduino ATMega168 regulates the output voltage. The program was written for both the ATMega8 or ATMega168. Inductors that work Each inductor behaved a bit differently. Safety

Turn Your Arduino Into an ISP There are a few instances in which it is neccesary to program microcontrollers without a bootloader. For example, if have run out of storage on a chip you can get an additional 2KB when you program without a bootloader. Another example, the one I will show you how to do, is to program chips that have no serial capabilities and therefore cannot use a bootloader. The ATtiny85 is one of these chips. To program the ATtiny85 using the Arduino ISP you must first add ATtiny85 support to the Arduino environment: * Download attiny45_85.zip * Unzip the folder * Copy the folder to the Arduino IDE's Hardware folder * Reopen the Arduino IDE, you should see the ATtiny85 in the Tools >> Board menu Now connect your Arduino ISP to the ATtiny85 like the diagram below. Open the Blink sketch, change every '13' to '0', select ATtiny85 from the Tools >> Board menu, and select the serial port that is your Arduino ISP.

PortManipulation Reference Language | Libraries | Comparison | Changes Port registers allow for lower-level and faster manipulation of the i/o pins of the microcontroller on an Arduino board. The chips used on the Arduino board (the ATmega8 and ATmega168) have three ports: B (digital pin 8 to 13) C (analog input pins) D (digital pins 0 to 7) Each port is controlled by three registers, which are also defined variables in the arduino language. DDR and PORT registers may be both written to, and read. PORTD maps to Arduino digital pins 0 to 7 DDRD - The Port D Data Direction Register - read/write PORTD - The Port D Data Register - read/write PIND - The Port D Input Pins Register - read only PORTB maps to Arduino digital pins 8 to 13 The two high bits (6 & 7) map to the crystal pins and are not usable DDRB - The Port B Data Direction Register - read/write PORTB - The Port B Data Register - read/write PINB - The Port B Input Pins Register - read only PORTC maps to Arduino analog pins 0 to 5. Examples See

Arduino Ethernet Shield Tutorial The Ethernet Shield is based upon the W51000 chip, which has an internal 16K buffer. It has a connection speed of up to 10/100Mb. This is not the fastest connection around, but is also nothing to turn your nose up at. It relies on the Arduino Ethernet library, which comes bundled with the development environment. There is also an on-board micro SD slot which enables you to store a heck-of-a-lot of data, and serve up entire websites using just your Arduino. The board also has space for the addition of a Power over Ethernet (PoE) module, which allows you to power your Arduino over an Ethernet connection. For a full technical overview, see the official Ethernet Shield page. Setting up an Arduino on a breadboard Overview This tutorial shows you how to build an Arduino compatible breadboard with an Atmel Atmega8/168/328 AVR microcontroller and FTDI FT232 breakout board from SparkFun. You could also use the Arduino USB Mini. Originally created David A. Parts To do this, you'll need: The Supplies Basic Parts for wiring up Arduino A breadboard 22 AWG wire 7805 Voltage regulator 2 LEDs2 220 Ohm resistors 1 10k Ohm resistor 2 10 uF capacitors 16 MHz clock crystal 2 22 pF capacitors small momentary normally open ("off") button, i.e. USB to Serial Communication Board You will need a FT232 USB Breakout board from SparkFun. FT232RL USB to Serial Breakout Board, SKU BOB-0071Arduino Serial USB Board, SKU DEV-08165 If you plan to use the top option and have not yet soldered headers to the breakout board, now would be a good time. Bootloading your Atmega Chips There are several options for bootloading your Atmega chips, a few of which are covered in this tutorial. Adding circuitry for a power supply Top Power lines

Arduino Button Tutorial - 3 The Button This is a momentary switch, with one stable position (open) when no force is exerted, and conducting (closed) when pressed. It is one of the simplest electro-mechanical sensing device. Connect the button like illustrated in the photo of this step. (Don't be impressed by the size of my breadboard. The I/O Pin The AVR (aka ATmega, i.e. the Atmel chip powering the Arduino board) has several I/O pins. Pin 2 will be a good choice for our example. Pull-up Resistor The pin has to be connected to somewhere via the button. A first idea would be to go to VCC. So the solution is to use a so-called pull-up or pull-down resistor. Fortunately, the AVR chip has, internally, a 20 kOhm pull-up resistor that can be connected to the pin (internally). With this pull-up, we'll connect the pin to GND through the button, and have these situations when the button is released, respectively pressed: Input is isolated from GND, so only connected to VCC via the resistor. Consumption Polarity Programming Code

Related: