Upload
elfrieda-bishop
View
220
Download
1
Tags:
Embed Size (px)
Citation preview
Single Chip Microcontrollers
7765J
Mount Druitt College of TAFE
Lesson 1
© Mike Stacey 2008
Assessment
Practical Test 1: 30% Practical Test 2: 40% Theory Test: 30%
Assignments There are 4 assignments which constitute your
practical work for this subject They must be submitted by email by the due date/time Practical tests are based on the weekly practical
exercises you do in class.
© Mike Stacey 2008
Assignment submission
Each of the 4 assignments must be submitted by email and should include: Title page – name, subject name, class time and
assignment number Flow chart of your program Program listing – with comments. Your program has to be demonstrated to the
teacher for verification that it works!
© Mike Stacey 2008
Website and subject material
The subject resources include: These PowerPoint slides. They should be
downloaded and printed (pdf version) prior to coming to class.
Your extra notes which are added to the printed version of the slides.
Lesson outline sheet Practical work – assignments All downloadable from
http://wsiee.wikispaces.com
© Mike Stacey 2008
Topics
Microcontroller characteristics including understanding of data sheets, I/O ports, hardware timers
The AVR studio programming environment Interfacing to and scanning a keypad EEPROM loading More advanced assembly language
programming
© Mike Stacey 2008
Timeline
Assignment 1 due
Assignment 2 due
Assignment 3 due
Assignment 4 due
Practical Test 1
Practical Test 2
Theory Test
Lesson 1
Lesson 2
Lesson 3
x
Lesson 4
Lesson 5
x
Lesson 6
x
Lesson 7
X
Lesson 8
X
Lesson 9
X X
© Mike Stacey 2008
Embedded uP Systems What is an embedded uP system? Special purpose computer system to
perform a limited range of functions Limited functionality as opposed to a microprocessor Usually includes hardware, software, mechanical parts Incorporates a microcontroller chip (sometimes even a uP)
Examples Routers, MP3 players, digital watches, traffic lights and larger systems such
as process control units, Engine management systems in automobiles, Electronic measurement instruments (such as digital multimeters, frequency synthesisers, and oscilloscopes), Printers, Mobile phones, Televisions, radios, CD players, tape recording equipment, Hearing aids, Security alarm systems, fire alarm systems, and building services systems
© Mike Stacey 2008
1. Telephone decoupling electronics (for ADSL).2. Multicolour LED (displaying network status).3. Single colour LED (displaying USB status).4. Main processor, a TNETD7300GDU, a member of Texas Instruments' AR7 product line.5. JTAG (Joint Test Action Group) test and programming port.6. RAM, a single ESMT M12L64164A 8 MB chip.7. Flash memory, obscured by sticker.8. Power supply regulator.9. Main power supply fuse.10. Power connector.11. Reset button.12. Quartz crystal.13. Ethernet port.14. Ethernet transformer, Delta LF8505.15. KS8721B Ethernet PHY transmitter receiver.16. USB port.17. Telephone (RJ11) port.18. Telephone connector fuses.
Router-modem
Assignment 3 due
© Mike Stacey 2008
History
The first modern embedded system was the Apollo Guidance Computer at MIT Collected and provided flight information and automatically
controlled all of the navigational functions of the Apollo spacecraft
First to use integrated circuits, 5600 of them Single 3 input NOR gates
4 x 16 bit registers Weight 70lbs User interface
© Mike Stacey 2008
Apollo Guidance Computer
5600 gates, approx. 4k memory, 16 bit data bus, 16 bit address bus, used AGC assembly language on top of a real time operating system. 34 instructions. Weighs 70lbs.
© Mike Stacey 2008
Typical characteristics of an embedded system using a microcontroller
Designed to do some specific task, rather than be a general-purpose computer for multiple tasks
Not always separate but often built into the environment they control
Software for embedded systems called firmware and burnt into flash memory
Limited hardware resources Small or no keyboard Often no monitor Small memory (RAM and flash)
Limited UI - exceptions PDAs etc. Often use LEDs, small character LCDs, buttons
© Mike Stacey 2008
Reliability
Often embedded systems must run in harsh environments for long service periods and also may have to recover automatically from error
Hence software is tested more rigorously!
© Mike Stacey 2008
Microcontroller systems and microprocessor (uP) systems comparison
Microcontroller (uC) has RAM, ROM, I/O (serial and parallel), buses, clocks
Both are built on the “stored program concept” or Von Neumann machine uC stored program in flash memory uP stores it on disk Both allow “easy” program modification
uC has limited memory, both Ram and ROM so large complex programs are not possible
They are designed to perform a limited and specific range of tasks uP perform a wide variety of general purpose tasks and can incorporate
large complex programs Larger instruction set Larger memory capacity
© Mike Stacey 2008
© Mike Stacey 2008
STK500
90S8515
RS232 to computer COM port for programming
Power 12V
LED x 8 connector
Port B
Switches x 8 connector
Careful when connecting cables!!!
Power Switch
© Mike Stacey 2008
AVR Studio IDE
Obtain this program from me and install it at home.
Also obtain the 90S8535 data sheet and bring it to class each week.
It allows you to program, compile and simulate
© Mike Stacey 2008
Example
.include "8535def.inc"rjmp RESET ;Reset Handle
RESET:
.def temp =r16 ; These 4 lines of code just init the ; Stack Pointer to the end of the ; RAM address space ldi temp,low(RAMEND) out SPL,temp ldi temp,high(RAMEND) out SPH,temp
INIT_PORTC: ser temp out DDRC, temp
LOOP_1: ser temp out PORTC, temp nop clr temp out PORTC, temp nop rjmp LOOP_1
see class demo: eg_lesson1.asm