ECE 354 Introduction to Lab 1. February 5 th, 2003

Similar documents
ECE 354 Introduction to Lab 2. February 23 rd, 2003

ECE 354 Computer Systems Lab II. Interrupts, Strings, and Busses

Hi Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan

ELCT 912: Advanced Embedded Systems

EET203 MICROCONTROLLER SYSTEMS DESIGN Serial Port Interfacing

Chapter 2 Sections 1 8 Dr. Iyad Jafar

Chapter 10 Sections 1,2,9,10 Dr. Iyad Jafar

ME 475 Lab2 Introduction of PIC and Programming. Instructor: Zhen Wang

DERTS Design Requirements (1): Microcontroller Architecture & Programming

Laboratory: Introduction to Mechatronics. Instructor TA: Edgar Martinez Soberanes Lab 2. PIC and Programming

APPLICATION NOTE 2361 Interfacing an SPI-Interface RTC with a PIC Microcontroller

Serial Communication with PIC16F877A

MCS-51 Serial Port A T 8 9 C 5 2 1

Asynchronous Transmission. Asynchronous Serial Communications & UARTS

Experiment 7:The USART

Outlines. PIC Programming in C and Assembly. Krerk Piromsopa, Ph.D. Department of Computer Engineering Chulalongkorn University

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

Basics of UART Communication

EE 354 November 13, 2017 ARM UART Notes

Interfacing a Hyper Terminal to the Flight 86 Kit

Department of Electronics and Instrumentation Engineering Question Bank

Serial Communications

Serial Communication

Unit wise Question Bank UNIT-II

Mod-5: PIC 18 Introduction 1. Module 5

FULL DUPLEX BIDIRECTIONAL UART COMMUNICATION BETWEEN PIC MICROCONTROLLERS

