COMMONLY USED EMBEDDED SYSTEMS
Dr. Rafia Mumtaz
CONTENTS
Microprocessor Vs Microcontroller
Arduino
Raspberry Pi
Nvidia Nano Jetson
LEARNING OBJECTIVES
To understand the difference between micro processor and micro controller
To learn the hardware architecture and programming environment on Arduino
To understand the Raspberry pi architecture and its various features
To learn architecture and application areas of Nvidia Nano Jetson
MICROPROCESSOR VS MICROCONTROLLER
www.mikroe.com/chapters/view/1
MICROPROCESSOR VS MICROCONTROLLER
Microprocessor Microcontroller
IC which has only the CPU inside them i.e. only CPU, in addition with a fixed amount of RAM, ROM
processing power such as Intel's Pentium 1,2,3,4 and other peripherals all embedded on a single chip
or core 2 due, i3, i5 and i7 and so on
Termed as a mini computer or a system on a single
chip.
No RAM, ROM and other peripheral on the chip
Designed to perform specific tasks and embedded in
device they control
Application includes Desktop PC's Laptops,
notepads, any computation systems, and network Since the applications are very specific, they need
communications. small resources like RAM, ROM, I/O ports etc
WHAT IS ARDUINO?
A microcontroller board, contains
• On-board power supply,
• USB port to communicate with PC, and
• An Atmel microcontroller chip
It simplifies the process of creating any control system by providing the standard board that can be
programmed
Connected to the system without the need to any sophisticated PCB design and implementation
It is an open source hardware
TYPES OF ARDUINO BOARDS
TYPES OF ARDUINO BOARDS CONTD..
ARDUINO UNO
FIRMWARE
Two types of code executing on a simple microcontroller:
• Application code
• Execute the system main functionality
• We write this code
• Firmware
• Low-level code: support the main function
• USB interface, power modes, reset etc
Arduino firmware is pre-programmed
BOOTLOADER
Firmware on a microcontroller
Allows the Flash and EEPROM to be programmed
Manages USB communication since application
programming is via USB
IN- CIRCUIT SERIAL PROGRAMMING (ICSP)
A special programming method to program
the firmware
Needed because the bootloader cannot re-
program itself
Bootloader cannot be re programmed using
USB interface
ICSP are special pins on Arduino board that
are used to program the bootloader
ARDUINO SCHEMATIC
Arduino designs are
open source
Design is available
You can build your own
FEATURES
Microcontroller: ATmega328.
Operating Voltage: 5V.
Input Voltage (recommended): 7-12V.
Input Voltage (limits): 6-20V.
Digital I/O Pins: 14 (of which 6 provide PWM output)
Analog Input Pins: 6.
• Flash memory: 32 KB( ATmega328) out of
DC Current per I/O Pin: 40 mA. which 0.5 KB is used for the bootloader
DC Current for 3.3V Pin: 50 mA. • SRAM: 2KB ( ATmega328)
• EEPROM: 1KB ( ATmega328)
• Clock speed: 16 MHz
ARDUINO IDE
See: http://arduino.cc/en/Guide/Environment for more information
SELECT SERIAL PORT AND BOARD
SELECTING EXAMPLES
STATUS MESSAGES
DIGITAL INPUT/OUTPUT
Digital IO is binary valued—it’s
either on or off, 1 or 0
1
Internally, all microprocessors are 0
digital, why?
Computers don’t really do analog,
they quantize
TERMINOLOGY
USING ARDUINO
ARDUINO DIGITAL I/0
pinMode(pin, mode)
Sets pin to either INPUT or OUTPUT
digitalRead(pin)
Reads HIGH or LOW from a pin
digitalWrite(pin, value)
Writes HIGH or LOW to a pin
Electronic stuff
Output pins can provide 40 mA of current
Writing HIGH to an input pin installs a 20KΩ pullup
www.mikroe.com/chapters/view/1
ARDUINO TIMING
• delay(ms)
– Pauses for a few milliseconds
• delayMicroseconds(us)
– Pauses for a few microseconds
• More commands:
arduino.cc/en/Reference/HomePage
OUR FIRST PROGRAM
IO PINS
Image from Theory and Practice of Tangible User Interfaces at UC Berkley
ANALOG OUTPUT
Image from Theory and Practice of Tangible User Interfaces at UC Berkley
• Analog output can be simulated using pulse width modulation (PWM)
PULSE WIDTH MODULATION
Pulse Width Modulation, or PWM, is a technique for
getting analog results with digital means
Can’t use digital pins to directly supply say 2.5V, but
can pulse the output on and off really fast to
produce the same effect
The on-off pulsing happens so quickly, the
connected output device “sees” the result as a
reduction in the voltage
Image from Theory and Practice of Tangible User Interfaces at UC Berkley
PWM DUTY CYCLE
output voltage = (on_time / cycle_time) * 5V
Fixed cycle length; constant number of cycles/sec
PWM PINS
• Command:
analogWrite(pin,value)
• value is duty cycle: between 0
and 255
• Examples:
analogWrite(9, 128)
for a 50% duty cycle
analogWrite(11, 64)
for a 25% duty cycle
Image from Theory and Practice of Tangible User Interfaces at UC Berkley
SERIAL COMMUNICATION
Image from http://www.ladyada.net/learn/arduino/lesson4.html
SERIAL COMMUNICATION
todbot.com/blog/bionicarduino
SERIAL COMMUNICATION
• Compiling turns your program into binary
data (ones and zeros)
• Uploading sends the bits through USB
cable to the Arduino
• The two LEDs near the USB connector
blink when data is transmitted
• RX blinks when the Arduino is receiving
data
• TX blinks when the Arduino is
transmitting data
todbot.com/blog/bionicarduino
OPEN THE SERIAL MONITOR AND UPLOAD THE PROGRAM
SOME COMMANDS
• Serial.begin()
- e.g., Serial.begin(9600) Baud Rate:
Sets the data rate in bits per second (baud)
• Serial.print() or Serial.println() for serial data transmission
- e.g., Serial.print(value)
• Serial.read()
• Serial.available()
• Serial.write()
• Serial.parseInt()
HOW TO GET STARTED?