Sunteți pe pagina 1din 82

ATMEL INTEGRATED DEVELOPEMENT BOARD

Introduction
This project describes a prototype board for the Atmel Mega32 or other Atmel Series (PDIP) MCU. It includes a power supply, crystal clock and generous bypass capacitors. A six-pin header allows flash memory programming from an STK200/300 or Atmel Dragon. All port pins are brought out to a single row of vias on 0.1 inch centers. A single 36 connection SIP machine-pin plug could be used to attach this row to another board or to a solder less breadboard. All 32 port pins, plus Vcc, Aref and ground, are available. It include DB9 and DB 25 connector which is use to program the Microcontroller with the interfacing circuit (M74HC244 and Ponyprog2000) to protect the microcontroller, push buttons for inverting and non-inverting application, LED panel to check the output of the Microcontroller, to provide external input to the Microcontroller connectors are provided. The two seven segment display are also shown on the board as shown in the figure under the heading Atmel development board, L298 motor driving circuit for driving stepper motor

The board layout is shown below. The Express PCB design file for v8/2009 is here and requires a free software download to modify or to order directly from express PCB. The Express PCB schematic file is here. Minor changes from last year include bigger diameter header vias, 1N4001 diode on power input, and Vcc-to-Vtarget jumper support for the dragon programmer. Tentative serial design for next year is here. Tentative USB design is here.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 1

ATMEL INTEGRATED DEVELOPEMENT BOARD

High Level Design


Rationale and Sources Logical Structure Hardware and Software Tradeoffs

Rationale and Sources


The rationale behind this project was to demonstrate an idea by creating a working prototype of a development board to enable the testing of the different and multiple application based on Atmel series or projects based on Atmega32 We also thought that the idea of integrating all of the different hardware to actuate feedback that was very interesting. Putting all of this in a single board package was no easy task but it was a great learning experience. The source of the idea behind our project was from major training done by us at the Center Research and Industrial Staff Performance (CRISP), BHOPAL. They trained us on Philips and Motorola development board was linked to the a PC. This idea spurred our interest in using a development board feedback system to allow the user to test the projects at greater possibility.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 2

ATMEL INTEGRATED DEVELOPEMENT BOARD

Logical Structure
The basic logical structure of our project involves the input from the Atmel programmer tool AVR Studio, Code Vision PonyPrgo2000 through computer to the microcontroller to run the different devices. The microcontroller enables the six major components to communicate effectively with programmer through serial and parallel Ports. Before burn the program in microcontroller we test the program in Simulator and different simulator devices.

Logical Structure of Integrated Development Board

A 9 volt power supply is applied to the board where LM7805 voltage regulator convert it to 5 volt supply. This voltage is use by the microcontroller to drive the following circuits describe below: L298 Stepper Motor Controller Two 7segement display External Input/output LED panel
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 3

ATMEL INTEGRATED DEVELOPEMENT BOARD Push Switch

Hardware and Software Tradeoffs


Anything that we determined could be easily implemented in hardware or software we opted to do in software because our processor was not very taxed for computing power, to begin with. The original idea was to use a L298 Stepper Motor Controller to control the bipolar stepper motor step sequences, but we decided that this was much easier done with the microcontroller because it required less connections and we could control better the number of steps, the reversal of direction and the speed of rotation of the motor. Also, it was a better idea for us to offload the hardware onto the software because we had extra processing power and the circuitry required for this project was already significant. The separate jumpers were easier to check the inverting and non-inverting modes of LED panel and both of the seven segments display, the extra both of the push switches are use to separately provide the inverting and non-inverting input. The low power signal are directly connected to the microcontroller.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 4

ATMEL INTEGRATED DEVELOPEMENT BOARD

Circuit Diagrams Circuit Diagram of Integrated Development board

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 5

ATMEL INTEGRATED DEVELOPEMENT BOARD

Component Descriptions
The following is a brief description of some of major components that we used in our hardware design of the system. We also used some boards generously donated by Freescale to the lab in this final project. We used the DS1532 9V battery board and two small soldering boards. Unfortunately the 5V regulator on the battery board could not supply enough current to drive our stepper motor so we soldered into the board a new regulator (LM340T5) to supply the necessary power to the motor. Atmega 32 L298HN

74LS74 74HC244 LM7805 Crystal Oscillator Diodes


Resistor

Capacitor Breadboard

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 6

ATMEL INTEGRATED DEVELOPEMENT BOARD

Atmega 32
The ATMEGA32 is a low-power, high-performance CMOS 8-bit microcontroller with 32K bytes of in-system programmable Flash memory. The device is manufactured using Atmels high-density non-volatile memory technology and is compatible with the industry- standard 80C51 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional non-volatile memory programmer. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the Atmel ATMEGA32 is a powerful microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications. The ATMEGA32 provides the following standard features: 32K bytes of Flash, 2K bytes of RAM, 32 I/O lines, Watchdog timer, Two 8-bit and One 16-bit Timer/Counters with Separate Prescalers and Compare Modes, Real Time Counter with Separate Oscillator, Six PWM Channels, 8-channel, 10-bit ADC ,Differential mode with selectable gain at 1x, 10x or 200x, Byte-oriented Two-wire Serial Interface, One Programmable Serial USART, Master/Slave SPI Serial Interface, Programmable On-chip Analog Comparator, Watchdog Timer with Separate On-chip Oscillator,

Interrupt and Wake-up on Pin Change, Special Microcontroller Features, Power-on Reset and Programmable Brown-out Detection. In addition, the ATMEGA644 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Power-down mode saves the RAM contents but freezes the oscillator, disabling all other chip functions until the next external interrupt or hardware reset.

Pin diagram

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 7

ATMEL INTEGRATED DEVELOPEMENT BOARD

Figure No. 1.1: Pin Diagram of ATMEGA 32

Features
High-performance, Low-power AVR 8-bit Microcontroller Advanced RISC Architecture 131 Powerful Instructions Most Single-clock Cycle Execution 32 x 8 General Purpose Working Registers Fully Static Operation Up to 16 MIPS Throughput at 16 MHz On-chip 2-cycle Multiplier High Endurance Non-volatile Memory segments 32K Bytes of In-System Self-programmable Flash program memory 1024 Bytes EEPROM 2K Byte Internal SRAM Write/Erase Cycles: 10,000 Flash/100,000 EEPROM Data retention: 20 years at 85C/100 years at 25C(1) Optional Boot Code Section with Independent Lock Bits In-System Programming by On-chip Boot Program True Read-While-Write Operation Programming Lock for Software Security JTAG (IEEE std. 1149.1 Compliant) Interface Boundary-scan Capabilities According to the JTAG Standard Extensive On-chip Debug Support Programming of Flash, EEPROM, Fuses, and Lock Bits through the JTAG Interface Peripheral Features Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 8

ATMEL INTEGRATED DEVELOPEMENT BOARD Mode Real Time Counter with Separate Oscillator Four PWM Channels 8-channel, 10-bit ADC 8 Single-ended Channels 7 Differential Channels in TQFP Package Only 2 Differential Channels with Programmable Gain at 1x, 10x, or 200x Byte-oriented Two-wire Serial Interface Programmable Serial USART Master/Slave SPI Serial Interface Programmable Watchdog Timer with Separate On-chip Oscillator On-chip Analog Comparator Special Microcontroller Features Power-on Reset and Programmable Brown-out Detection Internal Calibrated RC Oscillator External and Internal Interrupt Sources Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Powerdown, Standby and Extended Standby I/O and Packages 32 Programmable I/O Lines 40-pin PDIP, 44-lead TQFP, and 44-pad QFN/MLF Operating Voltages 2.7 - 5.5V for ATmega32L 4.5 - 5.5V for ATmega32 Speed Grades 0 - 8 MHz for ATmega32L 0 - 16 MHz for ATmega32 Power Consumption at 1 MHz, 3V, 25C for ATmega32L Active: 1.1 mA Idle Mode: 0.35 mA Power-down Mode: < 1 A
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 9

