0% found this document useful (0 votes)
42 views46 pages

Ch2 - Lec1 - ES Implementation Alternatives

This document discusses various implementation alternatives for embedded systems, including general purpose processors, application specific integrated circuits, application specific instruction set processors, and programmable hardware like field programmable gate arrays. It also covers parallel vs serial communication, asynchronous communication protocols like UART and RS-232, synchronous protocols like I2C and SPI, and debugging techniques for embedded systems.

Uploaded by

Melaku Mehandis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views46 pages

Ch2 - Lec1 - ES Implementation Alternatives

This document discusses various implementation alternatives for embedded systems, including general purpose processors, application specific integrated circuits, application specific instruction set processors, and programmable hardware like field programmable gate arrays. It also covers parallel vs serial communication, asynchronous communication protocols like UART and RS-232, synchronous protocols like I2C and SPI, and debugging techniques for embedded systems.

Uploaded by

Melaku Mehandis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

Embedded System

Ch2_Lec1_ES Implementation Alternatives

By Kassahun Tamir

1
Outline
 General Purpose Processor (GPP)
 Application Specific Integrated Circuits (ASIC)
 Application Specific Instruction Set Processors (ASIPS)
 Programmable hardware (FPGA: Field-programmable gate arrays)
 Parallel vs Serial communication
 Asynchronous serial communication (UART and RS-232/485)
 Synchronous serial communication (I2C and SPI)
 Debugging

By Kassahun Tamir 2
General Purpose Processor (GPP)
 High Performance
✗ Highly optimized circuits and technology
✗ Use of instruction level parallelism

Superscalar
Super-pipelined
✗ Complex memory hierarchy

 Not suited for real-time application


✗ Execution times are highly unpredictable because of intensive
resources sharing and dynamic decisions

By Kassahun Tamir 3
General Purpose Processor (GPP)
 Properties
✗ Good average performance of large application mix
✗ High power consumption

 Examples: CPUs

By Kassahun Tamir 4
Application Specific Integrated Circuits (ASIC)
 A microchip designed to perform a specific or unique application. It is
used as replacement to conventional general purpose logic chips.
 ASIC integrates several functions into a single chip and thereby
reduces the system development cost.

 Most of the ASICs are proprietary products. As a single chip, ASIC


consumes very small area in the total system and thereby helps in the
design of smaller systems with high capabilities/functionalities.

 ASICs can be pre-fabricated for a special application or it can be


custom fabricated by using the components from a re-usable ‘building
block’ library of components for a particular
By Kassahun Tamir customer application 5
Application-specific Instruction Set Processors (ASIPs)
 ASIPs are processors with architecture and instruction set optimized to
specific domain/application requirements like network processing,
automotive, telecom, media applications, digital signal processing,
control applications etc.
 ASIPs fill the spectrum between GPPs and ASICs
 ASIPs incorporate a processor and on-chip peripherals, demanded by
the application requirement, program and data memory
 Examples
✗ Microcontrollers
✗ DSP

By Kassahun Tamir 6
Programmable Hardware (FPGA)
 FPGA (Field Programmable Gate Array)
 An array of logic gates that are programmable in the “field”
 The term “Field” indicates that the device is programmable outside the
factory where it is fabricated: programmable in the work “field”

 They are customizable circuits that can be updated by designers after


manufacturing or deployment in the “field”

 Microcontrollers program the chip with a series of instructions.


However, FPGA creates logic structures built from gates inside the
chip in accordance with the logic to be implemented.
By Kassahun Tamir 7
FPGA: Architecture
 Three major elements:
1. Configurable Logic blocks (CLB):
✗ Basic computation (and storage) elements

inside FPGA
✗ Contains Look Up Tables (LUTs) which compute

the logic outputs, flip-flops and multiplexers.


2. I/O blocks (IOB): establish the connection
between configurable logic blocks and i/o blocks
3.Interconnection wires and switch matrix (SM):
used to interface the logic blocks and the routing
architecture to the external architecture
By Kassahun Tamir 8
FPGA: Programming
 HDL(Hardware Description Languages): The two most common ones
are VHDL and Verilog.
 Example

Source: ALL About Circuits

By Kassahun Tamir 9
FPGA: Architecture
 Tutorial as to how to design circuits ranging from just a gate to a
complex circuitry.

https://learn.sparkfun.com/tutorials/how-does-an-fpga-work/all

