Sunday, May 19, 2013

Web based AVR Project







          This AVR Project is derived from the idea to control home appliances through web. It is a combination of web application and avr circuit. This project consist  python(flask frame work ) as server and JavaScript with HTML5 as client. The User Interface and avr microcontroller is communicate through serial port of PC.

CIRCUIT DIAGRAM


Circuit is divided into two parts, microcontroller-circuit and serial port interface.

The main circuit consist of atmega8 microcontroller, four leds connected to PORTD (pins-6,11,12,13) and a potentiometer in pin-23(ADC0).The MAX232 used as level converter for communicating the USART of atmega8 with serial port(PC).USART is simply a form of serial data communication.




main circuit


Microcontroller and PC communication using RS232: RS232 is the encoded version of USART.









serial port interface


  This blog post updating now....






Saturday, May 18, 2013

USBasp programmer with avrdude(Linux)


    After success full  implementation of  serial programmer, I turned to make a USBasp programmer .The firmware is downloaded from USBasp official site.In this tutorial we will see how to use AVRdude for burning hex files into AVR microcontroller using USBasp. USBasp is a USB in-circuit programmer for Atmel AVR controllers. It simply consists of an ATMega8 and a couple of passive components. The programmer uses a firmware-only USB driver, no special USB controller is needed. In my circuit only use the six pins(MOSI,MISO,SCK,RESET,GND,+5V) from the usbasp to target microcontroller, It is little different from actual circuit in official site. No need of external +5V power supply to target microcontroller. The circuit is given below


USBasp programmer

NOTE:The fuse bits for 12Mhz crystal  HFUSE=0xc9 and  LFUSE=0xef  burn explicitly to  atmega8 using serial programmer(any programmer).It is very important, the USBasp programmer cannot work with default fuse bits. The command for setting the fuse bit:

avrdude -c ponyser -p m8 -P /dev/ttyS0 -U lfuse:w:0xc9:m -U hfuse:w:0xef:m

For reading the current fuse bit in atmega8:

avrdude -c ponyser -p m8 -P /dev/ttyS0 -U hfuse:r:high.bin:b -U lfuse:r:low.bin:b

Friday, May 17, 2013

AVR Serial Programmer

First I think, how to build a USBasp programmer.But I have n't a usb programmer to flash the firmware to it. Then decided to create a serial programmer and flash the firmware through this programmer to  atmega8. My  AVR serial programmer will transform hex file to most AVR microcontroller. It can build using few readily  available components. This programmer is compatible with popular avrdude software or PonyProg software.

We will be using the serial port for burning. First, we have to develop a burning circuit for it.

REQUIRED COMPONENTS 


Resistors :             10k     - 2
                           4.7k    - 2
                           15k     - 1

Zener diode :         5.1v   - 2


Diode :               1N4148 - 1


Transistor :      BC549/48 -  1


9-PIN RS232 female connector

serial programmer