Thursday 20 June 2013

ATMEL At-mega_16 Board And Their Circuits/IC’s/Pins Description.

Hi! Welcome back.
Hopefully the first code worked out successfully.
Today Talking regarding the ATMEL Atmega_16 board . There are small circuits/IC’s/Pins that we need to discuss about.

    1.     KA7805A voltage regulator :
·         As mentioned it’s a voltage converter which is placed just after the input voltage is applied on the board. Just check here.
·         Output Current up to 1A.
·         Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V.
·         The KA78XX/KA78XXA series of three-terminal positive regulator although designed primarily as fixed voltage regulators, these devices can be used with external components to obtain adjustable voltages and currents.


·         IO = 500mA, VI =10V, CI= 0.33ìF, CO=0.1ìF, VO=5.3(max).
·         A capacitor is used in between the input & output of the transformer IC which is used to filter the current to pure DC.
    2.     AVR reset:
·         Every time you write the program you need to reset the flash memory of the Atmega board.
·         Before you could reload the program on to your board press the reset button and then refresh Hidbootflash and write.
·         Circuit function :
It’s very simple! When the switch is on the circuit of the MC gets connected to ground thus the MC get a signal 0 and vice verse.

    3.     16 x 2 LCD display:
·         It’s a 16 pin LCD display device.
·         Contents 16 rows and 2 column.
·         At the back on the LCD we have a big black circle which has the microprocessor within.
·         The last 2 and first 2 pins are VCC ,Gnd (0,1-14,15)

·         The 3rd pin is the RS (register select), 4th pin is the RW (read/write).and the rest are the data pin.
    4.     L293D/N Motor Driver:
Check the circuit here, for the position of the motor driver.
·         Wide Supply-Voltage Range: 4.5 V to 36 V
·         Output Current 1 A Per Channel (600 mA for L293D)
·         The L293 is designed to provide bidirectional drive currents of up to 1 A at voltages from 4.5 V to 36 V.
·         Both devices are designed to drive inductive loads such as relays, solenoids, dc and bipolar stepping motors, servos, accelerometer, brushless motors etc.

·         The important part of this IC is “All inputs are TTL compatible”.

Will come up with new stuffs .
Thanks a lot.








Tuesday 11 June 2013

START WITH BLINKING LED

Good to see you again. Now we could code a bit.
Let’s start with Blinking LED.
//HOW CAN I BLINK THE 8 LED’s USING MY PORTB OF ATMEL ATMEGA 16

#include<avr/io.h>       //include AVR Header file
#include<util/delay.h> // include delay header file

main ()                 // main function
{
DDRB=0xFF;       //Declare PB4 as a Output

while (1)               //infinite loop

{

PORTB=0xFF;   //buzzer on
_delay_ms (1000);   // delay
PORTB=0b00000000; // buzzer off
_delay_ms (1000); // delay

} //while closed


}

Regarding the program
      1.     The header files used have predefined avr functions and commands.  
      2 . If we are using a delay in the program then we need to use the header of delay.
      3.   It is best way to write both the headers of C while using avr. There are much headers to be used next.
         4.     Going into the main function we have declared PortB as output port by putting all the pins 1.You can also             give the particular pin 1 in which you need the output. Suppose we need the output in my third pin so my PortB will be (DDRB=ob00000100).Don’t get confused why I used in this way but I have used in some other way in the program. It’s very simple, (0x) stands for hexadecimal and (0b) stands for binary. I am weak in conversion from binary to HEX so you can convert the same code and can use it in hex(DDRB=0x04). No matter’s whichever you like,
    5.     Now you have made all your PortB pins as output pins. We know that when the binary 1 fetched, the led glows and vice versa.
    6.     The values given in PortB is given as (PORTB=0xFF) which implies all the pins are given as 1.
    7.     The delay command used has a unit of millisecond delay.
    8.     The summary of this simple program is all the pins of PortB are made as output ports and all the led’s are supposed to glow and off after a delay of 1000 msec.
    9.     When you have written in avr just press f7 or build the program.
   10.  Go to the Avr boot flasher and browse the .hex file and it is over .
Thanks a lot…………………….. 

Monday 10 June 2013

ATMEGA16 MICRO-CONTROLLER DEVELOPMENT BOARD.