By Kassahun Tamir 10
Data Transmission
 Computers transfer data in two ways
– Parallel

8 or more lines (wire conductors) are used to transfer data
– Serial

The data is sent one bit at a time

By Kassahun Tamir 11
Data Transmission
 Parallel communication
– All bits of data are sent at a time
– Data transfer speed is high
– It is not preferred for long distance communication as it requires
more number of wires and becomes expensive.
– Used for short distance communication

 Serial communication
– Only one bit is sent at a time
– Data transfer speed is low
– Used for long distance communication.
By Kassahun Tamir 12
Data Transmission
 In serial communication
– At the transmitting end, the byte of data is converted into serial
bits (using a parallel-in-serial-out shift register)
– At the receiving end, the serial data is received and packed into
byte (using a serial-in-parallel-out shift register)

By Kassahun Tamir 13
Modes of Transmission
 Simplex – the communication is unidirectional, or one-way

 Half Duplex – data can be transmitted only in one direction at a time:


the communication is two-directional, but the channel is
interchangeably used by both of the connected devices.

 Full Duplex – data can be transmitted in both directions at a time: the


communication is bi-directional or two-way, and the channel is used
by both of the connected devices simultaneously.

By Kassahun Tamir 14
Synchronous and Asynchronous Serial Communication
 In Synchronous communication (I2C, SPI),
– common clock is used for transmitted and receiver
– A separate link is used to transmit the clock signal
– Block of data is transferred at a time
– Block-oriented data transfers use the synchronous method
 In Asynchronous communication (UART, RS-232),
– the synchronization is achieved only at the beginning of the
transmission (by setting the same baud rate)
– A single byte of data is transferred at a time
– Is widely used for character-oriented transmission
✗ To transfer data in serial communication, the receiver and sender agree on
set of rules called protocol. By Kassahun Tamir 15
Serial Communication Interfaces: UART
 UART (Universal Asynchronous Receiver Transmitter):
– A UART may be used when:

High speed is not required

An inexpensive communication link between two devices is required
– UART communication is very cheap:

Single wire for each direction (plus ground wire)

Asynchronous because no clock signal is transmitted

Relatively simple hardware

By Kassahun Tamir 16
Serial Communication Interfaces: UART

GPS: NEO-6M

By Kassahun Tamir 17
Serial Communication Interfaces: UART
 Before transmission begins, transmitter and receiver must agree on:
– Baud rate (such as, 9600): an indirect way of setting sampling
clock.

In synchronous transmission, bits are sampled from a pulse
every one time period. Whereas in the case of asynchronous
communication such as UART, we set the sending and the
receiving ends with the same baud rate so that the receiver
know how often to sample the pulse. For example, without
baud rate the first three 1s in the following picture could have
been interpreted as four or two or another different number of
1s.

By Kassahun Tamir 18
Serial Communication Interfaces: UART
 Before transmission begins, transmitter and receiver must agree on:
– Baud rate (such as, 9600): an indirect way of setting sampling
clock. GSM: SIM900A
– Stop bits: to declare end of frame
– 1, 1.5, or 2 stop bits
– 5, 6, 7, or 8 data bits GPS: NEO-6M

– Even, odd or no parity bits:


to check for transmission error
 Application:
– MCU to PC, MCU to GPS, or
GSM, or bluetooth module
By Kassahun Tamir 19
Serial Communication Interfaces: RS-232
 RS232 (Recommended Standard 232):
✗ It is based on UART protocol, with the following small
differences
– RS-232 has higher voltage levels: the 1s and 0s are
expressed in a unique way. 1 ranges from -3V to -25V
and 0 ranges form +3V to +25V. Even though the signal
might get corrupted, still, the receiver will be able to
read the exact binary representation. For example, if the
+20V data is corrupted and changed to +15V, still, it is a
binary 0.
– Use MAX232 IC to interface with
By Kassahun Tamirmicrocontrollers. 20
Serial Communication Interfaces: RS-232
 RS232 (Recommended Standard 232):
– Since the high voltages of RS-232 are too high for Embedded
System devices, they are converted into 0V to 5V level
using level shifter IC
– Is a bi-directional point-to-point communication
– Two independent channels are established for two-way
(full-duplex) communications.
– 40kbyte per second: slow based on today’s standard
– Max length of the cable is about 50ft: wire resistance
and voltage drop become an issue with cable longer
than this By Kassahun Tamir 21
Serial Communication Interfaces: RS-232
 RS232 (Recommended Standard 232):
