background preloader

In System Programming (ISP/ICSP)

Facebook Twitter

Uploading a sketch from the command-line [rpi] [raspberrypi] [arduino] [arduinomk] [upload] | jamesrobertson.eu. My guide to burning the arduino bootloader to the ATMega168 or ATMega328P. Quick links < Home > < Bio > < Publication List> < Resources > < Links > There are a lot of guides in forums, micro-controller enthusiast sites, etc on the internet which tell you how to burn the arduino bootloader to an off the shelf ATMega168.

However, I still had enough trouble trying to get it to work myself, that I thought it would be worth publishing my successful method here. The point of DIY bootloader flashing is that the naked ATMega chips are much cheaper than an arduino board. Ideally, you could buy an arduino board once and then use it as a programmer for cheaply procured ATMega micro-controllers.

However, to do this, you first need to be able to burn the arduino bootloader. Preparation The only thing you need to do in principle is make yourself a parallel programmer . Commands and tricks I had real difficulties flashing the bootloader using the arduino GUI. Here are the steps I followed to flash the programmer to an ATMega168 using Ubuntu 9.1 : Program standalone ATtiny / ATmega chips through an Arduino. Ok, I did it, I made the ATtiny13A blink a LED. You see, I got this small ATtiny13A for $0.99 on ebay and the SIP8 to DIP8 board for another $0.90, soldered them together using the drag soldering technique. Go check it on youtube if you wanna try yourself. After this I only had to write a small blink program and load it onto the chip to reach my first milestone. This article will try to explain how I did the programming part. After reading it you will hopefully be able to do the same, and an awful lot more!

1.1 Atmel AVR Atmel have made a series of small micro controllers they call AVR. I will focus on only a few models from this AVR series, ATtiny13A, ATmega8 and ATmega328p. Depending on the model there are one or more ways to load software on the chip. The ATmegas can also program themselves if they have been preloaded with an bootloader. optiboot is a good free one of those. 1.2 What we will be doing BTW. 1.2.1 What you will learn To follow the guide here you will need a few resources.

Memos From the Cube » The new LUFA bootloader. So I’ve been feeling a little down lately, saddened by my lack of enthusiasm for developing new projects. Stuck in a rut, that sort of thing. A few weeks ago I thought I’d try something simple, new and fun to rekindle my love of developing — and who doesn’t love a good joke? A long, long time ago I was thinking about Bootloaders for LUFA. Right now there’s three in the current LUFA distribution: A DFU class bootloader, compatible with Atmel’s FLIP software, or the open source dfu-programmer code.

Fits into 4KB, robust, EEPROM programming support and popular. But a while back, I had plans for a forth. Unfortunately, revisiting this the other week I was left disappointed; it seems Windows 7 simply doesn’t do proper MIDI mapping to hardware MIDI devices any more, and I’m not the first one to be disappointed by it. However, as OK Go say, All is Not Lost. That’s not to say the journey was easy; first I had to re-visit the specifications for the USB Printer class. But, what to do now? Microcontroller enumerates as USB printer — can be programmed by printing. USnooBie. Easy Open Source AVR USB Device Development Kit The USnooBie is a microcontroller kit that does not require any sort of AVR programmer or USB-to-serial converters to load and run compiled code. It's hardware design allows the user to develop low cost USB devices with Atmel's AVR ATmega microcontrollers.

It can also be used to develop projects which are not USB devices. It is even compatible with Arduino . Features: No AVR programmer is needed and no USB-to-serial converter is needed to bootload. What is it? It's a board featuring an ATmega328P microcontroller and bits of hardware which makes the microcontroller become a USB device. USnooBie makes heavy use of Objective Development's V-USB . If you are not such an advanced user, it is also compatible with Arduino . What can you do with it? This thing is perfect for interactivity between you and a computer! Or maybe you want something custom, then simply use LibUSB and code your own computer device driver. TOPWIN Universal Programmer | alselectro. TOPWIN Universal Programmer is a cool Chinese product that helps you program a wide variety of Eproms,Microcontrollers,EEproms and GAL ICs. I have tested Eproms 27c512, 27c4001 , Microcontrollers AT89s52,Philips 89V51RD2, AT89C2051,ATTiny2313,ATMega16L,EEprom 24c16, 93C46,PIC16F877A, PIC16F676 all devices are unbelievably working fine.All available flash ROMs of Microcontrollers were read, erased and written again with very little effort.

