Figure 1.1: Some embedded device. In this course we shall learn microcontroller and FPGA based embedded system.

Similar documents
Embedded Systems Lab Lab 1 Introduction to Microcontrollers Eng. Dalia A. Awad

PIC Microcontroller and

Clock and Fuses. Prof. Prabhat Ranjan Dhirubhai Ambani Institute of Information and Communication Technology, Gandhinagar

PIC Microcontroller Introduction

Computer Hardware Requirements for ERTSs: Microprocessors & Microcontrollers

MT2 Introduction Embedded Systems. MT2.1 Mechatronic systems

ELCT708 MicroLab Session #1 Introduction to Embedded Systems and Microcontrollers. Eng. Salma Hesham

Workshop on Microcontroller Based Project Development

8051 Microcontroller

Lecture (02) PIC16F84 (I)

Keywords Digital IC tester, Microcontroller AT89S52

MegaAVR-DEVelopment Board Progressive Resources LLC 4105 Vincennes Road Indianapolis, IN (317) (317) FAX

Introduction to 8051 microcontrollers

Lab 1 Introduction to Microcontroller

To be familiar with the USART (RS-232) protocol. To be familiar with one type of internal storage system in PIC (EEPROM).

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

8051 MICROCONTROLLERS

Laboratory: Introduction to Mechatronics

MicroProcessor. MicroProcessor. MicroProcessor. MicroProcessor

Computer Hardware Requirements for Real-Time Applications

Microprocessors/Microcontrollers

LED Matrix Scrolling using ATmega32 microcontroller

Mechatronics and Measurement. Lecturer:Dung-An Wang Lecture 6

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

Mega128-DEVelopment Board Progressive Resources LLC 4105 Vincennes Road Indianapolis, IN (317) (317) FAX

Network Embedded Systems Sensor Networks Fall Hardware. Marcus Chang,

Microprocessors And Microcontroller

Manual of Board ET-PIC STAMP 18F8722-K22 ET-PIC STAMP 18F8722-K22

The Atmel ATmega328P Microcontroller

PIC16F87X. 28/40-pin 8-Bit CMOS FLASH Microcontrollers. Devices Included in this Data Sheet: Pin Diagram PDIP. Microcontroller Core Features:

AVR Training Board-I. VLSI Design Lab., Konkuk Univ. LSI Design Lab

VLSI Design Lab., Konkuk Univ. Yong Beom Cho LSI Design Lab

CHAPTER 1 - World of microcontrollers

mmike Joined: 04 Jun 2006 Posts: 553 Helped: Aug :11 Motorola chip pic16f88 18 pin

Usb Universal In-circuit Programmer Pic Avr Arm Msp 8051 Eeprom

Renesas 78K/78K0R/RL78 Family In-Circuit Emulation

Microprocessors And Microcontrollers (Practical)

EMBEDDED SYSTEMS COURSE CURRICULUM

EE4380 Microprocessor Design Project

Introduction to Microcontroller Apps for Amateur Radio Projects Using the HamStack Platform.

Getting Embedded Software into the Target System using Device Programmer

Basic Components of Digital Computer

Linux Kernel Hacking Free Course, 3rd edition. HWMPS: Hardware Monitor & Protection System

Laboratory: Introduction to Mechatronics. Instructor TA: Edgar Martinez Soberanes Lab 1.

The Atmel ATmega168A Microcontroller

Segment 1A. Introduction to Microcomputer and Microprocessor

EB-51 Low-Cost Emulator

CEIBO FE-5111 Development System

ME 515 Mechatronics. A microprocessor

CYTRON USB PIC Programmer v2009 UP00B

FIFTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLOGY-MARCH 2014 EMBEDDED SYSTEMS (Common for CT,CM) [Time: 3 hours] (Maximum marks : 100)

EEE394 Microprocessor and Microcontroller Laboratory Lab #6

CHAPTER 1 MICROCOMPUTER SYSTEMS. 1.1 Introduction. 1.2 Microcontroller Evolution

Fig 1. Block diagram of a microcomputer

Lesson 14. Title of the Experiment: Introduction to Microcontroller (Activity number of the GCE Advanced Level practical Guide 27)

COMP2121: Microprocessors and Interfacing. Introduction to Microprocessors

CORRIGENDUM ISSUED FOR NATIONAL COMPETITIVE BIDDING UNDER TEQIP PHASE-II

Bolt 18F2550 System Hardware Manual

HI-TIDE Release Notes for Version 3.13

EE 354 Fall 2015 Lecture 1 Architecture and Introduction

EC4205 Microprocessor and Microcontroller

RFID: Read and Display V2010. Version 1.1. Sept Cytron Technologies Sdn. Bhd.

Distributed Real- Time Control Systems

Lecture Objectives. Introduction to Computing Chapter 0. Topics. Numbering Systems 04/09/2017