DB-25
DB -9
DCE: Data Communication Equipment

DTE: Data Transmission Equipment

PIN No Pin Name Pin Description


1 CD (Carrier Detect) Incoming signal from DCE
2 RD (Receive Data) Receives incoming data from DTE
3 TD (Transmit Data) Send outgoing data to DCE
4 DTR (Data Terminal Ready) Outgoing handshaking signal
5 GND (Signal ground) Common reference voltage
6 DSR (Data Set Ready) Incoming handshaking signal
 Application: 7 RTS(Request to Send) Outgoing signal for controlling flow
8 CTS(Clear to Send) Incoming signal for controlling flow
– Computer-Printer 9 RI(Ring Indicator)
By Kassahun Tamir Incoming signal from DCE 22
Serial Communication Interfaces: RS-232
 RS485 (Recommended Standard 485):
– RS-485 line can be shared in Multidrop mode
– Connects up to 4000ft
– It allows high data rate communications over long distances in
real world environment
– Terminator resistors avoid reflected signal
– Uses half-duplex configuration for data collection and
Master/slave layouts.
– Since the reference voltage is
the reverse of itself, it is immune
to voltage drop By Kassahun Tamir 23
RS-232 vs RS-485
 The architectural difference between RS-232 and RS-485 is that 232 is
a bi-directional point to point link, whereas 485 is a single channel
bus.
 Electrically, each 232 signal uses a single wire with symmetric
voltage about a common ground wire. 485 uses two wires to carry the
single signal difference
 The big difference to the software is that only one device on a 485 bus
can transmit at a time, whilst there is not similar limitation on RS232
because is a peer-to-peer link.
✗ When a high speed serial communication is required for a longer
distance, use RS485.

By Kassahun Tamir 24
Serial Communication Interfaces: I C 2

 I2C (Inter-Integrated Circuit):


✗ I2C has a two wires bus which interconnect all devices

By Kassahun Tamir 25
Serial Communication Interfaces: I C 2

 I2C (Inter-Integrated Circuit):


✗ I2C has a two wires bus which interconnect all devices

Top to bottom,
✗ Black for GND
✗ Red for V+
✗ White for SDA
✗ Green for SCL

STEMMA- Soil
Moisture Sensor

By Kassahun Tamir 26
Serial Communication Interfaces: I C 2

 I2C (Inter-Integrated Circuit):


✗ I2C has a two wires bus which interconnect all devices
✗ Devices in a I2C network has a role:

Master: is the head of the bus and has the responsibility of
starting a communication; only one master can be present in a
I2C network and is in general a MCU

Slave: all the other devices which “respond” to
master solicitations.

By Kassahun Tamir 27
Serial Communication Interfaces: I C 2

 I2C (Inter-Integrated Circuit):


✗ ACK/NACK bit gives confirmation that each frame is transferred
successfully.
✗ The I2C wires have the following meaning:

SDA (Serial Data): bidirectional; here data bits flow serially
(one bit at a time)

SCL (Serial Clock): unidirectional from master to slaves; it
holds the timing of the transition
✗ Therefore I2C is a synchronous interface which (according to
standards) can reach the max speed of 400 Kbps
✗ It is a slow speed protocol as compared to SPI communication.
By Kassahun Tamir 28
Serial Communication Interfaces: I C 2

 Application:
– Sensors: MCU to most of temperature, or moisture, or pressure
sensors
– Memory: accessing external EEPROM

By Kassahun Tamir 29
Serial Communication Interfaces: SPI
 SPI (Serial Peripheral Interface):
✗ Synchronous serial communication
✗ Devices communicate in master/slave mode where the master
device initiates the data frame. Multiple slave devices are allowed
with individual slave select-SS (chip select-CS) lines
✗ No address decoding logic required, as there is a chip select line
for each slave.
✗ Master generates information on one line (MOSI/SDO) while
samples (read) from another line (MISO/SDI)
 MOSI - Master Output Slave Input (Serial Data Out - SDO)
 MISO – Master Input Slave Output (Serial Data In - SDI)
By Kassahun Tamir 30
Serial Communication Interfaces: SPI
 SPI (Serial Peripheral Interface):
✗ Full duplex
✗ High throughput than I2C
✗ High speed
✗ Not limited to 8-bit words

By Kassahun Tamir 31
Serial Communication Interfaces: SPI