It has also a built in IC tester (TTL logic tester). Just plug standard logic chip (74xx, 40xx, 45xx), select chip type and press test. The working condition of the chip is reported. Also there is an interesting feature called logic searcher. Like any other software ,on the top appears the MENU bar with dropdown functions. Below the menu bar you can see a strip of image icons forming the TOOL bar. The icons from left to right enables following functions If you hover the mouse over any icon , the respective function is displayed as tooltip. Step1: Step2: 將Arduino Uno當做一台ISP線上燒錄器,燒錄bootloader或sketch到麵包板上的ATmega328P-PU晶片. 我買了一顆ATmega328P-PU晶片,裡頭空空的,沒有Arduino的bootloader也沒有任何sketch。

但我有一塊Arduino Uno R3板子,它可化身成一台ISP燒錄器;把ATmega328P-PU放上麵包板,再接上一些電子元件與線材後,便可從主機電腦透過Arduino Uno R3板、將bootloader或sketch燒錄到麵包板的ATmega328P-PU晶片裡。 我的板子是Arduino Uno R3,Arduino軟體開發環境是1.0.3 Windows版,燒錄對象是ATmega328P-PU。 本篇介紹的內容,應該也可套用到其他Arduino板子與其他型號的AVR晶片,但我也沒試過,所以此篇內容皆以我的環境為準。 (我另一篇是燒錄到ATtiny85-20PU。) 若不清楚ISP是什麼意思,若想知道ATmega328P-PU的P與PU之意,請參考我寫的:Arduino與AVR微控制器相關詞彙。 底下是我的板子Arduino Uno R3,其微控制器晶片是ATmega328P-PU,屬於PDIP封裝。 (另有SMD版本。) 首先,要讓Uno板變成一台ISP燒錄器。 底下是單獨的ATmega328P-PU晶片。 接下來,我們想要將bootloader燒錄到麵包板的ATmega328P-PU晶片裡,需要一些硬體線路,所需電子元件如下: 16 MHz crystal石英晶體10K ohm電阻18~22 pF陶瓷電容,2個 也可以燒錄一般的sketch,之後將會燒錄Blink範例(閃爍LED),所以還需要底下的元件:LED220 ohm電阻 底下是ATmega328晶片的腳位功能對照(328與168是一樣的),對照這張圖進行接線。

Arduino板的5V與GND接到麵包板。 然後是16 MHz石英晶體(不分極性),兩隻腳分別接一個18~22 pF陶瓷電容後,接地。 ATmega328P-PU的腳位9(XTAL1)、10(XTAL2)接到石英晶體的兩隻腳。 然後根據ArduinoISP這支sketch定義的ISP腳位接線, ATmega328P-PU的腳位1(RESET)接5V。 Arduino Uno板腳位10,接ATmega328P-PU的腳位1(RESET)。 如此便完成硬體線路了,接下來要燒錄bootloader。 設定Tools - Board選為Uno。 參考資料: Arduino and the Raspberry Pi. I got a PI! So I got a raspberry pi. It took almost 10 weeks to arrive, but it was definitely worth the wait. For those who don’t know, the Raspberry Pi is a cheap $35 computer that includes processor, memory, and a sd card slot for the hard drive.

It also has a few hardware pins that can be used to drive external devices. Now to interface with a micro-controller… The most obvious external “thing” I wanted to hook up was the arduino. You plug the arduino into your usb port, upload some code, and suddenly you’re controlling a motor. Finally, you’ll want to interface the arduino with a computer, because it’s no fun having a microcontroller that can’t interface with the internet.

