Csci 3575 Lec 02
Csci 3575 Lec 02
PROF. HAMID
09/05/2024
EMBEDDED SYSTEMS
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
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.
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
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
Metro
Development
Board
LAB KIT Metro Mini ATmega 328p
Development microcontroller
Board
ATMEGA 328P MICROCONTROLLER
$1,000
$1.70
$50
$100,000,000
METRO MINI 328 DEVELOPMENT BOARD
ATmega328p
Microcontroller
RESET switch
USB connector
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
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
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!
• 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
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
https://learn.adafruit.com/experimenters-guide-for-metro/intro
Download and install the Arduino Software. [5 points]
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/#