0% found this document useful (0 votes)
9 views32 pages

Csci 3575 Lec 02

Uploaded by

thien ong
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)
9 views32 pages

Csci 3575 Lec 02

Uploaded by

thien ong
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/ 32

CSCI3575: EMBEDDED SYSTEMS

PROF. HAMID
09/05/2024
EMBEDDED SYSTEMS

 Embedded systems refer to single-function devices.


 Embedded systems can be found in watches, MP3 players, vending machines, and more.
 In these examples, a full computer would be detrimental to the operation of the device.
MICRO-CONTROLLER

 A microcontroller acts as the brain of an Embedded


System.

 A microcontroller is a microprocessor that includes


memory and I/O functionality.
MICRO-CONTROLLER

 Each of the microcontrollers listed in the Table has a


specific instruction set, their own set of peripheral
devices and I/O pins, and are generally not
interchangeable.
ATMEGA 328P
HOW TO CHOOSE A MICRO-CONTROLLER

 Speed
 Power consumption
 Memory
 Peripherals (timers, ADC, etc.)
 Number of I/O pins
 Ease of upgrade
 Cost
 Additional Accessories
 An available assembler
 A debugger
 A compiler for high-level programming languages such as C/C++
 Technical support etc…

https://learn.adafruit.com/how-to-choose-a-microcontroller?view=all
A COMMON MICRO-CONTROLLER FOR THE CLASS

 Microcontrollers are described in terms of the number


of bits the CPU can process or move in and out of
memory at once.
 The major flavors these days are 8-bit and 32-bit
devices.
 The Arduino Uno and the Adafruit Metro 328 (Uno
compatible) are the most common boards in the 8-bit
market with lots of software available.
ATMEL AVR MICROCONTROLLER & ARDUINO

 AVR ATmega328P
 It is packaged in an Arduino Uno which contains extra features including (but not limited to):
 power regulator,
 bootloader,
 USB connection,
 I/O pins connected to headers,
 and the availability of the Arduino IDE for writing C/C++ code.

 Arduino is a relatively inexpensive microcontroller package

https://store-usa.arduino.cc/products/arduino-uno-rev3
https://www.adafruit.com/product/2488
ATMEGA 328P
 High Performance, Low Power Atmel AVR 8-Bit Microcontroller Family
 Advanced RISC Architecture
 32 * 8 bit General Purpose Registers
 Up to 20 MIPS Throughput at 20MHz

 High Endurance Non-volatile Memory Segments


 32KBytes Flash program memory (non-volatile)
 1KBytes EEPROM
 2KBytes Internal SRAM
 Write/Erase Cycles: 10,000 Flash/100,000 EEPROM
 Data retention: 20 years at 85◦C/100 years at 25◦C
MICRO-CONTROLLER BLOCK DIAGRAM (OVERSIMPLIFIED)
Reading:
Datasheet,
Section 2 and
6.1,6.2
OVERVIEW OF MEMORY HIERARCHY

32, 8-bit registers

Data SRAM, Flash

EEPROM

https://notes.joeyh.dev/cs132/memory.html
https://barrgroup.com/blog/types-memory-embedded-systems
ATMEGA 328P PERIPHERALS

 Peripheral Features
 Analog to Digital Converters
 External Interrupts
 8- and 16-Bit Timers
 Watchdog Timer
 USART (Universal synchronous/asynchronous receiver/transmitter)
 SPI (Serial Peripheral Interface),
 TWI (Two-Wire Interface) Serial Communication
ATMEGA 328 VS ATMEGA 328P

 Atmega328P consumes lower power than Atmega328.


 https://www.wellpcb.com/Atmega328p-vs-Atmega328.html
PROTOTYPING KIT

To hack @ home, &


return before the final
exam
PROTOTYPING KIT
ATmega 328p
microcontroller

Metro
Development
Board
LAB KIT Metro Mini ATmega 328p
Development microcontroller
Board
ATMEGA 328P MICROCONTROLLER

Metro Development Board


COMPUTING MACHINES … WHAT’S THE DIFFERENCE?

$1,000

$1.70

$50
$100,000,000
METRO MINI 328 DEVELOPMENT BOARD

Metro 328P Development Board


METRO MINI 328 DEVELOPMENT BOARD

ATmega328p
Microcontroller

This popular chip has


• 32KB of flash
• (1/2 KB is reserved for the bootloader),
• 2KB of RAM, clocked at 16MHz
METRO MINI 328 DEVELOPMENT BOARD

RESET switch

USB connector