Commmand-line arduino? The raspberry pi only has 256mb of memory so you’ll probably want to upload your sketches via command-line instead of using their fancy UI. We’re going to use the serial header exposed by the GPIO pins to communicate with our arduino, so we’ll have to remove it’s use on the raspberry pi. Uploading Sketches to the Arduino on the Pi. This is a follow up article to Arduino and the Raspberry Pi Now that your RPi has all the needed software You should now wire up your arduino similar to how it’s done here. You can skip the part about using the 5V linear regulator because we’re going to use the ground and the 5V line directly from the GPIO pins available on the raspberry pi.

Use the GPIO pin out documentation here for guiding yourself where the pins are. It helps to use a multimeter to ensure you have the proper 5V line hooked up. Alternatively, you can buy a prototyping shield from adafruit where the pins are already broken out for you. Finally, you’ll need something like a logic level converter before you wire up any pins to the arduino because most of the pins on the raspberry pi operate at a 3.3v level and your arduino uses 5v. Here’s what my board looks like wired up. Preparing your environment root@raspberrypi:~# dpkg -L arduino-mk /. The file we’re looking for is called Arduino.mk. Uploading code. Raspberry Pi And Arduino Clone » Rep Yo Blog. Following my last post: I decided to see if I could get the RPI programming using AVRdude with support from the Arduino Library, and the X Arduino programming gui.

After figuring out my fuses were set incorrectly, I finally got it working right, and I must say… I’m surprised I ever had SPI working at all.. I was essentially running the AVR at 1Mhz. I’m going to go back to playing with the SPI shortly, but first… The Arduino interface programming an AVR 3.3V@8mhz 328P. Using the wiring diagram and the modified avrdude noted for SPI programming you can use the Arduino gui with one minor change. You’ll need to add the following lines to /usr/share/arduino/hardware/arduino/programmers.txt gpioisp.name=GPIO as ISP gpioisp.protocol=gpio After adding those you’ll see the following appear on the Arduino GUI.

Make sure it’s the 3.3V 328P… I have not fleshed out the bootloader details yet in boards.txt. Also.. Palm Arduino Kit. UPDATE: Read about the first journey of Palm Arduino Kit, here! I do travel many times a year, sometime I went with family, took relatives, friends, to places in US, for days, may be for weeks, even for a month, when I traveling aboard to visit my family once a year. Previously, I left my Arduino project(s) untouched for the duration of the traveling. And most of the time, after i got back, I had to start the project over, because I was already forgot where it was left off. During the time of traveling when I got some idea for prototyping, I could not do anything since I did not have Arduino stuffs at hand. And I missed working on the project(s) very much while I was traveling. This time I planned to do something about it! The kit contains: A DIY palm size Arduino compatible board A mini breadboard (Commercially available) A DIY 5V Portable Voltage Regulator (Step 6) A MOD FTDI cable (See my FTDI adapter instructables details here.)

Palm Arduino. Electronics : Microprocessors : How to make an Arduino-compatible minimal board. Make your own board Once you have been playing with Arduinos for a while you probably are thinking that you want to deploy one, but without the expense, and physical size, of using a whole new Uno board. This post describes how to do that. AtMega328P chip We will start off with a "raw" Atmega328P-PU chip, the sort of thing you might buy off the shelf from Digi-Key, Element14, or other suppliers: Note that pin 1 is at the end where there is a notch in the plastic and an extra hole on the top. The chip itself can be purchased for around $US 3. Anti-static precautions To avoid "zapping" your chip avoid handling it by the legs.

Minimal wiring The chip pinouts are: The very basics are to wire +5V to VCC and AVCC (AVCC is the analog power in), plus both GND pins (normal and analog). Connected are: +5V to VCC (pin 7) (red wire)GND to pin 8 (blue wire)+5V to AVCC (pin 20) (red wire)GND to pin 22 (blue wire)Connect /RESET (pin 1) to +5V via a 10K pull-up resistor Power supply Test the chip Wiring Type "L" ... Using an Arduino to Program an AVR.

