1 4-Integrating Peripherals in Embedded Systems. 2 Introduction Single-purpose processors  Performs specific computation task  Custom single-purpose.

Slides:



Advertisements
Similar presentations
INPUT-OUTPUT ORGANIZATION
Advertisements

CPE 201 Digital Design Lecture 25: Register Transfer Level Design (2)
Review: Interrupts & Timers
The 8051 Microcontroller Chapter 5 SERIAL PORT OPERATION.
Embedded Systems Design: A Unified Hardware/Software Introduction 1 Chapter 3: Standard Single Purpose Processors - Peripherals.
Lecture 8: Serial Interfaces
Hierarchy of I/O Control Devices
Read Chapter 3 (David E. Simon, An Embedded Software Primer)
Embedded Systems Design: A Unified Hardware/Software Introduction 1 Chapter 4 Standard Single Purpose Processors: Peripherals.
Standard Single Purpose Processors: Peripherals. This Week In DIG II  Timers and counters  Watchdog timers  UART (Universal asynchronous receiver /
7-1 Digital Serial Input/Output Two basic approaches  Synchronous shared common clock signal all devices synchronised with the shared clock signal data.
Embedded Systems Design: A Unified Hardware/Software Introduction 1 Chapter 4 Standard Single Purpose Processors: Peripherals ECE 4330 Embedded System.
INPUT-OUTPUT ORGANIZATION
Serial Communication ETEC 6416.

Chapter 4 Standard Single Purpose Processors: Peripherals
Input/Output mechanisms
Renesas Electronics Europe GmbH A © 2010 Renesas Electronics Corporation. All rights reserved. RL78 Clock Generator.
1 4-Integrating Peripherals in Embedded Systems. 2 Introduction Single-purpose processors  Performs specific computation task  Custom single-purpose.
System Clocks.
Chapter 4 TIMER OPERATION
MICROPROCESSOR INPUT/OUTPUT
Lecture Set 9 MCS-51 Serial Port.
Universal Synchronous/Asynchronous Receiver/Transmitter (USART)
AT91 Embedded Peripherals
Lecture 20: Communications Lecturers: Professor John Devlin Mr Robert Ross.
Universal Asynchronous Receiver/Transmitter (UART)
Scott Baker Will Cross Belinda Frieri March 9 th, 2005 Serial Communication Overview ME4447/6405.
Prepared by Eng. Musa Alyaman1 Chapter Seven Chapter Seven PIC16F87x.
1 Lab 5: Controls and feedback. 2 Lab 5: Control and Feedback This embedded system uses the Photo sensor to detect the light intensity of the environment.
Advanced Microprocessor1 I/O Interface Programmable Interval Timer: 8254 Three independent 16-bit programmable counters (timers). Each capable in counting.
 8251A is a USART (Universal Synchronous Asynchronous Receiver Transmitter) for serial data communication.  Programmable peripheral designed for synchronous.
Universal Asynchronous Receiver/Transmitter (UART)
EEE440 Computer Architecture
Timer Timer is a device, which counts the input at regular interval (δT) using clock pulses at its input. The counts increment on each pulse and store.
ATtiny23131 A SEMINAR ON AVR MICROCONTROLLER ATtiny2313.
The Principle of Electronic Data Serial and Parallel Data Communication Transmission Rate Bandwidth Bit Rate Parity bits.
Embedded Systems Design: A Unified Hardware/Software Introduction 1 Chapter 4 Standard Single Purpose Processors: Peripherals.
Intel 8051 Another family of microcontroller is the Intel 8051 family. The basic 8051 microcontroller has four parallel input/output ports, port 0, 1,
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose:  This course provides an overview of the serial communication.
CSCI1600: Embedded and Real Time Software Lecture 16: Advanced Programming with I/O Steven Reiss, Fall 2015.
1 4-Integrating Peripherals in Embedded Systems (cont.)
CE-2810 Dr. Mark L. Hornick 1 Serial Communications Sending and receiving data between devices.
Networked Embedded Systems Pengyu Zhang & Sachin Katti EE107 Spring 2016 Lecture 4 Timers and Interrupts.
8251 USART.
1 4-Integrating Peripherals in Embedded Systems (cont.)
DEPARTMENT OF ELECTRONICS ENGINEERING V-SEMESTER MICROPROCESSOR & MICROCONTROLLER 1 CHAPTER NO microcontroller & programming.
Tiva C TM4C123GH6PM UART Embedded Systems ECE 4437 Fall 2015 Team 2:
Application Case Study Security Camera Controller
Serial mode of data transfer
Networked Embedded Systems Sachin Katti
4-Integrating Peripherals in Embedded Systems
4-Integrating Peripherals in Embedded Systems
1 Input-Output Organization Computer Organization Computer Architectures Lab Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes.
Computer Organization and Design
Introduction to Microprocessors and Microcontrollers
CSCI1600: Embedded and Real Time Software
Serial Communication Interface: Using 8251
Chapter 4 Standard Single Purpose Processors: Peripherals
8253 – PROGRAMMABLE INTERVAL TIMER (PIT). What is a Timer? Timer is a specialized type of device that is used to measure timing intervals. Timers can.
Chapter 4 Standard Single Purpose Processors: Peripherals
Wireless Embedded Systems
Compiled by Dr. N.Shanmugasundaram, HOD, ECE Dept, SECE.
Chapter 4 Standard Single Purpose Processors: Peripherals
Chapter 4 Standard Single Purpose Processors: Peripherals
Introduction Communication Modes Transmission Modes
Presentation transcript:

1 4-Integrating Peripherals in Embedded Systems

2 Introduction Single-purpose processors  Performs specific computation task  Custom single-purpose processors Designed by us for a unique task  Standard single-purpose processors “Off-the-shelf” -- pre-designed for a common task a.k.a., peripherals serial transmission analog/digital conversions

3 Timers, counters, watchdog timers Timer: measures time intervals  To generate timed output events e.g., hold traffic light green for 10 s  To measure input events e.g., measure a car’s speed Based on counting clock pulses E.g., let Clk period be 10 ns And we count 20,000 Clk pulses Then 200 microseconds have passed 16-bit counter would count up to 65,535*10 ns = microsec., resolution = 10 ns Top: indicates top count reached, wrap-around 16-bit up counter Clk Cnt Basic timer Top Reset 16

4 Counters Counter: like a timer, but counts pulses on a general input signal rather than clock  e.g., count cars passing over a sensor  Can often configure device as either a timer or counter 16-bit up counter Clk 16 Cnt_in 2x1 mux Mode Timer/counter Top Reset Cnt

5 Other timer structures Top2 Time with prescaler 16-bit up counter Clk Prescaler Mode Interval timer  Indicates when desired time interval has passed  We set terminal count to desired interval Number of clock cycles = Desired time interval / Clock period Cascaded counters Prescaler  Divides clock  Increases range, decreases resolution 16-bit up counter Clk 16 Terminal count = Top Reset Timer with a terminal count Cnt 16-bit up counter Clk 16-bit up counter 16 Cnt2 Top1 16/32-bit timer Cnt1 16

6 Example: Reaction Timer indicator light reaction button time: 100 ms LCD /* main.c */ #define MS_INIT void main(void){ int count_milliseconds = 0; configure timer mode set Cnt to MS_INIT wait a random amount of time turn on indicator light start timer while (user has not pushed reaction button){ if(Top) { stop timer set Cnt to MS_INIT start timer reset Top count_milliseconds++; } turn light off printf(“time: %i ms“, count_milliseconds); } Measure time between turning light on and user pushing button  16-bit timer, clk period is ns, counter increments every 6 cycles  Resolution = 6*83.33=0.5 microsec.  Range = 65535*0.5 microseconds = milliseconds  Want program to count millisec., so initialize counter to – 1000/0.5 = 63535

7 Watchdog timer scalereg checkreg timereg to system reset or interrupt oscclk prescaler overflow /* main.c */ main(){ wait until card inserted call watchdog_reset_routine while(transaction in progress){ if(button pressed){ perform corresponding action call watchdog_reset_routine } /* if watchdog_reset_routine not called every < 2 minutes, interrupt_service_routine is called */ } watchdog_reset_routine(){ /* checkreg is set so we can load value into timereg. Zero is loaded into scalereg and is loaded into timereg */ checkreg = 1 scalereg = 0 timereg = } void interrupt_service_routine(){ eject card reset screen } Must reset timer every X time unit, else timer generates a signal Common use: detect failure, self-reset Another use: timeouts  e.g., ATM machine  16-bit timer, 2 microsec. resolution  timereg value = 2*( )–X = –X  For 2 min., X = 120,000 microsec.

8 Serial Transmission Using UARTs embedded device Sending UART Receiving UART start bit data end bit UART: Universal Asynchronous Receiver Transmitter  Takes parallel data and transmits serially  Receives serial data and converts to parallel Parity: extra bit for simple error checking Start bit, stop bit Baud rate  signal changes per second  bit rate usually higher

9 Serial Transmission Using UARTs Clocks on sender and receiver are never exactly in sync  Requires synchronization of receiver  High-low transition signals frame boundary

10 UART Tx Signals Example for two transmissions

11 UART Receiving example 2-byte FIFO

12 Using Altera UART component

13 Using Altera UART component

14 Using Altera UART component

15 Using Altera UART component

16 Altera UART Technical Specifications Why did the SOPC set the base address to 0x02000? How big is the on-chip-memory? 20000(hex)=80(hex) * 400(hex) =128 * 1Kbyte (decimal) =128 K byte Big enough to hold the executable version of the Altera libraries and source code. Minimum baud rate is 720 Parity bit is optional. Even and Odd parity available.

17 Altera UART Technical Specifications

18 MAX232 The MAX232 is a dual driver/receiver that includes a capacitive voltage generator to supply standard voltage levels for TIA/EIA-232-F interface. Uses a single 5-V supply. Each receiver converts TIA/EIA-232-F inputs to 5-V TTL/CMOS levels. These receivers have a typical threshold of 1.3 V, a typical hysteresis of 0.5 V, and can accept ±30-V inputs. Each driver converts TTL/CMOS input levels into TIA/EIA-232-F levels.

19 MAX232

20 MAX232: Receiver

21 MAX232: Driver