Xathrya Sabertooth |
Installing USBasp Drivers on Windows 8.1 Posted: 05 Jun 2014 04:49 AM PDT When we are dealing with AVR programming, after create the codes in our development machine we should write the code into the device. For this purpose, we need a tool which we called Downloader or Programmer. This tool will “burn” the code into AVR CPU using spesific port. One popular tool is USBasp (http://www.fischl.de/usbasp/). This tool is a USB in-circuit programmer which consists of an ATMega88 or an AtMega8 and a couple of passive components. In short, we need no special USB controller anymore. Sometimes, we might face a problem installing usbasp drivers on Windows 8.1. But, this article will discuss about how to install those drivers. PrecautionThe method described here will require machine to restart. Make sure you have write down the steps before proceeding. Identify The Problemhe main problem is that Microsoft doesn’t allow us to install drivers which are not ‘digitally signed’ directly (or easily) on Windows Vista and later version (7, 8, and also 8.1). To get around this, we must temporarily disable the signature verification process. Phase 1: Disable Driver Signature Enforcement
Now, the machine will boot with no driver signature enforcement. We can then install the driver to our machine. Phase 2: USBasp Driver InstallationDownload the driver fro Windows from USBasp (http://www.fischl.de/usbasp/). The latest version is version 2011-05-28.zip which can be downloaded here. Read the readme first. Because I use WinAVR version 20100110, i will extract the libusb_0.1.12.1 folder as D:\libusb_0.1.12.1. Plug the USBasp in to USB port. Windows will try to recognize the device. It should be recognized but it lacks of driver so the process is not finish. Open “Device Manager” on “Control Panel”. Look for Other devices. We have USBasp device there. Right click on it and click on “Update Driver Software…” Click on “Browse my computer for driver software”. Type the location of folder “D:\libusb_0.1.12.1″ and then click “Next”. Windows will give warning as it can’t verify the publisher of the driver. Just ignore it and select “Install this driver software anyway” Let the installation proceed and wait until it finish. Done. |
AVR Microcontroller Programming in Windows Posted: 05 Jun 2014 04:01 AM PDT AVR or Alf & Vegard RISC, is a single chip microcontroller developed by Atmel. AVR is a modified Harvard architecture 8-bit RISC (Reduced Instruction Set Computer) which is famous microcontroller. AVR microcontrollers has many categories or we will say family. Family basically a group or category based on similiar characteristic and properties. There are six family and fortunately, AVR microcontrollers have same architecture so programming in any kind of family can be guaranteed work on other family. It is only limited to physical limitation such as different amount of flash storage, etc. This is also an advantage using AVR while variety options can be found while developing microcontroller project. This article will be covering preparation and setting up environment in Linux to develop AVR program. What you will need:
Program in MicrocontrollerBefore I start, let’s talk about program. What is program? A program is simply set of instructions written using machine language so it can be executed by machine. It is also called “binary” which mean to be not human-readable file (but can be understood by machine). For microcontrollers, binary files have type .hex (Intel Hex Format). You can imagine it as .exe in windows application. There are other forms, but in this article we will focus on .hex. AVR has a small amount of memory in it. It is a storage where program is actually saved. And yes it is small compared by computer. Just some Kilobytes. When the chip starts up, microcontroller will start running whatever program written in flash. Compiler and Cross CompilingCompilation for microcontroller is basically similar to compiling program for PC. However, the difference between those two is in term of product of compilation. Compiler for AVR is run in our PC (developer machine), compile source code, and then produce machine language which is specific for the microcontroller (not our PC). This process is called cross compiling. There are many cross compiler for AVR. I use AVR-GCC for this purpose (in this article and other similar articles, unless told otherwise). Other tools we need are collectively known as avr-binutils. The binutils packages provide all the low-level utilities needed in building and manipulating object files. In this package, we have AVR assembler ( The last thing to mention is the libc or standard c library. This is library designed for AVR microcontroller, or in other word it is different with our library used for PC programing. Fortunately, avr-gcc, avr-binutils, avr-libc, and avrdude (later) are already ported into Windows. These Windows version tools are collectively called WinAVR. We can download WinAVR for free from sourceforge site (http://sourceforge.net/projects/winavr/). Download the latest version. Download / Burn the Program to the ChipTo program microcontroller we need a downloader. It is a special chip that can connect your microcontroller with our computer and write our program into our chip. Every AVR has a set of pins that are programming pins. You have to verify you chip pins and connect the programmer to those pins in the right order. So what programmer can be used? In this article I used USBasp. Of course you can have other programmers, but I will only talk about this programmer. For information about USBasp, you can visit this link http://www.fischl.de/usbasp/ Now we have know our programmer (USBasp I mean) but then, how to write our program to microcontroller? Relax! We will cover now. We will use avrdude, a small application to do that. This tool is already included in WinAVR. Let’s take a peek of avrdude by give this command on our terminal: avrdude Let’s see what we have got. You will get something like this: Usage: avrdude [options] Options: -p <partno> Required. Specify AVR device. -b <baudrate> Override RS-232 baud rate. -B <bitclock> Specify JTAG/STK500v2 bit clock period (us). -C <config-file> Specify location of configuration file. <strong>-c <programmer> Specify programmer type.</strong> -D Disable auto erase for flash memory -i <delay> ISP Clock Delay [in microseconds] -P <port> Specify connection port. -F Override invalid signature check. -e Perform a chip erase. -O Perform RC oscillator calibration (see AVR053). -U <memtype>:r|w|v:<filename>[:format] Memory operation specification. Multiple -U options are allowed, each request is performed in the order specified. -n Do not write anything to the device. -V Do not verify. -u Disable safemode, default when running from a script. -s Silent safemode operation, will not ask you if fuses should be changed back. -t Enter terminal mode. -E <exitspec>[,<exitspec>] List programmer exit specifications. -x <extended_param> Pass <extended_param> to programmer. -y Count # erase cycles in EEPROM. -Y <number> Initialize erase cycle # in EEPROM. -v Verbose output. -v -v for more. -q Quell progress output. -q -q for less. -? Display this usage. avrdude version 5.10, URL: <http://savannah.nongnu.org/projects/avrdude/> Woah, that’s too much. But our interest is only in few options. I’ve bold the text which will get our attention. We only interests in -p, -U, and -c options as this is a minimum command we need to invoke along with avrdude.
With these three, we can program in minimal. In this case when I want to program ATMega32 using USBasp with filename avr_leds.hex, the command I use will be: avrdude -c usbasp -U flash:w:avr_leds.hex -p atmega32 Wait until process is finish and then you can see you microcontroller is programmed now. Next time I will write some actual writing program for AVR. |
You are subscribed to email updates from Xathrya Sabertooth To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
Tidak ada komentar:
Posting Komentar