Tuesday 24 August 2010

Development environment and tools

Now I'm going to do a review of the development environment and the tools that I'm using to the development.

The operating system I'm using is Windows but there are also tools that work with Linux. First of all is to choose the C compiler. I'm using AVR-GCC (WinAvr) that is a free compiler and it's very easy to use. You can go the web http://winavr.sourceforge.net/ where you can find the installation files and information about how to use it. I have installed the version 20090313 but you can download the newest one. In the web http://www.nongnu.org/avr-libc/user-manual/index.html there are information about the libraries and examples. To use it, only is needed to install the compiler.

Other important tool is AVR Studio 4. This is a free IDE from Atmel and it can be download from http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 The version I'm using is 4.18

The AVR Studio projects can be linked with AVR GCC. When you create the project you have to select the AVR GCC. You only have to choose the main file and the microcontroller. The program creates the makefiles and to compile you have to select the project files and just push the build button.

The next tool that I'm using is AVR Dragon that is a low cost debugger. I purschased it in mouser and only cost 40€. Here is the link http://es.mouser.com/ProductDetail/Atmel/ATAVRDRAGON/?qs=bfm/OTQPtMSBdktIZaKRJg%3d%3d

This debugger has a JTAG connector and can be linked to AVR Studio. You just have to connect to the board and you can debug directly from AVR Studio. If you are familiar with debuggers is very easy to use.

Wednesday 11 August 2010

The electronics review

Here is the main board schematic.

As it can see, is based on a ATMEGA64. The board has four L298, each of them has two full transistors bridges. Two of them manage the two stepper motors and with the other two it can manage up to four CC motors. The board has also a LCD connector were I have connected a 16x2 display. It has also some tension dividers to adapt the signals going to the ADC converters. I'm using two ADC converters to measure the arm angles trough a potentiometers and a third channel to measure the battery voltage. The hardware is also ready to measure the current consumption of the motors.

The board has a 40 pins connector were there are the ADC inputs, the motors, I2C to connect two ultrasound sensors and some general propose pins connected to the microcontroller. I have used 3 of these pins to put a encoder and measure the hand position.

The board has also three leds. To program I added a SPI connector, but when I tried to program the fuse bit the first time I failed and then it didn't work. Finally, I bought a JTAG programmer and I soldered some wires to the board to put the JTAG connector

Here is also the PCB design. The design has two layers.



Here is a photo of the board working. The board is hand made done, using a two layers board with a photo sensible material. The process to do it is print the photolytic in a transparent sheet, then you have to isolate the board in both layers, put it in a revealing and finally put it in an acid to remove the spare copper.
When I made the board, the first I did was to solder the main components to do it work like the microcontroller, oscillator, programming connector... Then I made a simple program to turn on the led and I programmed it. The picture was made after I performed the LCD driver and as it can see most of the components are not mounted.

In the next entrance I write about the programming environment, tools and how I did to program it. If you want more information, you want the schematic or whatever you need don’t hesitate to contact me.