The Freescale MC908JL16 Microcontroller

F 2 MC-8FX Family. 8-bit Microcontroller. MB95200 Series

Section 30. In-Circuit Serial Programming (ICSP )

Bachelor of Engineering in Computer and Electronic Engineering

AVR MICROCONTROLLER ARCHITECTURTE

PIC 28 Pin Board Documentation. Update Version 5.0

INDUSTRIAL TRAINING:6 MONTHS PROGRAM TEVATRON TECHNOLOGIES PVT LTD

Lecture 1: Introduction to Microprocessors

Locktronics PICmicro getting started guide

About the Presentations

Introduction to Arduino. Wilson Wingston Sharon

LABORATORY UNIT ON MICROCONTROLLERS ** AND FEEDBACK: AN INTRODUCTION

EasyPIC5 Development System

Wall Industries SMPS and Microcontrollers

CEIBO FE-51RD2 Development System

Embedded Systems. PIC16F84A Internal Architecture. Eng. Anis Nazer First Semester

KPIC-0818P (V050919) Devices Included in this Data sheet: KPIC-0818P

Z8 Encore! XP F1680 Series 8-Bit Flash Solution with Extended Peripherals

ATHENA32 PIC32 Evaluation Board ATHENA32. Product Datasheet. Francesco Ficili Date 13/01/2019. Pag. 1

Display Real Time Clock (RTC) On LCD. Version 1.2. Aug Cytron Technologies Sdn. Bhd.

PICado Alpha Development Board V1.0

User Manual For CP-JR ARM7 USB-LPC2148 / EXP

EE 308: Microcontrollers

CS-424/580A Microcontrollers and Robotics

Embedded programming, AVR intro

_ V Intel 8085 Family In-Circuit Emulation. Contents. Technical Notes

Digital Circuits Part 2 - Communication

Lecture (01) Introducing Embedded Systems and the Microcontrollers By: Dr. Ahmed ElShafee

Lecture 1. Course Overview and The 8051 Architecture

LIN bus board datasheet EB

SECURE DIGITAL ACCESS SYSTEM USING IBUTTON

AKKON USB CONTROLLER BOARD

CHIPS Newsletter Vol 5 - Yahoo! Mail. Official Newsletter of

Introducing: New Low-Cost & Low Pin Count PIC Microcontrollers for the 8-, 16- & 32-bit Markets

AT89 Series Development. Tools Support Family In-Circuit Emulator

ON4AKH Antenna Rotator controller Version 1.0

Transcription:

Course Code: EEE 4846 International Islamic University Chittagong (IIUC) Department of Electrical and Electronic Engineering (EEE) Course Title: Embedded System Sessional Exp. 1: Familiarization with necessary resources of Embedded system laboratory. 1.1 Objective: The objectives of this experiment are- (a) To learn about embedded system. (b) To learn some basic information about microcontroller. (c) To learn about required hardware and software to develop microcontroller based embedded system. 1.2 What is Embedded System? Embedded systems are designed for the specific function within the larger system. It has the processing circuit like Microprocessor, DSP and FPGA that allows the data communication very easily. The characteristic of the embedded system to handle the particular task allows the design engineer to reduce the size and cost of the system and at the same time also make the system more reliable. An embedded system is a combination of microprocessor based hardware and the suitable software to undertake a specific task. A general purpose computer (e.g. a personal computer) is defined not to be an embedded system. Example: Television, radio, mobile phone etc. are the example of embedded device. Figure 1.1: Some embedded device. In this course we shall learn microcontroller and FPGA based embedded system. Prepared By: Mohammed Abdul Kader, Lecturer, EEE, IIUC Page 1

1.3 About Microcontroller Microcontroller is a device that includes microprocessor, memory and input/output devices on a single chip. Microcontroller has a CPU, in addition with a fixed amount of RAM, ROM and other peripherals all embedded on a single chip. At times it is also termed as a mini computer or a computer on a single chip. Timer/ I/O Figure 1.2: Basic architecture of a Microcontroller 1.3.1 Name of Some Microcontroller Manufacturer ATMEL (AVR microcontroller) Microchip (PIC microcontroller) Texas Instruments (TI) Freescale Philips Motorola 1.3.2 About PIC Microcontroller The original name of this microcontroller is PICmicro (Peripheral Interface Controller), but it is better known as PIC Its ancestor, called the PIC1650, was designed in 1975 by General Instruments At first, READ ONLY MEMORY (ROM) used in these microcontrollers were Masked ROM (MROM), then One Time Programmable ROM (OTP ROM), then UV Erasable Programmable ROM (UV EPROM), and finally Flash Memory (program can be written and cleared practically an unlimited number of times) Prepared By: Mohammed Abdul Kader, Lecturer, EEE, IIUC Page 2

