Embedded Systems ECE 4010: - Dr. Mayank Gupta SEEE, VIT Bhopal
Embedded Systems ECE 4010: - Dr. Mayank Gupta SEEE, VIT Bhopal
ECE 4010
- Dr. Mayank Gupta
SEEE, VIT Bhopal
Module 1
2
ECS 4010
Choosing microcontroller for an
Embedded System - Steps
Step 1 - Make a list of required hardware interfaces
• Using the general hardware block diagram, make a list of all the
external interfaces that the microcontroller will need to support
• There are two general types of interfaces that need to be listed
• The first are communication interfaces - USB, I2C, SPI, UART, and so on
• The second type of interface is digital inputs and outputs, analog to digital
inputs, PWM’s, etc.
• These two interface types will dictate the number of pins that will
be required by the microcontroller
ECS 4010 3
Choosing microcontroller for an
Embedded System - Steps
ECS 4010 4
Choosing microcontroller for an
Embedded System - Steps
Step 2 - Examine the software architecture
• The software architecture and requirements can greatly affect the
selection of a microcontroller
• How heavy or how light the processing requirements will determine
whether you go with an 80 MHz DSP or an 8 MHz 8051
• Just like with the hardware, make notes of any requirements that will
be important
• For example, do any of the algorithms require floating point
mathematics? Are there any high frequency control loops or sensors?
ECS 4010 5
Choosing microcontroller for an
Embedded System - Steps
Step 2 - Examine the software architecture
• Estimate how long and how often each task will need to run
• Get an order of magnitude feel for how much processing power will
be needed.
• The amount of computing power required will be one of the biggest
requirements for the architecture and frequency of the
microcontroller
ECS 4010 6
Choosing microcontroller for an
Embedded System - Steps
Step 3 - Select the architecture
• Using the information from steps 1 and 2 an engineer should be
able to start getting an idea of the architecture that will be needed
• Can the application get by with eight-bit architectures? How about
16 bits? Does it require a 32-bit Arm core?
• Between the application and the required software algorithms
these questions will start to converge on a solution
• Don’t forget that microcontroller selection can be an iterative
process
ECS 4010 7
Choosing microcontroller for an
Embedded System - Steps
Step 3 - Select the architecture
• Don’t forget that microcontroller selection can be an iterative
process
• You may select a 16-bit part in this step but then in a later step find
that a 32-bit Arm part works better
• This step is simply to start getting an engineer to look in the right
direction
ECS 4010 8
Choosing microcontroller for an
Embedded System - Steps
Step 4 - Identify Memory Needs
• Flash and RAM are two very critical components of any microcontrollers
• Making sure that you don’t run out of program space or variable space
is undoubtedly of highest priority
• You can always start with more and then later move to a more
constrained part within the same chip family
• Using the software architecture and the communication peripherals
included in the application, an engineer can estimate how much flash
and RAM will be required for the application
ECS 4010 9
Choosing microcontroller for an
Embedded System - Steps
Step 5 - Start searching for microcontrollers
• Now that there is a better idea of what the required features of the
microcontroller will be the search can begin
• One place that can be a good place to start is with a microcontroller
supplier
• Most silicon providers have a search engine that allows you to enter
your peripheral sets, I/O and power requirements and it will narrow
down the list of parts that match the criteria
ECS 4010 10
Choosing microcontroller for an
Embedded System - Steps
Step 6 - Examine Costs and Power Constraints
• At this point the selection process has revealed a number of potential
candidates
• This is a great time to examine the power requirements and cost of the
part
• If the device will be powered from a battery and mobile, then making
sure the parts are low-power is precarious
• If it doesn’t meet power requirements, then keep weeding the list down
until you have a select few. Don’t forget to examine the piece price of the
processor either
ECS 4010 11
Choosing microcontroller for an
Embedded System - Steps
Step 7 - Check part availability
• With the list of potential parts in hand, now is a good time to start
checking on how available the part is
• Some of the things to keep in mind are what the lead times for the
part?
• What are your requirements for availability?
• Then there is a question of how new the part is and whether it will
be around for the duration of your product life cycle
ECS 4010 12
Choosing microcontroller for an
Embedded System - Steps
Step 8 - Select a development kit
• One of the best parts of selecting a new microcontroller is finding a
development kit to play with and learn the inner working of the
controller
• Once an engineer has settled their heart on the part, they want to
use they should research what development kits are available
• If a development kit isn’t available, then the selected part is most
likely not a good choice, and they should go back a few steps and
find a better part
ECS 4010 13
Choosing microcontroller for an
Embedded System - Steps
Step 9 - Investigate compilers and tools
• The selection of the development kit nearly solidifies the choice of
microcontroller
• The last consideration is to examine the compiler and tools that are
available
• Most microcontrollers have a number of choices for compilers,
example code and debugging tools
• It is important to make sure that all the necessary tools are
available for the part
ECS 4010 14
Choosing microcontroller for an
Embedded System - Steps
Step 10 - Start Experimenting
• Even with the selection a microcontroller nothing is set in stone
• Take advantage by building up test circuits and interfacing them to the
microcontroller
• Choose high risk parts and get them working on the development kit
• It may be that you discover the part you thought would work great has some
unforeseen issue that would force a different microcontroller to be selected
• In any event, early experimentation will ensure that you made the right
choice and that if a change is necessary, the impact will be minimal!
ECS 4010 15
Embedded System – Example
Washing Machine
• In today’s high- stress life a washing machine
has become a household necessity
• Washing machines are gradually emerging as
an omnipresent dhobi in Indian homes
• Of course, the market is flooded with washing
machines offering a range of operations
• From semi-automatic to fully automatic, from
top-load to tumble wash, these state-of-the-
art machines promise multifarious, user
friendly features at down to earth prices
ECS 4010 16
Embedded System – Example
Washing Machine
ECS 4010 17
Embedded System – Example
Washing Machine
• There are many acceptable ways of
representing the system
• It would be possible to consider the
display to be internal to the controller
and therefore not show it separately
• Similarly clock circuitry used to time
the operation of the machine is
considered here to be contained
within the controller
• It could equally well be considered as
an external component.
ECS 4010 18
Embedded System – Example
Washing Machine
ECS 4010 19
Embedded System – Example
Washing Machine
ECS 4010 20
Embedded System – Example
Washing Machine
• Hardware
1. A temperature sensor
2. A safety cut-out switch
3. Keyboard for program selection
4. Water level gauge
5. Motor for washing drum
6. Power switches for motor, heater
ECS 4010 21
Embedded System – Example
Washing Machine
• Hardware
7. Heater for washing water
8. Water inlet valve
9. Water suction pump
10. Control lamps and indicators
ECS 4010 22
Embedded System – Example
Washing Machine
ECS 4010 23
Embedded System –
Washing Machine
• Control Flow
Chart
(For modeling the
software)
ECS 4010 24
Embedded System – Example
Automatic Chocolate Vending Machine
• ACVM contains :
• Coin insertion slot and Keypad (on
the top of the machine) to insert the
coin according to the possible
denomination like 2, 5 rupees.
• Then after the coin is inserted, the
system directs each coin to the
particular port like port 2 and port 5
(coin sorter).
ECS 4010 25
Embedded System – Example
Automatic Chocolate Vending Machine
• It also contains an LCD unit on the top of the machine to display
menus, text entered into the ACVM and pictograms, welcome,
thank and other messages.
• Graphic interactions are also available on this machine. The
displays in the ACVM also show the current time and date.
• The delivery slot in the ACVM is used to collect the chocolate and
coins (if refunded).
• The internet connection port is provided so that the owner can
know the status of the ACVM sales from a remote location.
ECS 4010 26
Embedded System – Example
Automatic Chocolate Vending Machine
• Block Diagram of ACVM
ECS 4010 27
Embedded System – Example
Automatic Chocolate Vending Machine
• Specifications of ACVM – Hardware:
• The heart of an ACVM is a Microcontroller or ASIP (Application
Specific Instruction Set Processor)
• RAM is used for storing temporary variables and the stack, and
ROM for application codes, and the RTOS codes for scheduling the
tasks
• It also has flash memory for storing user preferences, contact data,
user address, a user date of birth, user identification code and
answers to frequently asked questions (FAQs)
ECS 4010 28
Embedded System – Example
Automatic Chocolate Vending Machine
• Specifications of ACVM – Hardware:
• Timer and Interrupt controller are also needed to control the
process of ACVM
• It has a TCP/IP port (Internet broadband connection) to the ACVM
for remote control and for providing the system status reports to
the owner
• It also has an ACVM specific hardware and a power supply
ECS 4010 29
Embedded System – Example
Automatic Chocolate Vending Machine
• Specifications of ACVM – Software:
• Software is required to handle the following:
• Read input from keypad, display text/graphics, control coins reader,
and control delivery port (to deliver the chocolate)
• In addition to these, we also need the TCP/IP stack communication
for remote control, and an RTOS (say, MUCOS), to run the ACVM
software
ECS 4010 30
Embedded System – Example
Room Temperature Controller
ECS 4010 31
Embedded System – Example
Room Temperature Controller
Functioning:
• Surrounding temperature is sensed by thermostat (includes a
temperature sensor)
• Sensed analog temperature is converted into digital voltage
• Processor compares the sensed value with set threshold values
• Accordingly turns on/off heater/AC
ECS 4010 32
Embedded System – Example
Room Temperature Controller
Functioning:
• The user uses keypad to enter desired temperature values which are
stored in the memory
• Processor displays user set temperature along with current
temperature on the LCD screen
• Code to perform the function of monitoring and controlling the
temperature is stored in the code memory (ROM)
• The processor reads the instruction from ROM and functions
accordingly
ECS 4010 33
Embedded System – Example
Room Temperature Controller
ECS 4010 34