Showing posts with label Atmel and AVR. Show all posts
Showing posts with label Atmel and AVR. Show all posts

Wednesday, September 2, 2009

AVR Blips

Thanks to: stevech@san.rr.com childressS@gmail.com

BLIPS is a graphical user interface and command line MS Windows program that loads programs and data into an Atmel AVR microprocessor’s flash and EEPROM memories. BLIPS transfers this data from a PC via either a serial port or a LAN/WAN connection (IP) to an Ethernet/WiFi to serial bridge – such as the Lantronix Xport or WiPort, or equivalent device. The AVR-side bootloader can be the sample provided in source code form with BLIPS or any that meets the Atmel AVR- 109 protocol.

Version 3 of BLIPS adds an optional command line interface to the graphical user interface in prior versions. This permits BLIPS to be called from scripts and batch files, with file and action parameters, and return a success status. The batch mode support for commercial for-profit endusers is controlled by a usage key. A sample command line batch file is:

blips progf -d atmega8 -p com1 -b 57600 "Flash file1.hex"
echo blips exit status = %errorlevel%

Click here to download more about AVR Blips

Sunday, July 5, 2009

The NanoVM - Java for the AVR

The NanoVM is a java virtual machine for the Atmel AVR ATmega8 CPU, the member of the AVR CPU family used e.g. in the DLR Asuro robot, manufactured by AREXX engineering. With the NanoVM, the Asuro can be programmed in the popular Java language using the standard Sun JDK. The NanoVM and its tools are distributed under the GPL and can be used on other AVR based systems as well.

The NanoVM for Asuro replaces the original firmware of the Asuro with a Java virtual machine capable of running a subset of the virtual machine command set. This enables e.g. the Asuro to interpret java bytecode and to run simple java programs like e.g. this one.


The NanoVM is a very resource aware implementation of the java vm. The Asuro version including a boot loader and several native classes fit into the 8kBytes flash rom of the Asuros AVR ATmega8 CPU. The complete 512 Byte EEPROM space of the CPU are available as Java program space and 75% of the 1 kByte RAM space are available to the running Java program.

More information about The NanoVM - Java for the AVR click here

Thursday, June 18, 2009

SMT USB AVR Programmer With ATTINY2313SO

Thanks to : Ayman El-Khashab, phd, pe

Here is the first iteration of the AVR µISP programmer. This is based on the usbtinyisp from adafruit, that was in turn based on Dick Streefland's USBTiny and the USB stack at www.obdev.at. but smaller and with all SMT parts except for the 10 and 6 pin headers.

I chose to spin my own design since I wanted to use it in a few different modes.First, I wanted to use a standard ISP cable. Second, I wanted to be able to insert pins from the programmer into boards without requiring the ISP header pins populated. Third, I wanted the capability to attach QFP and SOIC clips. And finally, by placing a female connector on the bottom of the programmer, it is possible to place the entire programmer atop a board header.


There are only a few differences in this design

100 Ω series resistors instead of 1500 Ω
Mini USB connector
Blue LED instead of green
Pin mapping of the AVR is slightly different

The entire board is 46mm x 20mm (about 1.8" by 0.8"). The hex code is available below, but if you want to build the code yourself, be certain to use GCC 3.x version. The 4.x versions do not do well with the AVR code size and this program is extremely tight in the ATTiny2313. Secondly, you will need a way to load the initial firmware into the AVR. I used my old standby, the SP12 that I have used for several years.

Since it is based on other designs, this one works with the avrdude programmer as well. Unfortunately the USB organization has come down on the people parcelling out PIDs, so you may have a difficult time getting another one if you so desire.