ATMEL INTEGRATED DEVELOPEMENT BOARD

.L298HN

The L298 is an integrated monolithic circuit in a 15-lead Multiwatt and PowerSO20 packages. It is a high voltage, high current dual full-bridge driver designed to accept standard TTL logic levels and drive inductive loads such as relays, solenoids, DC and stepping motors. Two enable inputs are provided to enable or disable the device independently of the input signals. The emitters of the lower transistors of each bridge are connected together and the corresponding external terminal can be used for the connection of an external sensing resistor. An additional supply input is provided so that the logic works at a lower voltage. OPERATING . SUPPLY VOLTAGE UP TO 46 V TOTAL DC CURRENT UP TO 4 A LOW SATURATION VOLTAGE OVERTEMPERATURE PROTECTION LOGICAL "0" INPUT

VOLTAGE UP TO 1.5 V (HIGH NOISE IMMUNITY)

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 10

ATMEL INTEGRATED DEVELOPEMENT BOARD

74LS47
The SN54/74LS47 are Low Power Scotty BCD to 7-Segment Decoder/Drivers consisting of NAND gates, input buffers and seven AND-OR-INVERT gates. They offer active LOW, high sink current outputs for driving indicators directly. Seven NAND gates and one driver are connected in pairs to make BCD data and its complement available to the seven decoding AND-OR-INVERT gates. The remaining NAND gate and three input buffers provide lamp test, blanking input / ripple-blanking output and ripple-blanking input. The circuits accept 4-bit binary-coded-decimal (BCD) and, depending on the state of the auxiliary inputs, decode this data to drive a 7-segment display indicator. The relative positive-logic output levels, as well as conditions required at the auxiliary inputs, are shown in the truth tables. Output configurations of the SN54/ 74LS47 are designed to withstand the relatively high voltages required for 7-segment indicators. These outputs will withstand 15 V with a maximum reverse current of 250 mA. Indicator segments requiring up to 24 mA of current may be driven directly from the SN74LS47 high performance output transistors. Display patterns for BCD input counts above nine are unique symbols to authenticate input conditions. The SN54/74LS47 incorporates automatic leading and/or trailing-edge zero-blanking control (RBI and RBO). Lamp test (LT) may be performed at any time which the BI /RBO node is a HIGH level. This device also contains an overriding blanking input (BI) which can be used to control the lamp intensity by varying the frequency and duty cycle of the BI input signal or to inhibit the outputs. Lamp Intensity Modulation Capability (BI/RBO) Open Collector Outputs
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 11

ATMEL INTEGRATED DEVELOPEMENT BOARD Lamp Test Provision Leading/Trailing Zero Suppression Input Clamp Diodes Limit High-Speed Termination Effects

74HC244
The 74HC244 is an advanced high-speed CMOS OCTAL BUS BUFFER (3STATE) fabricated with silicon gate C2MOS technology. G control input governs four BUS UFFERs. This device is designed to be used with 3 state memory address drivers, etc. All inputs are equipped with protection circuits against static discharge and transient excess voltage. HIGH SPEED: tPD = 10ns (TYP.) at VCC = 6V LOW POWER DISSIPATION: ICC = 4mA(MAX.) at TA=25C HIGH NOISE IMMUNITY: VNIH = VNIL = 28 % VCC (MIN.) SYMMETRICAL OUTPUT IMPEDANCE: |IOH| = IOL = 6mA (MIN) BALANCED PROPAGATION DELAYS: tPLH @ tPHL WIDE OPERATING VOLTAGE RANGE: VCC (OPR) = 2V to 6V PIN AND FUNCTION COMPATIBLE WITH 74 SERIES 244

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 12

ATMEL INTEGRATED DEVELOPEMENT BOARD

LM7805
The LM78LXX series of three terminal positive regulators is available with several fixed output voltages making them useful in a wide range of applications. When used as a zener diode/resistor combination replacement, the LM78LXX usually results in an effective output impedance improvement of two orders of magnitude, and lower quiescent current. These regulators can provide local on card regulation, eliminating the distribution problems associated with single point regulation. The voltages available allow the LM78LXX to be used in logic systems, instrumentation, HiFi, and other solid state electronic equipment. The LM78LXX is available in the plastic TO-92 (Z) package, the plastic SO-8 (M) package and a chip sized package (8-Bump micro SMD) using Nationals micro SMD package technology. With adequate heat sinking the regulator can deliver 100 mA output current. Current limiting is included to limit the peak output current to a safe value. Safe area protection for the output transistors is provided to limit internal power dissipation. If internal power dissipation becomes too high for the heat sinking provided, the thermal shutdown circuit takes over preventing the IC from overheating. LM78L05 in micro SMD package Output voltage tolerances of 5% over the temperature range Output current of 100 mA Internal thermal overload protection
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 13

ATMEL INTEGRATED DEVELOPEMENT BOARD Output transistor safe area protection Internal short circuit current limit Available in plastic TO-92 and plastic SO-8 low profile packages No external components Output voltages of 5.0V, 6.2V, 8.2V, 9.0V, 12V, 15V

Crystal Oscillator
A crystal oscillator is an electronic circuit that uses the mechanical resonance of a vibrating crystal of piezoelectric material to create an electrical signal with a very precise frequency. This frequency is commonly used to keep track of time (as in quartz wristwatches), to provide a stable clock signal for digital integrated circuits, and to stabilize frequencies for radio transmitters and receivers. The most common type of piezoelectric resonator used is the quartz crystal, so oscillator circuits designed around them were called "crystal oscillators". Quartz crystals are manufactured for frequencies from a few tens of kilohertz to tens of megahertz. More than two billion (2109) crystals are manufactured annually. Most are small devices for consumer devices such as wristwatches, clocks, radios, computers, and cell phones. Quartz crystals are also found inside test and measurement equipment, such as counters, signal generators, and oscilloscopes. A crystal is a solid in which the constituent atoms, molecules, or ions are packed in a regularly ordered, repeating pattern extending in all three spatial dimensions. Quartz has the further advantage that its elastic constants and its size change in such a way that the frequency dependence on temperature can be very low. The specific characteristics will depend on the mode of vibration and the angle at which the quartz is
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 14

ATMEL INTEGRATED DEVELOPEMENT BOARD cut (relative to its crystallographic axes).[7] Therefore, the resonant frequency of the plate, which depends on its size, will not change much, either. This means that a quartz clock, filter or oscillator will remain accurate. For critical applications the quartz oscillator is mounted in a temperature-controlled container, called a crystal oven, and can also be mounted on shock absorbers to prevent perturbation by external mechanical vibrations.

Diode
It is s two terminal device consisting of a P-N junction formed either in GE or SI crystal. The P and N type regions are referred to as anode and cathode respectively. Commercially available diodes usually have some means to indicate which lead is P and which lead is N. Standard notations consists the number proceeded by IN such as In 240 & 250. Here 240 and 250 correspond to color band. Diodes are polarized, which means that they must be inserted into the PCB the correct way round. This is because an electric current will only flow through them in one direction (like air will only flow one way through a tyre valve).Diodes have two connections, an anode and a cathode. The cathode is always identified by a dot, ring or some other mark.