● We need to be sure that we interface with


the board safely by not pumping in too
much voltage or attempting to draw too
much current.

Power port

https://www.hackerearth.com/blog/developers/a-tour-of-the-arduino-uno-board/
POWER

USB port: This port used to load a program from the Arduino IDE onto the Arduino board. The board can also be powered through this port.

Power port: The Arduino board can be powered through an AC-to-DC adapter or a battery. The power source can be connected by plugging in a
2.1mm center-positive plug into the power jack of the board.

Reset switch: When this switch is clicked, it sends a logical pulse to the reset pin of the Microcontroller, and now runs the program again from
the start. This can be very useful if your code doesn’t repeat, but you want to test it multiple times.

We may power the METRO with 7-9V polarity protected DC or the micro USB connector to any 5V USB source. The 2.1mm DC jack has an
on/off switch next to it so you can turn off your setup easily. The METRO will automagically switch between USB and DC.

Voltage regulator: The Arduino UNO board operates at a voltage of 5 volts, but it can withstand a maximum voltage of 20 volts. If the board is
supplied with a higher voltage, there is a voltage regulator (it sits between the power port and USB connector) that protects the board from
burning out.
METRO MINI 328 DEVELOPMENT BOARD

RESET switch

USB connector

Voltage regulator

Power port

https://www.hackerearth.com/blog/developers/a-tour-of-the-arduino-uno-board/
METRO MINI 328 DEVELOPMENT BOARD

• 5V regulator can supply peak


~800mA as long as the die temp
of the regulator does not exceed
150*C
Vcc = 5 V • 3.3V regulator can supply peak
~150mA as long as the die temp
of the regulator does not exceed
150*C

• 5V logic with 3.3V compatible


inputs, can be converted to 3.3V
logic operation

Power Source

https://www.hackerearth.com/blog/developers/a-tour-of-the-arduino-uno-board/
METRO MINI 328 DEVELOPMENT BOARD

Digital pins
D0 ~ D13

Analog pins
A0 ~ A5

https://www.hackerearth.com/blog/developers/a-tour-of-the-arduino-uno-board/
GPIO: GENERAL PURPOSE INPUT/OUTPUT

 A general-purpose input/output (GPIO) is an uncommitted digital signal pin on an integrated circuit or


electronic circuit (e.g. MCUs/MPUs) board which may be used as an input or output, or both, and is
controllable by software.
 GPIOs have no predefined purpose and are unused by default.

 20 GPIO pins,
 6 of which are Analog, and
 2 of which are reserved for the USB-serial converter (D0, D1).
DIGITAL PINS

The two pins labeled 0 and 1 are the two Serial pins that are used to send data to and from the Arduino to the USB-Serial
translator chip.

Don't connect anything to Digital 0 or 1 unless you are super sure because it will affect your Metro's ability to
communicate!

• D2~D12 are normal every day digital pins.

• Pins # 3, 5, 6, 9, 10, 11 can do PWM output (Pulse-Width-Modulation)

• D 13 is a little special because it is also connected to the L LED. You can use this pin without affecting the Arduino just
be aware that the L LED will also blink at the same time.
METRO MINI 328 DEVELOPMENT BOARD

4 LEDs:
ON: A green LED, always on when the
board is powered

L: A red LED, connected to D13


through a 1K-ohm resistor

TX, RX: both are yellow LEDs.


TX stands for transmit, and RX for
receive. These are indicator LEDs which
blink whenever the UNO board is
transmitting or receiving data.
USEFUL LINKS

 https://learn.adafruit.com/adafruit-metro-
mini/pinouts?gclid=Cj0KCQjw9fqnBhDSARIsAHlcQYQ8Tw2PkhfqcjynttuGxI7quwdJEg5oP0MbhjZCWdi6Zr51i3
EMfkIaAikQEALw_wcB

 https://github.com/adafruit/Adafruit-METRO-328-PCB/blob/master/Adafruit%20Metro%20Mini%20Pinout.pdf
LAB 02.A PREPARATION

 Go to the following page:

 https://learn.adafruit.com/experimenters-guide-for-metro/intro
 Download and install the Arduino Software. [5 points]

 Complete the CIRC01 exercise in class. [5 points]


C++ AND NUMBER SYSTEM

 https://www.w3schools.com/cpp/default.asp
 Online Compiler: https://www.programiz.com/cpp-programming/online-compiler/

 https://en.wikipedia.org/wiki/Binary_number
 https://www.geeksforgeeks.org/binary-number-system/#

You might also like