Its programming is very user friendly. There are several PIC family (e.g. PIC10FXXX, PIC16FXXX, PIC12HVXXX etc.) of PIC Microcontroller. Each family includes many of microcontrollers. 1.3.3 Overview of Development Process PIC PIC Figure 1.3: Steps to develop microcontroller based system 1) A circuit is designed in which a PIC microcontroller will be used. 2) Using a text editor on a desktop or laptop computer, a program is written in C that is intended to run on the PIC microcontroller. 3) The C program is compiled into a binary file formatted for the target PIC microcontroller. 4) A programming software sends the compiled program to a programmer (Loader) that is connected to the computer's serial, parallel, or USB port. 5) The Programmer (hardware) programs or "burns" the compiled program into the PIC microcontroller. 1.4 Hardware Needed According to circuit requirement many hardware components may be needed. The common parts are described below- 1.4.1 Linear Voltage Regulator (LM7805) We never connect microcontroller power supply to an adaptor. Because the voltage of adaptor is not constant, when the load draws variable current. The voltage decreases as the current drawn by the load increases. This is due to the use of transformer in adaptor. More current increase the losses of the transformer, therefore the terminal voltage decreases. That s why we have to use a linear voltage regulator IC known as LM 7805. It is a three terminal positive voltage regulator. Its input voltage may vary 7V to 20V but output voltage is constant at 5V. Input Voltage Output voltage Current Rating 7-20 V 5V (may vary from 4.75 to 5.25V) Up to 1A Prepared By: Mohammed Abdul Kader, Lecturer, EEE, IIUC Page 3

1.4.2 Heat Sink Figure 1.4: Linear Voltage Regulator A heat sink should attach with LM 7805 to protect it from excessive heat. Suppose input voltage of LM7805 = 12 V Output is always fixed at 5 V If microcontroller and other components in the circuit draws a current 0.5 amp, the output power of 7805 will be, P out = 5*0.5 = 2.5 W Input Power of 7805, P in =12*0.5 = 6 W. Power dissipation in 7805, P loss =(6-2.5) W = 3.5 W=3.5 J/s This power loss generates 3.5 J heat energy per second. The surface of 7805 is not enough to release 3.5 J heat per second in the environment. Heat sink acts as an extra surface to increase the heat releasing capacity. 1.4.3 Microcontroller Programmer Figure 1.5: Heat sink A microcontroller programmer or microcontroller burner is a hardware device accompanied with software which is used to transfer the machine language code to the microcontroller/eeprom from the PC. The compiler converts the code written in languages like assembly, C, java etc to machine language code (which is understandable by the machines/microcontrollers) and stores it in a hex file. A microcontroller programmer acts as an interface between the PC and the target controller. The API/software of the programmer reads data from the hex file stored on the PC and feeds it into the controller s memory. The target controller on which the program needs to be Prepared By: Mohammed Abdul Kader, Lecturer, EEE, IIUC Page 4

burned is placed on the programmer using a ZIP socket. The software transfers the data from the PC to the hardware using serial, parallel or USB port. Figure 1.6: Interfacing programmer with PC Depending on the way it interacts with PC, there are three types of microcontroller programmers: Parallel Programmer uses the parallel port of the PC. They are low cost programmer but not widely used. Serial Programmers uses the serial port to interact with PC via RS232 protocols. They are more popular among hobbyist working on PC. However both the serial and parallel programmers will become obsolete in near future. The major reason being unavailability of parallel and serial ports in the PCs & Laptops in the coming years. USB Programmer uses the USB interface to transfer the data from PC. The main advantage of the USB burner is that they are powered from the PC itself and there is no need of any additional supply. The USB programmers have already become popular and will soon replace the serial and parallel programmer. In Laboratory we will use a USB programmer which is the clone of Pickit2. This programmer supports Pickit2 software. It is a low-cost development tool with an easy to use interface for programming. It supports baseline (PIC10F, PIC12F5xx, and PIC16F5xx), midrange (PIC12F6xx, PIC16F), PIC18F, PIC24, dspic30, dspic33, and PIC32 families of 8-bit, 16-bit, and 32-bit microcontrollers, and many Microchip Serial EEPROM products. Prepared By: Mohammed Abdul Kader, Lecturer, EEE, IIUC Page 5

