Nguyen_Atmel_Microcontroller.pdf

(2039 KB) Pobierz
Atmel Microcontroller in Data Acquisition and 
Device Control
Nathan Nguyen (nhnguyen2997@eagle.fgcu.edu)                  
An Nguyen (avnguyen@eagle.fgcu.edu)                           
Professor: Dr. Janusz Zalewski
FLORIDA GULF COAST UNIVERSITY
3213 CEN EMBEDDED SYSTEMS PROGRAMMING
April 19, 2013
Atmel Microcontroller in Data Acquisition and Device Control| 4/19/2013
1
Table of Contents
Section 1: Introduction
Section 2: Problem Specification
Section 3: Solution
Section 4: Implementation
Section 5: Experimental Testing
Section 6: Conclusion
Section 7: References
Appendix
Atmel Microcontroller in Data Acquisition and Device Control | 4/19/2013
2
6
12
15
x
x
x
x
1
1. Introduction
1.1 Project Overview
Microcontrollers exist in every part of the world. Having components of a processor, memory, and
peripherals with the ability of providing real time response to physical events (basically a microcomputer),
they are mainly used as an embedded system. They are embedded in several types of machinery, including
automobiles, telephones, appliances (kitchen or basic calculator), and peripherals for computer systems.
The purpose of this project is to extend on the previous projects by previous students. In the previous
projects, they have calibrated the temperature sensor into the microcontroller and the STK500 sent a
temperature reading as an output every time the user sends an input.
Figure 1.1 STK500 Micro Controller, first connected to a computer where a program that connects to the controller is
used. The code is written either in the program or a separate editor, and the program is later used to send the data to the
controller where it runs it until the user resets the board.
Microcontrollers are used in a wide array of applications, ranging from automobiles, kitchen appliances,
larger embedded systems, smartphones, digital cameras, microwave ovens, and much more. Every stoplight
you drove through contained a microcontroller that controls the lights, or when it receives an input from
Atmel Microcontroller in Data Acquisition and Device Control | 4/19/2013
2
Atmel Microcontroller in Data Acquisition and Device Control| 4/19/2013
3
another microcontroller that makes the first one change the lights. The potential of the Microcontroller has
been utilized since its creation in 1971, and it has expanded since then.
Life would definitely be harder without these microcontrollers. Their existence even extends to a
refrigerator[1], where the temperature is controlled by the microcontroller or when the user sends an input
to the microcomputer. However, the limit of this technology has definitely not been reached, and further
expansion to possible better and smaller microcontrollers can lead to a very different future. A very
practical and cheap technology, the microcontroller’s influence cannot be belittled in their help to advance
technology and provide an easier life for people everywhere.
The Atmel STK500 is a starter development kit for microcontrollers. It’s a basic board, meant to help us
understand Atmel products, and microcontrollers in general. The STK500 is composed of three sections:
Control, Target Socket, and User Interface. The control section provides communication between the Host
computer and the board using USB serial cables. The Target Socket section contains plastic dual in-line
package (PDIP) sockets, programming headers, and configuration jumpers, and the User Interface section
includes LEDS, switches and I/O headers. The control section includes the driving force for the entire
board, the MCU. STK500 uses ATmega8535L. We need to program the devices installed on the board and
control the functionality of the board
Atmel Microcontroller in Data Acquisition and Device Control | 4/19/2013
Figure 1.2
Modern Refrigerators, using embedded controllers [2].
2. Problem Description
3
In this project, we will be extending the previous groups’ works on the microcontroller. In the earlier
projects, they had their boards programmed to read the current room temperature the board was in either
through the input on the board, or from their website, where they were able to send an input from any
location to the board, and send an output to the same location that sent the input. Figure 2.1 shows the
previous group’s system diagram, and Figure 2.2 shows their configurations. Our
primary objective
is to
control the temperature reading/outputs, control the board through user inputs, and create an idle-time
process for the board. Figure 2.1.7 is a simple depiction of our objective. Secondary objectives include
giving a complete “Dummy guide for basic microcontroller board users”, and helping the readers
understand hardware and software interactions.
2.1 Pre-Experimentation
Before the start of the project, one of the Atmel board was broken, and we couldn’t tell until we found that
the other board worked with the same connection, and setup. The other problems we encountered were
the computer’s abilities to detect ports, and displayed ports were not found sometimes. There are many
input pins/ports, and we had a hard time understanding what the pins were used for. The stk500 manual
may be there, but it is very hard to understand since we are actually hardware beginners. We have
encountered several more issues, which will be discussed throughout this manual. Understanding things like
the STK500 diagram shown in 2.1.6 is hard to understand at first.
2.2 Understanding the Software Needed
We used CodeVisionAVR (CVAVR) Evaluation version 3.0 to program our board. The free software
offered excellent user-friendly libraries and settings and also generated source files needed to program the
board. Originally, AVR Studio 4.16 was the software used to program the board, but the software lacked
the ability to generate codes/files based on the settings chosen and needed for board configuration, and we
lacked the abilities and time to create it ourselves. We knew however, that we will be using C
programming, or specifically, embedded C. However, do not be afraid of the different terminology as the
syntax is the same for both, but with different library requirements for both.
Atmel Microcontroller in Data Acquisition and Device Control | 4/19/2013
4
Zgłoś jeśli naruszono regulamin