The pcb is often marked with a + sign for the cathode end. Diodes come in all shapes and sizes. They are often marked with a type number. Detailed characteristics of a diode can be found by looking up the type number in a data book. If you know how to measure resistance with a meter then test some diodes. A good one has low resistance

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 15

ATMEL INTEGRATED DEVELOPEMENT BOARD in one direction and high in the other. There are specialized types of diode available such as the zener and light emitting diode (LED).

Resistor
A resistor is an electrical component, which has been manufacture with a specified amount of resistance. The resistors can conduct current in both the directions. The resistors may be connected in an electric circuit without concern for lead polarization. The resistors are used mainly for two purposes, namely controlling the flow of electric current and providing desired amounts of voltage in electric in electric or electronic circuits.

Resistor specifications
The resistors are specified in terms of their resistance values, tolerance power rating and thermal stability. By tolerance, we mean the allowed variation permitted in the normal or marred value or the resistor. It means that the actual value of the resistor may be either greater or smaller than that of the indicated value, by a factor given by the specified tolerance. Thus resistors are manufactured with a specified tolerance. For example, a 5000 resistor with a tolerance of + 10% will have an actual resistance value anywhere between 4500 and 5500 or in other words 500 greater or smaller them the rated value.
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 16

ATMEL INTEGRATED DEVELOPEMENT BOARD The power rating of a resistor is given by the maximum wattage it can dissipate, without excessive heating. Since the power rating is proportional to the square of a current, there fore current must not be higher than its safe value. If the current exceeds the safe value, the resistance will burn out. Usually, carbon composition resistors will fail, if operated at near the rated power values. In this case, the resistor will not burn out. But the failure is gradual, which takes many months. It changes gradually to a much lower amount of resistance. This causes an improper operation of an electronic of an electronic circuit particularly in amplifier. Thus in order to increase the life of use a power dissipation of about half of the rating of the resistor. The thermal stability of a resistor is indicated by the temperature coefficient specification, which is usually expressed in parts per million per degree centigrade (+ ppm/C). The smaller value of temperature coefficient will have less variation in the resistance value. Therefore, smaller value of temperature coefficient means a higher thermal stability of a resistor. Classification of resistor Shows the classification of resistors in the from of a family tree. The resistors are basically of two types, namely linear resistors and non- linear resistors. Each type is further subdivided into many types as shown in the figure. Linear resistors The resistors through which the current is directly proportional to the applied voltage, are called linear resistors. Such resistors have a property that their resistance value do not change with the variation in applied voltage, temperature or light intensity. The linear resistors are of two types namely fixed resistors and variable resistors. Nonlinear. The resistors through which the current is not directly proportional to the applied voltage, are called non-linear resistors. Such resistors have a property that their resistance values change with variation in applied voltage, temperature of light intensity. The non-linear resistors are of three namely thermostat, photo resistor and varistor. Fixed Resistors The fixed resistors are those whose do not change with the variation in applied voltage, temperature and light intensity. Such resistors are available in various shapes and sizes, with both axial and radial leads as shown in Fig.7.2. In addition to this, the

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 17

ATMEL INTEGRATED DEVELOPEMENT BOARD fixed resistors are available with sugs for installation by soldering or mounting with screws and rivets.

Resistor Colour Code Calculator


The Resistor Colour Code Calculator can be used to identify resistors. It consists of three card discs showing the colours and values, these are fastened together so you can simply turn the discs to select the value or colour code required. Simple but effective! There are two versions to download and print on A4 white card (two per sheet): Coloured (for a colour printer) B/W for a black only printer) This version must be coloured manually, it is easiest to do this before cutting out. To make the calculator, carefully cut out the three discs and fasten them together with a small brass paper fastener. The calculator design is copyright but it may be freely copied for educational purposes. The Resistor Colour Code Calculator is supplied as a PDF file. To view and print PDF files you need an Acrobat Reader which may be downloaded free for
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 18

ATMEL INTEGRATED DEVELOPEMENT BOARD Windows Mac,RISE OS, or Unix Linex computers. If you are not sure which type of computer you have it is probably Windows.

Capacitor
This are the storage devices but has in built Resistance thats why the storage voltage does not last for longer period. The use of capacitor is for tuning the circuit, filtering the noise to ground, creating the timing pulse as in our case .The capacitors cannot be fabricated on ICs because of the technical difficulty. The capacitors are selected based on capacitance and voltage rating .Higher the voltage higher the size of the capacitor. These are available in following types

Electrolytic Capacitor
These capacitors have electrolyte as the dielectric between the two plates. These are available with polarity +and-. These are available with vertical mount or horizontal mount configuration.

Paper Capacitor
These capacitors are available in low range of capacitance. The

The Resistor Color Code


Color Black Brown Red Orange Yellow Green Blue Violet Grey White

Number 0 1 2 3 4 5 6 7 paper is used as dieletric media between the two plates.

Mica Capacitor
These capacitors are also available in low range of capacitance. The mica is used as dieletric media between the two plates.

Disc Capacitor
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 19

ATMEL INTEGRATED DEVELOPEMENT BOARD These are available from 1pF to 1ooooUF

Breadboard
A breadboard is used to make up temporary circuits for testing or to try out an idea. No soldering is required so it is easy to change connections and replace components. Parts will not be damaged so they will be available to reuse afterwards. The photograph shows Breadboards have many tiny sockets (called 'holes') arranged on a 0.1" grid. The leads of most components can be pushed straight into the holes. ICs are inserted across the central gap with their notch or dot to the left. Wire links can be made with single-core plastic-coated wire of 0.6mm diameter (the standard size). Stranded wire is not suitable because it will crumple when pushed into a hole and it may damage the board if strands break off. Converting a circuit diagram to a breadboard layout is not straightforward because the arrangement of components on breadboard will look quite different from the circuit diagram. When putting parts on breadboard you must concentrate on their connections, not their positions on the circuit diagram. The IC (chip) is a good starting point so place it in the centre of the breadboard and work round it pin by pin, putting in all the connections and components for each pin in turn.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 20

ATMEL INTEGRATED DEVELOPEMENT BOARD

Hardware Design PCB Design


To design the circuit board following material are used. They are:

Express PCB software PCB Plate Screen Printing


Etching of PCB with FeCl3

Thinner and Spreading of Soldering wire Drilling Soldering Express PCB Software
This is software to design the circuit layout of our project. This software is divided in two part to design the layout

Express SCH
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 21

ATMEL INTEGRATED DEVELOPEMENT BOARD

Express PCB

Express SCH
In this part firstly we select all the components through the component manager and systematically join the component by the virtual wire according to the circuit diagram. Then we check the schematic for the netlist errors. when all the errors are corrected the schematic is ready.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 22

ATMEL INTEGRATED DEVELOPEMENT BOARD

Express PCB
After the schematic of the circuit diagram it is link to the EXPRESS PCB for ease of joining the circuit components according to their pin numbers. We repeat the process to select the components and their connections same as in Express SCH. The connections are based on colors shown in the figure. Green is used for the bottom copper layer; Red for the top copper layer and Yellow is for the components indication.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 23

ATMEL INTEGRATED DEVELOPEMENT BOARD

PCB Plate:
We take PCB plate of size 1515 cm2 and clean it by HARPIC cleaner to remove the oxide over the copper layer. Now the plate is ready for the screen printing of the Circuit layout.