1.4.4 Clock Sources Figure 1.7: Programmer available at lab. Why? The clock of a microcontroller is its heart beat. We can call the clock sources as Heart of Microcontroller. As microcontroller is a register based device, it needs clock to execute instruction or manipulate data. Normal instructions for the chip take one to three clock cycles to complete; a clock cycle is the low-high-low transition of the clock. So, the faster the clock runs the faster the chip works. Selecting Clock Sources: There are a few different ways to generate a clock for a microcontroller. You can use an external clock that feeds in the low-high pulse stream. Some chips have built in RC oscillator. So, the options are: 1) Internal Oscillator 2) External oscillator a) Crystal Oscillator. b) Ceramic Oscillator. c) RC (Resistor, Capacitor) Oscillator. The optimal clock source for an application depends on many factors including cost, accuracy, and environmental parameters. Although it is often appropriate to use the internal RC oscillator as the processor clock source, there are some situations where it is more appropriate to use some external clock circuitry, for reasons such as: Great Accuracy and Stability: A crystal or ceramic resonator is significantly more accurate than the internal RC oscillator, with less frequency drift due to temperature and voltage variations. Prepared By: Mohammed Abdul Kader, Lecturer, EEE, IIUC Page 6

Generating a specific frequency: For example, the signal from 32,768 KHz crystal can be readily divided down to 1Hz. Or, to produce the accurate timing for RS-232 serial data transfer, a crystal frequency such as 1.843200 MHz can be used, since it exact multiple of common bit rates, such as 38400 or, 9600 (1843200=48*38400=192*9600). Synchronizing with other components: Clocking a number of devices from a common source, so that their outputs change synchronously. Fastest operation: Most Mid-range PIC s can operate at a clock rate up to 20MHz, while internal RC oscillator generally runs at only 4 or, 8MHz. If you need more speed than the internal oscillator can provide, you need to use a crystal or other external clock oscillator. Lower power consumption: At a given supply voltage, microcontroller draw less current when they are clocked at lower speed. Power consumption can be minimized by running the uc at the slowest practical clock speed as for many application high clock speed is unnecessary. The disadvantage of using external oscillator is that you will lose two I/O pins of microcontroller as oscillator needs two I/O pins to connect with uc. Comparison between Crystal and Ceramic Resonator The crystal is a very accurate and (in theory) simple way to get a clock. As well crystals do not change their value (much) with a changing external temperature. Crystals are available in many frequencies and sizes, and needs two external 'load capacitors' to work. A ceramic resonator is similar to a crystal, except that it is much cheaper. However as a consequence it is also not as accurate and the value can change at different temperatures. An advantage is that they are less fragile than a crystal - so in high-vibration environments they can perform (fairly) well. Two types of ceramic resonator available: (i) two pin ceramic resonator and (ii) Three pin ceramic resonator. The two pin ceramic resonator needs two external 'loading capacitors'. The three pin ceramic resonator is similar to the two pin - except that it doesn't need the external loading capacitors as they are built in. One pin of the resonator goes to ground, one to XTAL1 and one to XTAL2 (it doesn't matter which pin goes to XTAL1 or XTAL2, but the pin to ground matters!) 1.4.5 Microcontroller (PIC16F887) In laboratory we shall use the most familiar microcontroller chip PIC16F887. The features of this chip is given below- Features Operating Frequency Power Supply Flash Program Memory (ROM) DC-20MHz 2-5.5 V 8K Prepared By: Mohammed Abdul Kader, Lecturer, EEE, IIUC Page 7

Data Memory (RAM) EEPROM Memory I/O Ports Timers 368 Bytes 256 Bytes PORTS A,B,C,D,E 3 (Two 8-bits and one 16-bits) Captures/Compare/PWM Modules 2 Serial Communications Parallel Communications 10-bit ADC Instruction Set USART, MSSP PSP 14 input channel 35 instructions Figure 1.8: Pin diagram of PIC16F887 1.5 Necessary Software To write the code and simulate circuit we will use the following software s- (a) MikroC Pro : To write and compile the code. Prepared By: Mohammed Abdul Kader, Lecturer, EEE, IIUC Page 8

(b) PIC Simulator IDE: To simulate the code. (c) Proteus: To simulate the complete circuit. 1.5.1 MikroC Pro The mikroc PRO for PIC is a powerful, feature-rich development tool for PIC microcontrollers. It is designed to provide the programmer with the easiest possible solution to developing applications for embedded systems, without compromising performance or control. Following figure shows the interface of MikroC Pro window- Figure 1.9: Interface of MikroC Pro To know the detailed about MikroC Pro you can take help from MikroC Pro User Manual 1.5.2 PIC Simulator IDE PIC Simulator IDE is powerful application that supplies PIC developers with user-friendly graphical development environment for Windows with integrated simulator (emulator), Basic compiler, assembler, disassembler and debugger. Prepared By: Mohammed Abdul Kader, Lecturer, EEE, IIUC Page 9

1.5.3 Proteus Figure 1.10: Interface of PIC Simulator IDE PROTEUS is very strong circuit simulation software. To simulate the complete circuit containing microcontroller and other I/O devices you may use PROTEUS. Figure 1.11: Interface of Proteus Simulator Prepared By: Mohammed Abdul Kader, Lecturer, EEE, IIUC Page 10