By Kassahun Tamir 32
Serial Communication Interfaces: SPI
 Application:
– Sensors: temperature, pressure, ADC, touchscreens,
video game controllers
– Memory: Flash and EEPROM

By Kassahun Tamir 33
Serial Communication Interfaces: USB
 USB (Universal Serial Bus):
✗ A common interface that is used to allow communication between
different peripheral devices like mice, digital cameras, printers,
keyboards, and many more with a host device such as PC or smart
phone.
✗ The host is the organizer and master of all traffic on the bus
✗ Intended to allow hot swapping and enhance plug-and-play.
✗ Older once: Type A and Type B
✗ Newer once: Mini-USB, Micro-USB, and USB-C cables

By Kassahun Tamir 34
Serial Communication Interfaces: USB
 USB: Pin Configuration
✗ Pin1 (VBUS): It is red color wire, used for providing power supply
✗ Pin2 (D-): It is a differential pair pin available in white color, used for
connectivity of USB
✗ Pin3 (D+): It is a differential pair
pin available in green color, used
for connectivity of USB
✗ Pin4 (GND): It is a Ground pin,
available in black color.

By Kassahun Tamir 35
Serial Communication Interfaces: USB
 USB (Universal Serial Bus):
Differential Signaling
Single-Ended Signaling

Source: ALL About Circuits

By Kassahun Tamir 36
Serial Communication Interfaces: USB
 USB: Protocol Architecture
✗ To accommodate a large number of devices that can be added or
removed at any time, the USB has the tree structure shown below.

USB HUB

By Kassahun Tamir 37
Reading Assignment
 From Microcomputer and Interfacing
✗ Digital to Analog and Analog to Digital Converters (ADC/DAC)
✗ Timers (PLL), Real time clock (RTC, Oscillators), Capture and
Compare

By Kassahun Tamir 38
Debugging
 Bed of nails tester: named by analogy with a real world bed of nails
Bed of nails tester PCB

A bed of ’real’ nails

By Kassahun Tamir 39
spring-loaded pogo pins
JTAG
 JTAG (Joint Test Action Group):
 As pin density increased, Bed of Nails testers became no longer
feasible.

 Different European vendors came together and decided to have a


common standard, because a designer might use different ICs from
different vendors, and if there had not been one testing standard, we
would have had plenty of techniques which would intern make
engineers life difficult.

 Boundary scan standard aka JTAG: IEEE 1149.1


By Kassahun Tamir 40
JTAG
 Silicon vendors in order to support IEEE1149.1, they add cells in
between the external pins (the outside world) and the core logic of the
device whatever it may be, be it a microprocessor, FPGA, or CPLD.
 Modern devices have have this extra silicon for JTAG boundary scan.
 These extra cells, Boundary Scan Cells, can be either used to read
values from the pins or write values to the pins.
 The standard defines instruction that can be used to perform:
✗ Functional Tests
✗ Interconnect tests

By Kassahun Tamir 41
Boundary Scan Architecture

Test Access Port

Connection Test
Source: CORELIS

By Kassahun Tamir 42
ISP/ ICSP
 In-System Programming (ISP) aka In-Circuit Serial Programming
(ICSP)
 In-Circuit Serial Programming (ICSP) is used to program and debug
our devices without removing them from the circuit.
 ICSP allows us to connect without removing them from the
microcontroller pins that support serial communication and transfer
data and commands through a simple protocol.
 It is microchip’s proprietary method of programming the completer
rage of “reprogrammable” microcontrollers and is present in every
microchip device.

By Kassahun Tamir 43
ISP and ICSP

Status (LED color) Function of LED


Programmer Board pin PIC18F452
Power (Green) The PICKit3 powered via the USB
port MCLR (12V) 1
Active (Blue) PICKit3 is connected to the PC, VCC 11
and communication link is active
GND 12
Busy (Yellow) PICKIt3 is busy in performing some
functions, such as programming a PGD (data) 40
microcontroller PGC (clock) 39
Error (Red) The PICKit3 programmer has
By Kassahun Tamir 6 No connection
44
encountered an issue
Individual Assignment
 For the following serial communication protocols, write about:
✗ Their architecture
✗ Their way of communication
✗ What makes them different from other serial protocols
✗ Application area

 Serial communication protocols:


i. CAN – Controller Area Network
ii. Microwire

By Kassahun Tamir 45
Questions?

By Kassahun Tamir 46

You might also like