Hello friends!!!!!!!!
Before we speak about programming on Atmega 16 let’s get familiar with ATMEGA16 Microcontroller Development Board.
It is made from double sided PTH* PCB board which supports 5 to 12 v of dc/ac supply.

*PTH means (plated thru holes), the track on opposite faces of the PCB are connected by copper track, for non PTH, you have to use wire link through the circuit. So check for PTH boards when you buy.


Block Diagram:

Board Description:


Getting Started:

The Board can source power to the microcontroller through the USB cable.
Remember that the power available through the USB cable is limited. If your
Application attaches several peripherals to the board, you should use an external
Power source connected to the DC input socket on Board. The external power
Supply should be 9-12V DC with positive center connector. The red POWER LED
Will glow when power is on.
Fine ! Now i hope you have got a rough idea of what is going all around.So It's time for testing.
thanks 

Thursday 6 June 2013

GET STARTED WITH AVR STUDIO & PROTEUS

Hi everyone.
Hope you are ready with the software’s and the microcontroller. You can download and easily install the Avr studio but you may face problem in installing the proteus_7.9. Not an issue, just check the video………


If you are using proteus:
·         You need to set your device in proteus. Press [p] and type the keyword as Atmega and select the Atmega 16 chip. You will be further adding the devices with the same way as your need in the upcoming phases.

·         Now using the Avr studio for programming on the chip. Open Avr studio and click on new project. Select Avr GCC à Type your project name and NEXTà  Select Avr simulator and find your device.




·         A [.C] file opens where we need to write our programs for a particular microcontroller.

But if you are using the microcontroller directly then you will be using the bootloader software. We will be talking regarding the loaders later in the tutorials.

How to connect proteus to Avr studio
·         Double click on the microcontroller in the proteus workspace.
·         You just need to browse the file you saved while writing the program in Avr studio.

Now everything is set for you to start with. Keep in touch.
Thank u. 

Wednesday 5 June 2013

WELCOME TO AVR FAMILY

Atmel AVR family gives a unique style of performance/design flexibility to the world of Megatronics. No other microcontroller Delivers more computing performance then Avr.
Some computing features
·         High Endurance Non-volatile Memory segments.
·         131 Powerful Instructions
·         Operating Voltages
– 2.7V - 5.5V for ATmega16L
– 4.5V - 5.5V for ATmega16
·         Speed Grades
– 0 - 8 MHz for ATmega16L
– 0 - 16 MHz for ATmega16
·         Supports simple C coding.
           
 About AT mega 16 microcontroller
  • AT – Given by the name of the company Atmel
  • Mega – Since it speed doesn’t exceeds MHz
  • 16 – It has 16 kb flash memory

(We will be talking later regarding the flash memory)
   AVR Architecture*:
o    40 pin IC
o    32 pin I/O
o    Ports are(I/O) : PA,PB,PC,PD( All have 8 pins,(A,B,C,D) )
o    Other pins are : RESET,VCC,GND,XTAL2,XTAL1, AREF,GND,AVCC

*I have tried my best to reduce big structural diagrams, and lengthy explanations such that you don’t get bored (well if you require it I will definitely post them)………. but but but….wait….. I will surely explaining them when you will be using them in my further tutorials.

Register Description for I/O Ports













   
    Three 8 bit registers present in At mega16
-       DDRX* ->Data direction register (Defines I/O ,1-o/p ,0-i/p)
-       PINX*   ->Stores input values from sensors of sound or light or IR.
-       PORTX*->Defines output values.
*All ‘X’ can be replaced by the port names A, B, C, D.

Software Requirement

If you have the Atmega 16 board with you then just go for these software’s 1-2-3 .
  •   Avr Studio 4b589.
  •   WinAvr
  •  Hidbootflash
  •   Avrloader, 8051 loader


If you can’t manage the Atmega 16 board, never to panic it’s not so far from you: download the simulator and enjoy the tutorial.
1.     Proteus_7.9
2.     Avr Studio 4b589
3.     WinAvr
4.     Hidbootflash
5.     Avrloader, 8051 loader

The upcoming post will help you to install and  work on the Atmega 16 software’s  .How could you be familiar with the software of Avr .C coding made easy on Avr platform.
Much more to code NEXT………
Have a nice day.