Screen Printing:
The print of the above circuit diagram is taken out on a Butter paper for its screen printing on the PCB plate. Nylon bolting cloth (Silk screen cloth) is stretched and attached to a wooden frame. Photosensitive chemical (silcot-6) and ammonium bicarbonate is spread on cloth and dried in total darkness. The screen is exposed to UV light and is developed in water.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 24

ATMEL INTEGRATED DEVELOPEMENT BOARD

Etching of PCB with FeCl3


There are many alternatives for etching liquids, and you can use the one that suits your taste. We use ferric chloride (the brown stuff): its cheap, can be reused many times, and doesnt require heating. Actually, moderate heating can speed up etching, but I find it reasonably fast also at room temperature (1015 minutes).
For etching, we place the container on the floor (some scrap cardboard or newspaper to protect the floor from drops). We fit the board and submerge the PCB.

After Etching
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 25

ATMEL INTEGRATED DEVELOPEMENT BOARD

Thinner and Spreading of Soldering wire


A few drops of thinner (nail polish remover works well) on a pinch of cotton wool will remove completely the toner, bringing back the copper surface. Rinse carefully and dry with a clean cloth or kitchen paper. Trim to final size and refine edges with sandpaper.

Drilling
We use the electric drill and hand drill to drill the holes of the components on the PCB plate Under this operation drilling should be done as per circuit lay with the suitable drill and high speed machine. Drilling should always be done from copper side to avoid possibility of coming out of copper circuit and chipping out of Bakelite.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 26

ATMEL INTEGRATED DEVELOPEMENT BOARD

COMPONENT ASSEMBLES:
From the greatest variety of electronic components available today, which runs into tent of thousands of different types it is often a perplexing task to know which the right task for a given job is. There should be damage such as hair line crack intuit opera on PCB that could age a seriousfiec on the operational ability to the completed assemble. If there are than they can and should be repaired fiesta bye soldering a short link of bare copper wire over the affected part. Next will probably be the resistor small signal diodes of other similar size components some capacitor are very small but it would be best to fit these after words when fitting each group of components marks of each one on the components its as it is fitted and if we have to leave the job we know where to recommence. Although transistor & integrated circuit are small items there are good reasons for leaving the soldering of these until the last step the main pint is that these components are sensitive to heart and is subjected to prolonged application to the soldering iron they could be internally damaged. All the components before mounting are rubbed with sandpaper so that oxide layer is removed from their tips. Now they are mounted according to the components layout.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 27

ATMEL INTEGRATED DEVELOPEMENT BOARD

Soldering
After drilling the holes, the components are fitted on the PCBs through soldering A soldered connection ensures metal continuity. The soldering process involves: Melting of the flux which in turn removes the oxide films on the metal to be soldered. Melting the solder which removes the impurities. The solder partially dissolve of the metal in the connection. The solder cools and fuses wit the metal. The soldering techniques involves knowledge of : Soldering iron Soldering wire Soldering procedure Replacing components

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 28

ATMEL INTEGRATED DEVELOPEMENT BOARD

Construction
For the making the Integrated Development Board it is divide in the following module according to the individual task. The modules are: Power Supply Module Microcontroller Module Programmer Module STK200/300 JTAG SI Prog. Input and Output Module Push Switch LED panel External I/O Connector 7 Segments
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 29

ATMEL INTEGRATED DEVELOPEMENT BOARD Stepper Motor Control

Power Supply Module


In this module we design the power supply for the Microcontroller and Stepper motor controller and whole other module of the Development Board for the power supply the AC supply convert to the DC through the adapter. In the adepter the step down transformer are use to step down the voltage 230 V AC to 9 V AC the simple PN diode 1N14001 are use to rectify the current. The LM7805 are use to regulated the voltage this IC are use controlled the input 9Volt and provide the 5 volt constant out for the other next Circuit. In the voltage regulator the three capacitor are used between the input (pin1) and ground (pin2) and anather two are placed between the output(pin3) and ground(pin2)these capacitor are use to protect the circuit and LM7805 the simple pn junction diode 1N4001 are also use to protect the LM7805 voltage regulator

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 30

ATMEL INTEGRATED DEVELOPEMENT BOARD

Microcontroller Module
The Microcontroller module are the main circuit of the Integrated Development board this have a 40 pin DPI socket for the installing and removing the microcontroller after the processing on it the microcontroller module circuit are have four 8 pin I/O ports (SIP PIN), A six-pin header allows flash memory programming from an STK500 or Atmel Dragon. A

single 36 connection SIP machine-pin plug could be used to attach to another board or to a solder less breadboard. All 32 port pins, plus Vcc, Aref and ground, are available. The 16 MHz Crystal Oscillator is use to provide the clock pulse to microcontroller, 895

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 31

ATMEL INTEGRATED DEVELOPEMENT BOARD

Programmer Module STK200/300 JTAG


Atmels AVR microcontroller chips are in-system programmable (ISP), i.e. these can be programmed directly in the target circuit. A special programmer software is used to download the program from the PC into the AVRs flash memory. Atmel offers a software package called the Atmel AVR ISP that allows programming of the AVR microcontrollers in the circuit using a simple dongle. Adongle is nothing but an adaptor cable that connects the PCs parallel port with the ISP pins of the AVR chip for programming. For programming, the four lines required from the AVR chip to the ISP adaptor (dongle) are: 1. MOSI (Master Out, Slave In): Data being transmitted to the AVR being programmed is sent on this pin2. MISO (Master In, Slave Out): Data received from the AVR being programmed is sent on this pin 3. SCK (Shift Clock): Serial clock generated by the programmer from the PC.4. RST (Reset): Reset (low pulse) generated by the program. The AVR is programmed while in reset state. Heres a dongle circuit for in-system programming of Atmels AVR chip AT90S8515 using such
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 32

ATMEL INTEGRATED DEVELOPEMENT BOARD software packages as Atmel ISP 2.65 and PonyProg2000. Though not exactly the same, a similar dongle circuit can be found at the Website www.iready.org/ projects/uinternet/ispdongle.pdf. The PCs parallel-port pins 4 and 5 drive buffer IC 74LS244 by enabling its pins 19 and 1, respectively. A low pulse on these pins will allow the passing of the serial clock and data during programming. MOSI, LED, SCK and RST outputs are buffered from the parallel ports pins 7, 8, 6 and 9, respectively. The MISO input from the AVR is fed into pin 10 of the parallel port. IC 74LS244 (IC1) acts as a buffer as well as an isolator circuit when the AVR is not in programming mode. In idle mode, all the outputs are tristated so as not to affect the operation of the target system. When the AVRs ISP mode is selected, the lower half of IC 74LS244 is enabled, pulling the target systems Reset line low. Once the target system is in Reset mode, the SCK, MISO and MOSI lines are no longer loaded by the peripheral circuitry, if any, on the target system. Now, it is safe to enable the upper half of 74LS244, driving the MOSI, LED and SCK lines of the dongle. The RST pin becomes high after the AVR is programmed. Glowing of LED2 indicates that the AVR is in programming mode. There are two standard connectors for in-system programming of Atmel AVR microcontroller. One is the 10pin header (dual-in-line (DIL) connector)) used on the Atmel STK kits. The other is a 6-pin header (DIL connector) used in Atmel ISPs. The two loopback connections, pin 2-to-pin 12 and pin 3-to-pin 11 of the parallel port, are used to identify the dongle. With only pin 2-to-pin 12 link, the dongle is called STK300 or AVR ISP dongle. With only pin 3-to-pin 11 link, the dongle is called STK200 or old Kanda ISP dongle. With both links in place, the dongle is identified as a valueadded pack dongle. Here, weve used an 8-pin single-inline (SIL) connector and an additional 6-pin SIL connector for the Atmel programmer circuit. With the buffer and the 40-pin ZIF socket in this circuit, it can beused as a standalone programmer. The 6-pin SIL male connector is used for connection between the dongle and the AVR on the target board. Thus, another 6-line cable of about 30cm length is required for connecting this ISP adaptor (dongle) to the target circuit. If the AVR is not on the target circuit, you can insert the AVR into the ZIF socket and program it. Regulated 5V DC is required for the AVR and the associated dongle circuit, whose terminals are also provided in connector CON4. LED1 is used as the power indicator for the circuit.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 33