acret Ameya Centre for Robotics & Embedded Technology Syllabus for Diploma in Embedded Systems (Total Eight Modules-4 Months -320 Hrs.

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

Hello, and welcome to this presentation of the STM32 Low Power Universal Asynchronous Receiver/Transmitter interface. It covers the main features of

ELCT706 MicroLab Session #4 UART Usage for Bluetooth connection PC - PIC

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

ECE251: Thursday November 8

Outline. Micriprocessor vs Microcontroller Introduction to PIC MCU PIC16F877 Hardware:

Microcontroller basics

CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT. Spring 2006

ME 515 Mechatronics. A microprocessor

PIC Discussion. By Eng. Tamar Jomaa

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING. EE Microcontroller Based System Design

Micro II and Embedded Systems

Section 21. Addressable USART

Microcontroller systems Lec 2 PIC18LF8722 Microcontroller s s core

ELCT706 MicroLab Session #4 UART Usage for Bluetooth connection PC - PIC

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

Embedded Systems Programming and Architectures

Parallel IO. Serial IO. Parallel vs. Serial IO. simplex vs half-duplex vs full-duplex. Wires: Full Duplex. Wires: Simplex, Half-duplex.

Hello, and welcome to this presentation of the STM32 Universal Synchronous/Asynchronous Receiver/Transmitter Interface. It covers the main features

MICROPROCESSOR BASED SYSTEM DESIGN

Embedded System Design

Chapter 13. PIC Family Microcontroller

1 Introduction to Computers and Computer Terminology Programs Memory Processor Data Sheet... 4

DEPARTMENT OF ECE QUESTION BANK SUBJECT: MICROPROCESSOR AND MICROCONTROLLER UNIT-1 PART-A (2 MARKS)

1 Introduction to Computers and Computer Terminology Programs Memory Processor Data Sheet Example Application...

The University of Texas at Arlington Lecture 3

AVR Microcontrollers Architecture

ELE492 Embedded System Design

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

TB033. Using the PIC16F877 To Develop Code For PIC16CXXX Devices INTRODUCTION. Stan D Souza, Rodger Richey Microchip Technology Inc.

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

Embedded Systems and Software. Serial Communication

TKT-3500 Microcontroller systems

PART - B (Answer all five units, 5 X 10 = 50 Marks)

EEE111A/B Microprocessors

Interrupts and Serial Communication on the PIC18F8520

Midrange 8b PIC Microcontrollers. ECE Senior Design 14 February 2017

MicroProcessor. MicroProcessor. MicroProcessor. MicroProcessor

EE251: Thursday November 30

Embedded Systems. Read pages

MTRX3700 Mechatronics

ME 6405 Introduction to Mechatronics

Microprocessor and Microcontroller question bank. 1 Distinguish between microprocessor and microcontroller.

Maxim > Design Support > Technical Documents > Application Notes > Microcontrollers > APP 4465

Hierarchy of I/O Control Devices

PIC Microcontroller Introduction

Documentation Design File Formats

SOME ASSEMBLY REQUIRED

ECE 353 Lab 4. General MIDI Explorer. Professor Daniel Holcomb Fall 2015

Embedded Systems and Software

eip-24/100 Embedded TCP/IP 10/100-BaseT Network Module Features Description Applications

EE 308: Microcontrollers

QUESTION BANK CS2252 MICROPROCESSOR AND MICROCONTROLLERS

The University of Texas at Arlington Lecture 21_Review

Example of Asyncronous Serial Comms on a PIC16F877

EE251: Tuesday December 4

Serial communication

Professor E. Ambikairajah UNSW Sydney

Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices,

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING MSC SYSTEMS ENGINEERING AND ENGINEERING MANAGEMENT SEMESTER 2 EXAMINATION 2016/2017

DRPIC166X IP Core. High Performance 8-bit RISC Microcontroller v. 2.17

eip-10 Embedded TCP/IP 10-BaseT Network Module Features Description Applications

8051 Serial Port. EE4380 Fall02 Class 10. Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas

APP-IIb PIC Development Kit by AWC

SPART - A Special Purpose Asynchronous Receiver/Transmitter

THE 8051 MICROCONTROLLER

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

OUTLINE. STM32F0 Architecture Overview STM32F0 Core Motivation for RISC and Pipelining Cortex-M0 Programming Model Toolchain and Project Structure

V8-uRISC 8-bit RISC Microprocessor AllianceCORE Facts Core Specifics VAutomation, Inc. Supported Devices/Resources Remaining I/O CLBs

Summer 2003 Lecture 1 06/09/03

I2C TM Slave Library Module (Interrupt-driven)

UART Devices. ECE 480: Design Team 3. Application Note. By: Hoyoung Jung. Date: 4/3/15

Am186ER/Am188ER AMD continues 16-bit innovation

Transcription:

ECE 354 Introduction to Lab 1 February 5 th, 2003

Lab 0 Most groups completed Lab 0 IDE Simulator Questions? ICD Questions? What s the difference? ECE 354 - Spring 2003 2

Addition to Honesty Policy It will be considered an honor code violation if you look at / use / copy files from other teams. Lab computers are shared stick to your own files. ECE 354 - Spring 2003 3

Miscellaneous Grad TA: Ramaswamy Ramaswamy Undergrad TAs: Dave Thomas Dustin Marceau Darren Maczka Lab times: Monday: lab open 2:30-7:00 TAs: Dave 2:30-4:00, Dustin 4:00-7:00, Darren 5:30-7:00 Tuesday: lab open 4:30-7:00 (typo on syllabus) TAs: Darren 4:30-6:30, Dustin 5:30-7:00 Wednesday: lab open 2:30-7:00 TAs: Dave 2:30-5:30, Dustin 5:30-7:00 Thursday: lab open 4:00-7:00 (type on syllabus) TAs: Darren 4:00-6:30, Dave 5:30-7:00 Text on reserve Have to find a copy ECE 354 - Spring 2003 4

Overview 16F877 Architecture Overview Memory Organization Special purpose registers Instruction Set Lab 1 USART Reset ECE 354 - Spring 2003 5

PIC 16F877 Microcontroller with Harvard architecture 14 bit instructions 8 bit data values Byte addressed Storage capacity: Program storage: 8k x 14 bit Flash EPROM Data storage: 256 x 8 bit EEPROM 368 x 8 bit SRAM Universal Asynch./Synch. Receiver/Transmitter (UART) 8 channel, 1-bit A/D converter Up to 20 MHz clock, 200ns instruction cycle Much more (see data sheet p.1) ECE 354 - Spring 2003 6

16F877 Block Diagram Main processor components: ALU Program counter Program memory Register file Status register Clock I/O ports Timers A/D converter USART ECE 354 - Spring 2003 7

16F877 Block Diagram 8 bit data (ALU/registers) 13 bit PC 14 bit instructions 9 bit register address ECE 354 - Spring 2003 8

Program Memory Location 0 is first instruction executed after reset Interrupt vector executed when interrupt occurs Why is it called vector? Program Stack: 8 levels deep ECE 354 - Spring 2003 9

Data Memory Data memory split into banks Why? 4 banks of 128 registers Bit 5 and 6 of STATUS register are bank select bits Important registers are in all banks STATUS, FSR ECE 354 - Spring 2003 10

Special Purpose Registers See data sheet Table 2-1 (pp. 15-17) Important special purpose registers: Status Program counter INDF and FSR for indirect addressing PORTA PORTD USART Tx and Rx Many more Some registers only available in particular banks E.g., USART ECE 354 - Spring 2003 11

Status Register Bit 0: Carry Bit 1: Digit carry Bit 2: Zero result Bits 3&4: Use at power-up and sleep Bit 5&6: bank select Bit 7: bank select for indirect addressing ECE 354 - Spring 2003 12

16F877 Instruction Format ECE 354 - Spring 2003 13

16F877 Instruction Set 35 instructions See datasheet pp. 139 144 See Peatman pp. 25,27 28 ECE 354 - Spring 2003 14

16F877 Assembler Nobody wants to code binary values of op-codes and operands 11 1110 1000 0101 adds 135 to working register Assembler translates readable code into binary ADDLW 135 means add literal 135 to working register Assembler converts this to 11 1110 1000 0101 Other convenient features Labels for branches and jumps (e.g., bug and start ) Register addresses can be named (e.g., c1 equ 0x0c ) Tutorial on Monday 2:30 Elab 303 ECE 354 - Spring 2003 15

Reset Two main instances of reset Power applied to 16F877 MCLR (master clear) asserted active low PC reset to 0000h Various vectors occupy 0000h 0004h Program can start at 0005h More at tutorial on Monday ECE 354 - Spring 2003 16

Lab 1 Connect PIC to terminal PIC in stand-alone mode using USART interface Mostly software development Required functionality: Four bits of port A connected to switches, value shown on LED on port B PIC sends Start (Y or N)? to terminal User presses key, value is sent to PIC and echoed If user presses Y, PIC sends ASCII character corresponding to hex value of bits on port A (e.g., 1100 should display C on terminal) Send character every time switch values change ECE 354 - Spring 2003 17

UART/USART Universal Synchronous/Asynchronous Receiver/Transmitter Serial data communication between PIC and Terminal Two cables (receive and transmit) Each 1-byte character is transmitted separately Start, 8 data bits, 1 parity, Stop We use asynchronous mode Sender uses local clock Baud rate specifies speed of transmission ECE 354 - Spring 2003 18

Synchronization ECE 354 - Spring 2003 19

UART on 16F877 Several registers involved Control/status registers: TXSTA (transmit status and control register) RCSTA (receive status and control register) Configure: enable bit, 8/9 bit, buffer full, etc. Baud rate generator: SPBGR Data sheet table 10-3 shows value for different clock rates and baud rates Data registers: TXREG and RCREG Interrupt registers: PIR1 (flag bits for peripheral interrupts) Set when TXREG clears and RCREG is filled PIE1 (enable bits for interrupts) ECE 354 - Spring 2003 20

UART Tx on PIC (1) ECE 354 - Spring 2003 21

UART Tx on PIC (2) ECE 354 - Spring 2003 22

UART Tx Signals ECE 354 - Spring 2003 23

UART Rx on PIC (1) ECE 354 - Spring 2003 24

UART Rx on PIC (2) ECE 354 - Spring 2003 25

UART Rx Signals ECE 354 - Spring 2003 26

Hardware Setup Need MAX232 driver PIC: 0/+5V RS-232 interface: ±10V See Peatman Ch. 11 ECE 354 - Spring 2003 27

Lab 1 BEFORE YOU START: READ! Lab Assignment Data sheet pp. 29 33 (port I/O) Data sheet pp. 95 104 (UART) Peatman, chapter 11 (UART) MAX232 data sheet Think about how you want to split work Think about steps to take to get it working Start working early! Lab schedule starts Monday, Feb 10 ECE 354 - Spring 2003 28

Next Start with Lab 1 Deadline: demo by 2/19, report by 2/26 Assembly tutorial Monday 2:30, Elab 303 Lab will be open ECE 354 - Spring 2003 29