Favorited Favorite 11 Overview Do you have a bricked Arduino that won’t accept code anymore? Or, maybe you wrote your own firmware and would like to upload it to your Arduino? Or, maybe you just want to learn more about the inner-workings of Arduino, AVR, and microcontrollers in general. Well, you’re in luck! This tutorial will teach you what a bootloader is, why you would need to install/reinstall it, and go over the process of doing so. Suggested Reading You may want to check out these tutorials before continuing down the bootloader path. What is a Bootloader? Atmel AVRs are great little ICs, but they can be a bit tricky to program. The bootloader is basically a .hex file that runs when you turn on the board.

Why Install a Bootloader If you are building your own Arduino, or need to replace the IC, you will need to install the bootloader. Selecting a Programmer We are going to talk about two different types of programmers you can use to install or reinstall bootloaders. Click for larger image. Programmer. Learning Examples | Foundations | Hacking | Links If you have an external programmer (e.g. an AVR-ISP, STK500, or parallel programmer), you can burn sketches to the Arduino board without using the bootloader. This allows you to use the full program space (flash) of the chip on the Arduino board. So with an ATmega168, you'll get 16 KB instead of 14 (on an ATmega8 you'll get 8 KB instead of 7). It also avoids the bootloader delay when you power or reset your board. Editing the Arduino preferences file To use an external programmer for all boards you need to make some small changes to the Arduino preferences.txt.

This preferences file is found in this folder: * /Users/<USERNAME>/Library/Arduino/preferences.txt (Mac) * c:\Documents and Settings\<USERNAME>\Application Data\Arduino\preferences.txt (Windows) * ~/.arduino/preferences.txt (Linux) Note that when you upgrade Arduino, this folder may not be deleted. Burning the sketch Going back to normal USB/serial upload. ATmega and ATtiny AVR Programmers and Schematics | AVR Programmers. AVR Programmer Information This section is intended to be a quick reference for the different AVR programmers.

Each page has some useful information, and a schematic of a programmer that was built and tested. Parallel Port Programmers The Bascom AVR Programmer is a buffered parallel port device. The BSD AVR Programmer is an unbuffered parallel port device. The Buffered AVR Programmer is a level-translating buffered parallel port device. The PonyProg STK200 AVR Programmer is a buffered parallel port device similar to the STK-200. The STK-200 AVR Programmer is a buffered parallel port device. Roll your own parallel port programmer. Serial Loader Programmers The Discrete RS232 Uploader is an RS-232 to TTL converter used to interface the AVR serial port with a computer's serial port. The FTDI-231X is a USB to TTL converter used to interface the AVR serial port with a computer. The FTDI serial cables are good for uploading code. This bootloader is made from an FTDI module.

Bascom AVR Programmer Schematic. USBtinyISP - Inexpensive USB AVR Programmer. USBASP driver for Windows 7 and Windows Vista x64 - Announcements. Until now, the USBASP windows driver wasn’t signed. On older versions of windows this was’t too much of a problem as you could override the signature error. On Windows Vista x64 and Windows 7, it is almost a show stopper. Various methods have been suggested including a utility called Driver Signature Enforcement Overrider or Pressing F8 at boot time and selecting Disable Driver Signature Enforcement. These approaches were far from ideal. With the release of libusb-win32 version 1.2.4.0 this is a thing of the past. OK, now for the installation procedure… Progisp使用说明书.doc. USBasp - USB programmer for Atmel AVR controllers.

Programming Atmega16A with a USBASP device « .:mikroTechnica. Program standalone ATtiny / ATmega chips through an Arduino. ICC AVR ISP 熔丝位等 - 二月二的日志 - 网易博客. AVR ISP programmer AVRISP. 使用ICCAVR和并口ISP下载线下载程序. Using AVR microcontrollers: Minimalist target boards.