ATMEL INTEGRATED DEVELOPEMENT BOARD

SI PROG This simple AVR Programmer will allow you to painlessly transfer hex programs to most ATMEL AVR microcontrollers without sacrificing your budget and time. It is more reliable than most other simple AVR programmers available out there and can be built in very short amount of time. AVR programmer consists of in-circuit serial programmer (dongle) and small pcb with a DIP socket where can fit microcontroller and have it quickly programmed. You may also use this programmer as a stand alone in-circuit serial programmer that can be used to conveniently program AVR microcontrollers without removing them from the target circuit. Entire AVR programmer has been build with using common parts and fits in the case of the serial connector. The socket pcb has been created to fit a 28-DIP AVR
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 34

ATMEL INTEGRATED DEVELOPEMENT BOARD ATmega8 microcontroller, but you can build a socket pcb for any other AVR microcontroller out there. This AVR programmer is compatible with a popular PonyProg software that shows you a status bar of the programming progress.

Input and Output Module Push Switch


It is design to provide manually inverting and non-inverting input to the microcontroller, in that the three pin connector for controlled inverting and non inverting input the push switch are use to instantly controlled

LED panel
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 35

ATMEL INTEGRATED DEVELOPEMENT BOARD LED panel are use to check the output of the microcontroller. in its design 8 LED are connected in parallel the two 8 pin input port are use to interchange the input sequence in inverting and non-inverting mode. To change the configuration jumper are use

External I/O Connector


The 8 pin socket are use to connect the external input directly are connect to the microcontroller through 8 pin SIP

7 Segments

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 36

ATMEL INTEGRATED DEVELOPEMENT BOARD This 7 segment display works in two ways. one is inverting and other is noninverting which is controlled through the jumpers. the 74LS47 BCD to 7 SEGEMENT DECODER/ DRIVER are used to controlled the 7 segment display. Two 5 pin socket are use to change the 7segement or connect to externals 7segement

Stepper Motor Control


L298 are use to controlled the Bipolar Stepper motor are which is connected to the microcontroller through the 6 SIP pins. The L298 require extra 5 volt supply for drive the motor so use one LM7805 voltage regulator the general 1N4001 diode are use to maintain the voltage across the motor. The Stepper Motors are an alternative to DC motors. They offer something that DC motors don't, reliability. Their movement can be closely tracked by keeping count of how many times you step the motor. Each step is correlated to an angle of movement. The stepping angle depends on the motor but some are very precise, this is probably why stepper motors were used in early computer disc

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 37

ATMEL INTEGRATED DEVELOPEMENT BOARD drives.

Software Tool
Avr software tools are use to program the microcontroller through the serial and parallel communication ports AVR Studio Code Vision
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 38

ATMEL INTEGRATED DEVELOPEMENT BOARD PonyProg2000

The software design for our system was implemented using a modular approach on both the ports of the system because of its efficiency and ease of implementation. However, we implemented 2 kinds of execution synchronizations on either side of the system. The ports of the system were synchronized using time counters. Each module in the Board executed after a predetermined specific interval of time using a base clock as a reference (that was implemented using a timer). The other port of the system completely asynchronously and its execution was dependent on the type of the software tools are use with particular microcontroller. The following paragraphs provide a brief description of the various software modules that were implemented on both the sides of the system.

AVR Studio
AVR Studio 4 is a professional Integrated Development Environment (IDE) for writing and debugging AVR applications in Windows 9x/NT/2000/XP environments. This tutorial assumes that you have installed AVR Studio 4 on your computer. If you do
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 39

ATMEL INTEGRATED DEVELOPEMENT BOARD not have AVR Studio yet, you may obtain a copy of AVR Studio 4 from one of 3 places: Atmel Corporation: http://www.atmel.com AVR Freaks: http://www.avrfreaks.net Borrow a CD from your instructor This tutorial will guide you through the steps required for: Executing the AVR Studio 4 Integrated Development Environment (IDE), Typing in a program, Assembling the program, and Simulating a program The first program you will enter is shown below (Figure 1). This program will initialize the B and D ports on the ATMega128 AVR processor and then turn on a single LED connected to Port B, pin 0. ;======================================================== ;Project #1 ;Written by: Steve Kuyath ;Date: 5/21/2007 ;ver: 1.0 ;file: C:\Documents and Settings\Stephen Kuyath\My Documents\AVR\Pr1 ;Device: ATMega128 ;======================================================== .nolist .include .list ;=========================== ; Declarations .def temp =r16 ;=========================== ; Start Program rjmp Init
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

"C:\Program

Files\Atmel\AVR

Tools\AvrAssembler2\Appnotes\m128def.inc"

Page 40

ATMEL INTEGRATED DEVELOPEMENT BOARD ;============================ Init: ser temp out DDRB,temp out DDRD,temp clr temp out PortB,temp out PortD,temp ;============================ Start: sbi PortB,0 cbi PortB,0 rjmp Start Figure 1: LED On Program AVR Studio Assembler/Simulator Tutorial Step 1: Open AVR Studio 4 IDE. You should see the program banner shown below:

AVR Studio 4 Banner

Step 2: When IDE opens, you will see the programming and simulator environment as well as a requesting information: are you starting a new project or opening a saved project?
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 41

ATMEL INTEGRATED DEVELOPEMENT BOARD AVR Studio IDE

Step 3: Click on the New Project button:

Welcome Dialog Box AVR Studio Assembler/Simulator Tutorial Step 4: In the next dialog box, choose the Atmel AVR Assembler as the project type:
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 42

ATMEL INTEGRATED DEVELOPEMENT BOARD

Choose Atmel AVR Assembler Step 5: Type in a project name and the initial file name:

Type Project and Initial File Names Step 6: Click on the Next button
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 43

ATMEL INTEGRATED DEVELOPEMENT BOARD Step 7: Choose AVR Simulator for the Debug Platform and then scroll down the right window to choose the ATmega128 AVR processor

Choose Simulator and ATmega128 Step 8: Click on the Finish button. You should then see the IDE (you may have to maximize the editing window to see the same thing as shown in Figure) AVR Studio 4 IDE AVR Studio Assembler/Simulator Tutorial

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 44

ATMEL INTEGRATED DEVELOPEMENT BOARD Step 9: Type in the program as shown in Figure 1. Note the color-coded text. This is done automatically by the IDE and helps you to make corrections as you go.

Typed Program Step 10: When you have completed the program save it. It is also good practice to periodically save your program as you type. Step 11: Assemble your program. You may do this by selecting Build from the Build Menu or by striking the [F7] key:

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 45