In addition to using this for programming AVRs, it may be used as a generic SPI controller or JTAG interface. It does not have enough pins for TMS, TCK, TDI, TRST, and TDO. However, many parts (and every Xilinx part I've ever used) do not have a TRST so with just the 3 outputs and 1 input it is possible to program Xilinx FPGAs and CPLDs. You may need a pullup on TDO. Then you can use the playxsvf program to sent a bitstream to the part. I currently use a variant of this for programming the ps3toothfairy devices. I implemented the same thing with the SP12, but it is parallel only and support for parallel ports is dwindling.

Modifying the code

If you decide to make some design changes and spin your own board, you'll need to edit the c code and the header file. The pins are well labeled except for a couple of writes to PORTD. Just search for PORTD in the spi.c code and update for your particular configuration. It is wise to read through the USB headers as well as the usbtiny.h file to understand what you can and cannot change in your design.

If you build the code and it is too large for the device, you have a couple of options. If it is a few bytes off, you can try reducing the string size in usbtiny.h. If it is much too large, you probably have something wrong in your compile or build settings. Check the makefile and be certain you aren't building with the gcc 4.x toolchain.

You can operate the device with avrdude. You may need to add in usb support depending on your platform (it is needed for cygwin).

Anyway, enjoy and thanks to the folks that made previous designs possible.

Build it

Here are pictures of the schematic and gerbers. Download the design below. We may make some available for purchase (especially since you need some method to initially program the micro). The build is not difficult with an iron, but it is likely easier with a toaster oven or hotplate reflow. (I've built a couple all with an iron in a couple of minutes). Click the images to get a larger view. The crystal goes either direction since the pins are at the corners.





Here is the BOM. None of the parts are particularly critical, other than you need to make sure to get the proper footprint.



Downloads

Note that updates were made to the Eagle files after the prototype and I haven't fabbed any from this design yet. It should work (as it was just moving some traces), but as with anything you download, trust-but-verify.

Firmware Source & Hex Code
Eagle Sch & PCB

License

The USBtiny software is licensed under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the license, or (at your option) any later version. A copy of the GPL version 2 license can be found in the file COPYING.

Sunday, May 17, 2009

AVR / 89S Microcontrollers programmer compatible with AVR910

Programmer it is executed on the basis of the driver from Objective Development and it is completely compatible on commands with original programmer AVR910 from ATMEL. The description of the original circuit programmer can be taken in Application Note AVR910: In-System Programming , and the list of supported commands can be seen in Application Note AVR109: Self Programming

the Design:

The circuit programmer is resulted in figure below. Safety fuse F1 serves for protection of lines of port USB against casual short circuit on circuits of programmer. Diodes VD1, VD2 - with a direct power failure ~0,6 … 0,7В, are intended for downturn of a power of microcontroller DD1 up to 3,6 V. Light-emitting diodes VL1, VL2 signal about the current actions programmer, and, accordingly, designate modes of reading and recording. Light-emitting diode VL3 serves for the signal system of submission of a power on programmer.




The jumper J1-J2 serves as for initial programming the microcontroller (close J1 - MODify), and for use as a socket programmer (close J2 - NORMal). Resistors R10 - R14 are intended for the coordination of levels of signals of the controller programmer and the programmed controller.

Speed for port SPI it is equal 187,5 kHz. It allows to program controllers with clock frequency approximately from 570 kHz for tiny/mega, 750 kHz for 90S and 7,5 MHz for 89S. Controllers are programmed from 10 till 30 seconds together with verification depending on volume FLASH of memory and clock frequency. On conclusion LED of socket ISP the meander with frequency of 1 MHz for "revival" uCU at which have been wrongly programmed fuse bits, responsible for clocking is removed. The signal is generated constantly and does not depend on an operating mode of programmer

Programmer it was tested with programs AVRProg v.1.4 (enters into a package AVRStudio ), ChipBlasterAVR v.1.07 Evaluation , AVROSP (ATMEL AVR Open Source Programmer) , CodeVisionAVR . Besides programmer it was tested with the program AVRDUDE , however, the program with given programmer is not compatible, as not all commands of the report AVR910 fulfils correctly. Programmer allows to program all controllers AVR supporting ISP (In System Programming - Programming In System), and as uCU series 89S - 89S53 and 89S8252. At present with the set forth above programs programming controllers 89S53, 89S8252, 90S2313, 90S8515, ATtiny26, ATtiny45, ATtiny2313, ATmega48, ATmega8, ATmega8515, ATmega8535, ATmega16, ATmega32, ATmega64 ATmega128, AT90CAN128 is tested

I strongly recommend to repeat the circuit one-in-one, to throw out "superfluous" details from the circuit can result or in wrong functioning programmer, or to possible failure USB of port on РС, for what, naturally, I do not carry what responsibility.

Insertion FUSE BITS:

For normal functioning the controller in the circuit it is necessary, that were programmed (bats SPIEN, CKOPT and SUT0 are established in "0"). Usually uCU, going from a factory, i.e. new, have already programmed bats SPIEN. As it is desirable (but it is not necessary) to program (to establish in "0") bats BODEN that will resolve job built - in uCU broun-out the detector. At not programmed to bat BODLEVEL level operations broun-out the detector there will be at a level of 2,4...2,9 Volt... Other bats should be not programmed (are established in "1")

Installation:

Windows XP

To stitch the controller. To connect newly-baked programmer to РС through free socket USB. OS will find the new device - AVR910 USB Programmer , at the offer automatically to find the driver, to refuse, and to specify a way to a file prottoss.avr910.usb.inf . At the prevention{warning}, that the driver has no digital signature, to send OS in erotic travel. Small problems at me have arisen, when, after installation, program AVRProg v. 1.4 could not find programmer as OS has appropriated to him number COM9. After monitoring ports appeared, that AVRProg searches for the device only on ports COM1 - COM4. To change number of port it is possible if to go in the manager of devices in: AVR910 USB Programmer-> Properties> Parameters of port-> In addition-> Number of COM-port

Windows 2000

Basically, installation does not differ from described above for Windows XP, but there is one BUT - delays in the driver usbser.sys spoil a chain of commands from on PC up to Soft programmer and, circuit of answers back from programmer up Soft to on PC... I yet have not established the Problem, but there is a decision... Certainly not the most beautiful, but works reliably:-) It is necessary to replace a file usbser.sys in system folders Windows 2000 on similar from Windows XP. These are folders ...\winnt\system32\drivers \ and ...\winnt\system32\dllcashe \ . The file usbser.sys from Windows XP SP1 can be taken here . It is natural, that the driver should be substituted having loaded under other OS (for example from a loading disk). As nucleus of these two OS are very similar, the driver from XP fine feels itself under 2000:--) At least, I have tested some more devices, pretending to be USB CDC Class, and all of them worked as usually... Attempts install the driver from XP through an adjusting file, unfortunately, in anything have not resulted. If who that knows, how it can be made, I shall be grateful.

