The document discusses various topics related to embedded systems and microcontrollers including:
- Architectures like Von Neumann, Harvard and modified Harvard
- Types of microcontrollers like 8-bit, 16-bit and 32-bit
- Programming languages and IDEs used for embedded programming
- Common development boards and microcontrollers
- Memory types, buses, I/O and basic operation of microcontrollers
- Interfacing sensors and actuators to microcontrollers
6. Arduino IDE
Energia
Python IDE
IAR workbench
Keil
CCS
Xilinx ISE/Vivado web edition
7. Arduino
Raspberry Pi
8051 development board
PIC development board
Tiva C series
STM32F4
Many more…..
8. There are different programming styles
available to use or we can create it by mixing
one in another. Standards available languages
are:
◦ Assembly level: Board specific
◦ Embedded c: Generalized with common instructions
11. Temperature sensor module
Vibration switch module
Hall magnetic sensor module
Key switch module
Infrared emission sensor module
Small passive buzzer module
Laser sensor module
3-color full-color LED SMD modules
Optical broken module
Etc..many more available on:
https://tkkrlab.nl/wiki/Arduino_37_sensors
12. Unsigned Integers
◦ All eight bits represent the magnitude of a number
Bit7 to Bit0
◦ Range 00H to FFH (010 to 25510)
12
13. Signed Integers
◦ 2's Complement
Bit7 is sign bit
◦ Positive numbers: 00H to 7FH (010 to 12710)
◦ Negative numbers: 80H to FFH (-110 to -12810)
13
14. Binary Coded Decimal Numbers (BCD)
◦ 8-bit number divided into two groups of four
Each group represents a decimal digit from 0 to 9
◦ AH through FH are invalid
◦ Example: 0010 0101BCD = 2510
14
15. American Standard Code for Information
Interchange (ASCII)
◦ 7-bit alphanumeric code with 128 combinations
(00H to 7FH)
◦ Represents English alphabet, decimal digits from 0
to 9, symbols, and commands
15
16. Which is easy?
Assembly Language Embedded C Language
17.
18.
19. Meeting the computing needs of the task
efficiently and cost effectively
Speed, the amount of ROM and RAM, the
number of I/O ports and timers, size,
packaging, power consumption
Easy to upgrade
Cost per unit
Availability of software development tools
Assemblers, debuggers, C compilers,
emulator, simulator, technical support
Wide availability and reliable sources of the
microcontrollers.
20. A Harvard Architecture (separate
instruction/data memories)
Single chip Microcontroller(µC)
Developed by Intel in 1980 for use in
embedded systems.
Today largely superseded by a vast range
of faster and/or functionally enhanced
8051-compatible devices manufactured
by more than 20 independent
manufacturers
21. Feature 8051 8052 8031
ROM (program space in bytes) 4K 8K 0K
RAM (bytes) 128 256 128
Timers 2 3 2
I/O pins 32 32 32
Serial port 1 1 1
Interrupt sources 6 8 6
Comparison of the 8051
Family
26. Input Devices
◦ Switches and Keypads
◦ Provide binary information to the MPU
Output devices
◦ LEDs and LCDs
◦ Receive binary information from the MPU
26
27. MPU communicates with Memory and I/O
using the System Bus
◦ Address bus
Unidirectional
Memory and I/O Addresses
◦ Data bus
Bidirectional
Transfers Binary Data and Instructions
◦ Control lines
Read and Write timing signals
27
29. Machine Language
◦ Binary Instructions
◦ Difficult to decipher and write
Error-prone
◦ All programs converted into machine language for
execution
29
Instructio
n
He
x
Mnemoni
c
Description Processor
1000000
0
80 ADD B Add reg B to Acc Intel 8085
0010100
0
28 ADD A,
R0
Add Reg R0 to
Acc
Intel 8051
0001101
1
1B ABA Add Acc A and B Motorola
6811
30. Assembly Language
◦ Machine instructions represented in mnemonics
◦ One-to-one correspondence
◦ Efficient execution and use of memory
◦ Machine-specific
30
31. High-Level Languages
◦ BASIC, C, and C++
◦ Written in statements of spoken languages
◦ Machine independent
◦ Easy to write and troubleshoot
◦ Larger memory and less efficient execution
31
32.
33. RISC CPUs
◦ 8-bit
◦ 16-bit
Number of I/O pins: 4-70
Memory types and sizes:
◦ Flash; OTP; ROM
◦ 0.5k – 256k
35. Download @ http://microchip.com
Assembly compiler for programming PICs
Based on specific PIC instruction set
36. PIC: Elements of a
digital controller
CPU
Central
Processing
Unit
Input
Peripherals
Output
Peripherals
ROM
Read Only
Memory
RAM
Read & Write
Memory
Program
download
User
input
User
output
The microcontroller contains all these elements in one chip
41. Developed at Acorn Computers Limited,
of Cambridge, England,
between 1983 and 1985
Problems with CISC:
Slower then memory parts
Clock cycles per instruction
41
43. Enhancements:
Each instruction controls the ALU and shifter
Auto-increment
and auto-decrement addressing modes
Multiple Load/Store
Conditional execution
43
44. Floating Point Processor-Ex.TMS320F28335
Fixed Point Processor-Ex.TMS320F6745
46. Simple logic gates
◦ combine transistors to
implement combinational
and sequential logic
Interconnect
◦ wires to connect inputs and
outputs to logic blocks
I/O blocks
◦ special blocks at periphery
for external connections
Add wires to make connections
◦ done when chip is fabbed
“mask-programmable”
◦ construct any circuit
47. Logic blocks
◦ to implement combinational
and sequential logic
Interconnect
◦ wires to connect inputs and
outputs to logic blocks
I/O blocks
◦ special logic blocks at periphery
of device for external connections
Key questions:
◦ how to make logic blocks programmable?
◦ how to connect the wires?
◦ after the chip has been fabbed
48. Soft-core are available with FPGA /ASIC’s and
SoC.
◦ ARM processor
◦ Microblaze processor
49. Implementation of random logic
◦ easier changes at system-level (one device is modified)
◦ can eliminate need for full-custom chips
Prototyping
◦ ensemble of gate arrays used to emulate a circuit to be
manufactured
◦ get more/better/faster debugging done than possible with
simulation
Reconfigurable hardware
◦ one hardware block used to implement more than one function
◦ functions must be mutually-exclusive in time
◦ can greatly reduce cost while enhancing flexibility
◦ RAM-based only option
Special-purpose computation engines
◦ hardware dedicated to solving one problem (or class of
problems)
◦ accelerators attached to general-purpose computers
50. Complete ARM®-based processing system
◦ Application Processor Unit (APU)
Dual ARM Cortex™-A9 processors
Caches and support blocks
◦ Fully integrated memory controllers
◦ I/O peripherals
Tightly integrated programmable logic
◦ Used to extend the processing system
◦ Scalable density and performance
Flexible array of I/O
◦ Wide range of external multi-standard I/O
◦ High-performance integrated serial transceivers
◦ Analog-to-digital converter inputs
51.
52. The Zynq-7000 AP SoC architecture consists
of two major sections
◦ PS: Processing system
Dual ARM Cortex-A9 processor based
Multiple peripherals
Hard silicon core
◦ PL: Programmable logic
digital logic design
53.
54. Three basic modes:
◦ 1. Continuous dedicated monitoring of the sensor
by the microprocessor
◦ 2. Polling the sensor
◦ 3. Interrupt mode
55. Microprocessor is dedicated for use with the
sensor
Its output is monitored by the microprocessor
continuously
The microprocessor reads the sensor’s output
at a given rate
Output is then used to act
56. Sensor operates as if the microprocessor did
not exist.
Its output is monitored by the microprocessor
The microprocessor reads the sensor’s output
at a given rate or intervals - poling
Output is then used to act
57. Microprocessor is in sleep mode
Outputs of the sensor are not being
processed
Upon a given event, microprocessor wakes up
through one of its interrupt options
The sensor activates the interrupt
58. Interrupts can be timed
Interrupts can be issued by sources other
than the sensor
The microprocessor may be involved in other
functions, separate from the sensor, such as
control of an actuator
Feedback from actuators may also be used to
perform interrupts
62. Basic level: zero to Vdd
◦ Must scale signals if necessary
No dual polarity signals
◦ Must translate/scale as necessary
Direct reading or A/D
Can read voltages only
◦ AC or DC
◦ Limitations in frequency
63. P are high input impedance devices
◦ ~ 1 - 10 M
◦ Input current - < 1 A.
Ideal for direct connection of low
impedance sensors (magnetic, thermistors,
thermoelectric, etc.)
High impedance sensors (capacitive,
pyroelectric, etc.) must be buffered
◦ Voltage followers
◦ FET amplifiers
64. Most sensors are slow devices
◦ Can be interfaced directly
◦ No concern for response and frequency range
Some sensors are part of oscillators
◦ Frequencies may be quite high
◦ Need to worry about proper sampling by the
microprocessor
65. Example: 10 mHz P, cycle time of 0.4 s.
(most processor divide the clock frequency
by a factor - 4 in this case)
Any operation such as reading an input
required n cycles, say n=5
Effective frequency: 0.5 MHz
Sampling cannot be done at rates higher
than 250 kHz
Any sensor producing a signal above this
frequency will be read erroneously
66. Some solutions:
◦ Divide the sensor’s frequency
Reduces sensitivity
Must be done externally to the P
◦ F-V converter
Introduces conversion errors
Must be done externally
◦ Frequency counter at input
Use output of the counter as input to mP.
Expensive
◦ Faster microprocessors
67. Offset
◦ Primarily for dc levels
◦ Can be offset up or down
◦ Usually done to remove the dc level
◦ Sometimes needed to remove negative polarity.
◦ AC signals may sometimes be coupled through
capacitors to eliminate dc levels
68. Example
◦ Thermistor: 500 at 20ºC
◦ Varies from 100 to 900 for temp. between 0
and 100ºC
69. At 500ºC
◦ V = (12/1500)*500 = 4 V
At 0ºC
◦ V = (12/1400)*400 = 3.428 V
At 100ºC
◦ V = (12/1900)*900 = 5.684 V
V varies between 3.428V and 5.684V
◦ 5.684V is above the 5V operating voltage of the
microprocessor
70. Errors introduced by the microprocessor:
◦ Due to resolution of A/D, D/A
◦ Sampling errors
These come in addition to any errors in the
sensor/actuator
71. Most microprocessors are 8 bit
microprocessors
Integer arithmetics
Largest value represented: 256
Roundoff errors due to this representation
Special math subroutines have been
developed to minimize these errors
(otherwise they would be unacceptably high)
72. All inputs and outputs on a microprocessor
are sampled. That is:
◦ Inputs are only read at intervals
◦ Outputs are only updated at intervals
◦ Intervals depend on the frequency of the clock, operation to
be executed and on the software that executes it
◦ Sampling may not even be constant during operation because
of the need to perform different tasks at different times
◦ Errors are due to changes in input/output between sampling
to which the microprocessor is oblivious
◦ Errors are not fixed - depend among other things on how
well the program is written
73.
74. There are lots of application use
microcontroller some of them are given
below:
◦ CAR
◦ Refrigerator
◦ Airplane
◦ Trains
◦ Medical devices, etc.
Some example will be explained in Last slides.
78. Microcontroller and Microprocessor
Digital System
Signal and System(Z transform and Filter
Designing)
Digital Signal Processing
Networking
Control system
Basic analog design