ATMEL INTEGRATED DEVELOPEMENT BOARD Program Assembled Step 12: Continue assembling and correcting errors until the program assembles without error (note the green dot in the lower window and the comment that states: Assembly complete, 0 errors, 0 warnings) you are ready to simulate. Step 13: Simulate the program. To start the simulator you may choose Start Debugging from the Debug Menu or you may click on the arrow button as shown below:

Start Simulation Step 14: In the I/O View, open the I/O ATMEGA128, and the PortB views by clicking on the symbol.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 46

ATMEL INTEGRATED DEVELOPEMENT BOARD

I/O Views Step 15: Single step through your program by striking the [F11] key:

FF sent to Data Direction Register B (all pins outputs)

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 47

ATMEL INTEGRATED DEVELOPEMENT BOARD

bit 0 set Note: The sbi PortB,0 (sbi is the set bit) instruction has been executed, although the pointer is pointing at the next instruction. So, bit 0 in PortB is set (equal to 1). It is important to note 2 things: 1. Pin 0 (PinB0) on PortB has not gone high yet, even though bit 0 in PortB is set. PinB0 will go high as the next instruction is executed 2. The instruction: cbi PortB,0 has not been executed yet. Step 16: Continue stepping through the program until you are sure that the program is executing as designed. Note: The next few screens may be a little confusing because the program sets bit 0 in PortB and then immediately clears bit 0 in PortB. The simulators shows this, but shows that bit 0 on PinB (the actual pin on the Atmega128) is one cycle behind bit 0 in PortB:

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 48

ATMEL INTEGRATED DEVELOPEMENT BOARD

PinB0 is high

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 49

ATMEL INTEGRATED DEVELOPEMENT BOARD


PinB0 is low

Code Vision Introduction


The purpose of this application note is to guide the user through the preparation of an example C program using the CodeVisionAVR C Compiler. The example, which is the subject of this application note, is a simple program for the Atmel Atmega32 microcontroller on the STK200 starter kit.

Preparation
Install the CodeVisionAVR C Compiler in the default directory (C:\cvavr), and the Atmel AVR Studio debugger in the default directory (C:\Program Files\Atmel\AVRTools\AVR Studio4). Set up the starter kit according to the instructions in the STK500 User Guide. Make sure that the power is off before inserting the ATmega8515 chip into the
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 50

ATMEL INTEGRATED DEVELOPEMENT BOARD appropriate socket (marked SCKT3000D3). Set the VTARGET, RESET, and XTAL1 jumpers. Also, set the OSCSEL jumper between pins 1 and 2. Connect one 10-pin ribbon cable between the PORTB and LEDs headers to allow for the state of ATmega8515s PORTB outputs to be displayed. Then connect one 6-pin ribbon cable between the ISP6PIN and SPROG3 headers. This will allow the CodeVisionAVR IDE to automatically program the AVR chip after a successful compilation, if the programmer is correctly configured. To configure the programmer, start the CodeVisionAVR IDE and select the SettingsProgrammer menu option. The dialog window shown in Figure 2-1 will open. Programmer Settings.

Set the AVR Chip Programmer Type to Atmel STK200/AVRISP, and the Communication Port to the one used with the STK200 starter kit on your system. In order to be able to invoke the AVR Studio debugger from within the Code Vision AVR IDE, the location of AVR Studio must be set. To do this, select the Settings Debugger menu option. The dialog window as shown in Figure 2-2 will open. Debugger Settings.

Select C:\Program Files\Atmel\AVRTools\AVR Studio4\AvrStudio.exe using the button, then press the OK button to confirm. Creating a New Project
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 51

ATMEL INTEGRATED DEVELOPEMENT BOARD In order to create a new project, select the FileNew menu option or press the toolbar button. The dialog window shown in Figure will be displayed. New Project Dialog.

Select Project, press OK, and the dialog window shown in Figure 3-2 will be displayed. Confirmation Dialog.

Press Yes to use the CodeWizardAVR Automatic Program Generator, and the dialog window shown in Figure will open. Using the CodeWizardAVR Automatic Program Generator The CodeWizardAVR simplifies the task of writing start-up code for different AVR microcontrollers. Configuring the Chip and Clock Settings For this example project, we shall use the Atmega32 microcontroller and the clock rate 16 MHz, since that is the clock rate on the STK200 starter kit. The resulting settings window is shown in Figure
Chip Settings for Code Wizard AVR

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 52

ATMEL INTEGRATED DEVELOPEMENT BOARD

Configuring the Input/output Ports Select the Ports tab to determine how the I/O ports are to be initialized for the target system. The default setting is to have the ports for all the target systems set as inputs (Data Direction bits to be all 1s) in their Tri-state mode. However, for this example project, we want to set Port B (by selecting the Port B tab) to be output only. This is done by setting all the Data Direction bits to Out (by clicking on them). We also set the Output Values to be all 1s, which will cause the LEDs on the STK500 to initially be turned off. The resulting settings window is shown in Figure 5-1. Port Settings for CodeWizardAVR.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 53

ATMEL INTEGRATED DEVELOPEMENT BOARD

Configuring Timer1
Select the Timers tab to set up the behaviour of the timers. For this project, we want to configure Timer1 to generate overflow interrupts as shown in Figure. We have selected a clock rate of 3.594 kHz, which is the system clock of 3.68 MHz divided by 1024. The timer is set to operate in the default Normal Top=FFFFh mode and to generate interrupts on overflow. To be able to update the LEDs twice per second, we need to reinitialize the Timer1 value to 0x10000-(3594/2) = 0xF8FB on every overflow. Timer Settings for CodeWizardAVR.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 54

ATMEL INTEGRATED DEVELOPEMENT BOARD

Completing the Project


By selecting the File Generate, Save and Exit menu option, the CodeWizardAVR will generate a skeleton C program with, in this case, Port B and Timer1 Overflow Interrupt set up correctly. A dialog window for saving the source code, shown in Figure , will then open. Save Source File Dialog.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 55

ATMEL INTEGRATED DEVELOPEMENT BOARD

Create a new folder named C:\cvavr\led to hold all the files of our sample project. Open this directory, enter the file name of the C source file, led.c, and press the Save button. A dialog window for saving the project file, shown in Figure 7-2, will open.

Save Project Dialog. Here, specify the file name for the project, led.prj, and save it in the same folder as the C file (C:\cvavr\led). Finally, we will be prompted to save the CodeWizardAVR project file, as shown in Figure 7-3. Saving all the CodeWizardAVR peripherals configuration in the led.cwp project file will allow us to reuse some of our initialization code in future projects.
Save CodeWizardAVR Project

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 56

ATMEL INTEGRATED DEVELOPEMENT BOARD

Save CodeWizardAVR Project Dialog.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 57

ATMEL INTEGRATED DEVELOPEMENT BOARD

Specify the file name led.cwp and press the Save button. The led.c source file will now automatically be opened, and we may start editing the code produced by the CodeWizardAVR. In this example project, only the interrupt handler code needs to be amended to manage the LEDs. This is shown below. The small bit of code that was added is shown with bold font, while the remainder was supplied by the CodeWizardAVR. // the LED 0 on PORTB will be ON unsigned char led_status=0xFE; // Timer 1 overflow interrupt service routine interrupt [TIM1_OVF] void