Files:

All archives contain a file of an insertion, an adjusting inf-file and the circuit in format Adobe pdf. Except for it old versions contain the description as old html pages.

avr910_usb_programmer.files.ver.1.01.rar the Version from 25.08.2006. Frequency trim SPI, that adds speed of programming a little, however, it, there are problems with job on some computers because of timeout expectations ON programmer

avr910_usb_programmer.files.ver.1.02.rar the Version from 21.09.2006. No frequency trim, but for that generation of a meander on conclusion LED of a ISP-socket has appeared. There is a mistake in an insertion, connected with an establishment on conclusion RESET of a ISP-socket a broad gully. "0" at the first inclusion programmer. The conclusion remains in such status before the first programming or an input in the menu of installation fuse bits...

avr910_usb_programmer.files.ver.1.03.rar the Version from 31.10.2006. Is corrected a mistake of version 1.02.

avr910_usb_programmer.files.ver.1.04.rar the Version from 16.12.2006. internal pull-up the resistor connection Is added to an input MISO uCU programmers during programming target uCU. Probably, it will be useful at reading payments with the lowered voltage power, and in general, I think, will positively have an effect on reliability of reading programmed uCU.

Saturday, May 16, 2009

Minimum System Board For AT89SXXXX

Features

  • Support ATMEL AT89S series such as AT89S51, AT89S52, AT89S53, AT89S8252.(DIP 40 pin devices)
  • Use In-System Programming(ISP).Low voltage programming
  • RS232 X 1 .
  • 5V regulate on-board.
  • No need any tools or programmer devices .
  • connector for all I/O.
  • Requite one PC parallel port for ISP.
  • Software supports for All Windows.
  • easy to build your own single side PCB.
  • Require power supply from DC adpaptor 9-12VDC or AC





How to use ATMEL ISP.

To use this ATMEL ISP board you need to download software ISP-3v0 developed by Muhammad Asim Khan and distributed by Prof. Wichit 's website or download at the buttom on this page.

Software ATMEL ISP V3.0

After download software.

1. Connect ATMEL ISP cable to PC parallel port and power supply. (see Fig.5)
2. Run software ISP3.0 for Windows95/98/ME use ISP-3v0.exe and WindowsXP/2000/NT use ISP-XP.bat .
3. Select your devices from drop down list menu.
4. Click "Open file" to open hex file.
5. Click "Write" to program device.

How to use RS232 port.

To use RS232 port ,first build a simple RS232 cable.





Download Schematic and PCB

Friday, May 15, 2009

AVR ISP Programmer (In-Sytem programmer) for ATMEL

Introduction:

This AVR ISP original by ATMEL you can found on "AVR software
and technical Library - April 2003" CD-rom.It small component count I design new PCB and change some component that easy to build small PCB.The new firmware was writen by John Samperi for AT90S2313 .This code can program more devices.

Specification

- Device support

Verified device

- Use power supply from target board
- RS-232 control at 19200 BPS
- Support AVR Studio 4

Schematic detail

The schematic for AVR ISP show in picture 1, IC1 DS275 use for RS-232 Driver becuase it small and no need external component IC2 AT90S2313 is the CPU to communication and receive command from PC that run AVR Prog to control target CPU. The wire from AVR ISP to target CPU not exceed 15 cm








This firmware compiled to run on crystal 4MHz ,so the target device must connect crystal 4MHz on XTAL1 and XTAL2 pin.But, if your target device use internal oscillator and enabled .its not need any external oscillator.

To use this AVR ISP with target device that run at 8MHz you can do this by recompile the firmware source code. Before recompile you need to change the line in source code as below

.equ xtal_8mhz=0 ; if 0 then 4MHz Xtal

Change to :

.equ xtal_8mhz=1 ; if 0 then 4MHz Xtal

After change firmware you can compiler it by Avrasm found from ATMEL web site

To use AVR ISP



Picture 3.Show how to use AVR ISP

Click here to Download
- Source code
- Object code(Hex)
- schematic
- AVRProg

Your IP Address