timer1_ovf_isr(void) { // Reinitialize Timer 1 value TCNT1H=0xF8; TCNT1L=0xFB; // Place your code here // move the LED led_status<<=1; led_status|=1; if (led_status==0xFF) led_status=0xFE; // turn ON the appropriate LED PORTB=led_status; }

Viewing or Modifying the Project Configuration


DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 58

ATMEL INTEGRATED DEVELOPEMENT BOARD At any time, the project configuration may be changed using the ProjectConfigure menu option or by pressing the the dialog window shown in Figure. Project Input Files Configuration Tab. toolbar button. This will open

To add or remove files from the project, select the Files tab and click the Add button, or select a file in the project file tree and click the Remove button. If you wish to rename a file in the project, select it in the project file tree and press the Edit File Name button. Project Output Directories Configuration Tab.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 59

ATMEL INTEGRATED DEVELOPEMENT BOARD

The Output Directories tab, shown in Figure 8-2, allows you to specify in which directories the compiler shall place the files resulting from the Build process. With these default settings, the executable for this example project, led.hex, will be located in the directory C:\cvavr\led\Exe after a successful build.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 60

ATMEL INTEGRATED DEVELOPEMENT BOARD Project C Compiler Configuration Tab.

To change the target microcontroller, the clock rate or the various compiler options select the C Compiler tab. The dialog window shown in Figure 8-3 opens, and the configuration may be altered.
Project After Build Configuration Tab.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 61

ATMEL INTEGRATED DEVELOPEMENT BOARD

On the After Build tab, shown in Figure 8-4, various actions to be taken after the Build process has completed, may be selected. For the purposes of this example, the Program the Chip option must be checked to enable automatic programming of the AVR chip. It is important to set the SCK Freq. value to 230400 Hz, so that ATmega8515 chips that come from the factory with the CKSEL3..0 fuse bits set to use the internal 1MHz oscillator, can be successfully programmed. Please note that the CKSEL3..0 fuse bits will be set to 1111 so that the external 3.68 MHz clock, supplied by the STK500, will be used. (The CKSEL3..0=0 checkboxes should not be checked, or the fuse bits will be programmed to 0.)

Building the Project


The Project pull-down menu has the Build option. Click on it or on the button on the toolbar. When this process is completed, the Information window, shown in Figure 9-1, will be displayed. Information Window, Compiler Tab.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 62

ATMEL INTEGRATED DEVELOPEMENT BOARD

This window shows the RAM, EEPROM and FLASH memory usage. Information Window, Assembler Tab.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 63

ATMEL INTEGRATED DEVELOPEMENT BOARD

If the Assembler tab is clicked, the assembly results are displayed as shown in Figure

Information Window, Programmer Tab.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 64

ATMEL INTEGRATED DEVELOPEMENT BOARD

Selecting the Programmer tab displays the value of the Chip Programming Counter, as shown in Figure 9-3. Pressing the Set Counter button will initialize this counter. If the Build process was successful, power-up the STK500 starter kit and press the Program the chip button to start the automatic chip programming. After the programming process is complete, the code will start to execute in the target microcontroller on the STK500 starter kit.

Pony Prog
To be able to send hex file from your computer to AVR microcontroller you will need to download and installPonyProg2000. After the installation, the first thing you will need to do is configure PonyProg to work with our AVR Programmer. To do this go to "Setup" menu and select "Interface Setup". The following window will be shown and highlighted areas show you exactly which options should be selected.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 65

ATMEL INTEGRATED DEVELOPEMENT BOARD

In the next step select "AVR micro" and your microcontroller type that you will be programming (ex. ATmega8).

At this point PonyProg configuration is complete and we can open hex program with which AVR microcontroller will be flashed. Go to "File" menu, select "Open Program (FLASH) File ...", and point to the hex file to open it up. You should see hex numbers as shown on the screen below. If you haven't connected AVR Programmer dongle to your computer's serial port yet, then now is the time. Make sure that AVR
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 66

ATMEL INTEGRATED DEVELOPEMENT BOARD Programmer is physically connected to your AVR microcontroller through Socket PCB or through ICSP 6-PIN connector. Finally click on the highlighted icon "Write Program Memory (FLASH)", or go to "Command" menu and select "Write Program (FLASH)".

Click on "Yes" button to confirm the programming.

Now sit tight, relax and watch the programming progress on the status bar. PonyProg will program AVR microcontroller and verify if the hex file was transferred without any errors. For your information this process shouldn't really take more than 10 to 30 seconds. This depends on the size of the program that you're trying to flash.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 67

ATMEL INTEGRATED DEVELOPEMENT BOARD

After programming is completed "Write successful" window will be shown letting you know that AVR microcontroller has been programmed, and is now ready to be used.

Sample Programs LED Blinking Program in C


#include<avr/io.h>
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 68

ATMEL INTEGRATED DEVELOPEMENT BOARD #include<avr/delay.h> int main() { unsigned char i,j; DDRB = 0xFF; while (1) { j=1; for (i=0;i<8;i++) { PORTB = j; _delay_ms(100); j = j*2; } } return(1); } Stepper Motor Program in Assembly Language 1 $MOD51 0000 2 ORG 0000H 0000 E580 3 MOV A, P0 0002 33 4 RLC A
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 69

ATMEL INTEGRATED DEVELOPEMENT BOARD 0003 500B 5 JNC P12 6 0005 7FCA 7 MOV R7, #0CAH; 0007 7433 8 MOV A, #033H; 0009 F5A0 9 P13: MOV P2, A; 000B 23 10 RL A; 000C 111B 11 ACALL DELAY 000E DFF9 12 DJNZ R7, P13 13 0010 7FCA 14 P12: MOV R7, #0CAH; 0012 7433 15 MOV A, #033H; 0014 F5A0 16 P11: MOV P2, A; 0016 03 17 RR A; 0017 111B 18 ACALL DELAY 0019 DFF9 19 DJNZ R7, P11 20 21 001B 758910 22 DELAY: MOV TMOD, #10H 001E 7B05 23 MOV R3, #05 0020 758B08 24 Z: MOV TL1, #8D 0023 758D01 25 MOV TH1, #1D 0026 D28E 26 SETB TR1 0028 308FFD 27 BACK: JNB TF1, BACK 28 002B C28E 29 CLR TR1 002D C28F 30 CLR TF1 002F DBEF 31 DJNZ R3, Z 0031 22 32 RET 33 END

Results
Testing Test Results
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 70

ATMEL INTEGRATED DEVELOPEMENT BOARD Accuracy Safety Usability

Testing
We extensive tested the software and hardware according to the programs needed by the user based on user application and requirement of the work. We performed various tests on the Development board; some of these tests are as follows: The proper continuity is checked, voltage and current supply in the board. The microcontroller is burn through the DB9 and DB25 Ports to test the working performance of the programmer interface. The blinking LED program is run to check the LED panel. The BCD code is generated to run the 7 segment display. The manually controlled program for testing the inverting and non-inverting input from the push switch is made. The stepper motor program is designed to check the clock wise and counter clock wise rotation. Other hardware tests were also conducted to test the strength of the connections of the wires and to check the possibility of getting injured by the extensive hardware that a person has to carry during the demonstration. Bread board is used also for the extra circuits for testing and programming different pin configuration Microcontroller

Test Results
The circuit made for the communication part DB-9 and DB-25 when interfaced with the microcontroller to burn the software made for it burn successfully. The result of the tests conducted above turned out to be quite satisfying. The LED program runs
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 71

ATMEL INTEGRATED DEVELOPEMENT BOARD accordingly in the desired behave. In Inverting mode the 7LEDs out of 8 blinks while the rest 1 is off. On the other hand, in Non-inverting mode reverse or vice-versa phenomena is performed. After some modification in the blinking LED program we see that In Non-inverting mode the LED only blink when the push button is pressed, from which +5 V supply is triggered. In this case 7 out of 8 is off while the rest 1 is blinked. To run a seven-segment display a BCD counter program is run which resulted in the digital display of numerical digit from 0 - 9. This is actually a programmer board and hence we burn the microcontroller through the DB9 and DB25 Ports to test the working performance of the programmer interface. The stepper motor program is checked in the clock wise and counters clock wise rotation. The rotation of motor is 7.5 degree step.

Accuracy
High accuracy was not a major issue in this project. But we get the satisfy results from it and it is complete whole requirements. The for better baud rate the serial
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 72

ATMEL INTEGRATED DEVELOPEMENT BOARD and parallel port are directly connected to the serial or parallel port of the computer it give the best performance by that. If the any other kind of the converter like USB to serial or USB to parallel are use the speed of the burning process of microcontroller are become slow. The cable connect between the port make to shore are properly connected according to the pin configuration except it do not show the proper result of operation

Safety
Safety is a major issue in this project because this project was designed with the intention that anyone could use it. During the etching process ware the globes for the safety Soldering is the most difficult task during the project be alert on the soldering because the track of the PCB are very thin and near to each other. Besides this, there is not much to be concerned with safety-wise. We made sure to tape all of the wires and have them come out in a taped strand to make the wiring as clean and safe as possible. Also, all of the electrical components other than batteries, which have to be frequently replaced, were kept inside a wooden case so that the user could not come in contact with any of the circuitry, making it very safe. The only problem with the plastic case design is that we had to have the L298 with attached homemade heat sink protruding from the top because it gets too hot to be contained in the case. Also, it would probably melt some of our circuitry if we kept it inside. This is another safety hazard which should be fixed in subsequent designs, most likely with a heat sink that would not cut someone. the ole circuit are work on the 0 to 9 volt so there is no any major issues of electric shock.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 73

ATMEL INTEGRATED DEVELOPEMENT BOARD

Usability
Usability is the high point of this project. This project was designed primarily for the multiple implementation or programs. We wanted to create a project specifically for people with special needs. The intention of this project was to be usable by anyone with minimal training if at all. The user should be able to create the own project and perform the good testing of programs and circuitry.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 74

ATMEL INTEGRATED DEVELOPEMENT BOARD

Conclusions
Design Analysis Applicable Standards IP Considerations Future Enhancement Advantage Disadvantage

Design Analysis
The final design met and exceeded all of the expectations that were laid out before starting to construction of this project. The whole goal was to be able to designing and testing is make to simple without any major circuitry problem.

Applicable Standards
The only standard that we used in the project is the RS-232-C defined by the Electronics Industries Association (EIA) for RS-232 communication with between the programmer and computer. We didnt implement this standard ourselves but merely used the UART which already utilizes this standard.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 75

ATMEL INTEGRATED DEVELOPEMENT BOARD

Intellectual Property Considerations


This project was based on an idea formulated on the major training on the Embedded system in the CRISP BHOPAL. Creating a unique design of our own and thus no intellectual property rights were infringed upon. We do not believe that this project brings to light any patent opportunities because it is far too bulky and awkward with the programming and burning process of microcontroller. This topic could be discussed on a serious level if this project was taken a step further and redesigned. There are most likely publishing opportunities for this project because it is a very interesting idea and the fact that the final product works so well. Another topic where we had to consider intellectual property was during the use of the programming through the PC by Mrs. Asha nayar. We credit her with coming up with the Thus, we used her intellectual property and modified it to execute efficiently on the ATMega32.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 76

ATMEL INTEGRATED DEVELOPEMENT BOARD

Future Enhancements The notebook computer dont have serial and parallel port so create the USB programmer. The surface mounting devices are use for the make whole board compact and efficient. Multiple Microcontrollers programmers for the different microcontrollers. Design and attach the LED matrix panel on the board.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 77

ATMEL INTEGRATED DEVELOPEMENT BOARD

Advantages
Capability of testing multiple devices. Supports two IDE Software TOOLS (AVR Studio,Code Vision). Have two Connector Ports(DB 9,DB 25) in case if anyone gets disrupted. Whole board are used for the working implementation Inverting and non-inverting input are change easily through the jumper setting. More power supply slot are available for extra 9volt and 5 volt supply. Bread board are use to direct testing the component without any permanent connection

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 78

ATMEL INTEGRATED DEVELOPEMENT BOARD

Disadvantages Changing setting of jumper setting for Inverting and non-inverting input/output. Serial and Parallel port take more space as compare to USB port. Serial port programmer burn microcontroller through ponyprog2000 by only HEX file so unnecessary west of time. Due to the time to time changing the microcontroller, microcontroller socket is loose

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 79

ATMEL INTEGRATED DEVELOPEMENT BOARD

Appendix
Task Allocations Parts List References Project Pictures

Task Allocations Software: Design the testing programs Priyanka Saxena, M.Swati Testing and interfacing with microcontroller Kumar Manish, Pukhraj Titre Schematic design of board M.Swati, Pukhraj Titre Hardware: PCB layout Design All Members Logical Structure All Members Soldered Microcontroller boards All Members Constructed box, mounted motors and wired it all up All Members Mounted hardware in wooden box and wired it Kumar Manish Made belt, vibrating motor casings M.Swati RF Hardware Pukhraj Titre Hardware Testing All Members

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 80

ATMEL INTEGRATED DEVELOPEMENT BOARD

Budget and Parts List


The following is the parts list, detailing the parts that we used in our project. We are very grateful for the generous contribution of Maxbotix of providing us with a sample of their Ultrasonic Range Finder. Without their help, we would not have been able to complete our project, incorporating the extra features, and remain under budget.

Parts List:
Part Name Microcontroller Dual full bridge driver BCD TO 7-Segment Decoder/Driver Octal Bus Buffer Voltage Regulator Crystal Oscillator 7 Segment display Serial connector Parallel Adapter Stepper Motor Resistors Diode Capacitor P C B plate DIP socket Header Pins Fiber sheet Wire Push switch Nut & bolt Molex connector Wooden box Manufacturer Atmel ST Atmel ST Part Number Atmega32 L298 SN74LS47 74HC244 LM7805 16MHz LT542 DB 9 DB 25 9V - DC Qty 1 1 2 1 2 1 2 1 1 1 1 14 10 8 2 6 40 2 1m 2 12 8 1 Unit Price 220 60 45 30 20 45 20 30 35 80 150 20 10 30 20 5 0.15 80 30 10 1 5 300 Cost 220 60 90 30 40 45 40 30 35 80 150 20 10 30 20 30 6 160 30 20 12 40 300

Tyco Elec Tyco Elec HEC NMB MAT

References
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 81

ATMEL INTEGRATED DEVELOPEMENT BOARD

Books
Robot Building for Beginner Embedded system Design with the Atmel AVR Microcontroller Electronics for you Feb 2006

Data sheets
L298HN Full Bridge 74LS74 74HC244 LM7805 Atmel Mega32 Microcontroller L289HN (Dual Full Bridge)

Sites
www.atmel.com www.stmicroelectronics.com www.texasinstruments.com www.Digikey.com www.google.com/books

Local Reference
CRISP Bhopal Embby Logic, Bhopal

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING R.K.D.F. COLLEGE OF ENGINEERING, BHOPAL

Page 82

S-ar putea să vă placă și