Escolar Documentos
Profissional Documentos
Cultura Documentos
TOBIAS P. TUMBUAN
Nowadays
It is on your
Washing machine
Microwave
Mobile phone
ECU, etc.
Content
Microcontroller and microprocessor, Ch 1
Microcontroller Components, Ch 2
Processor
Memory
Digital I/O
Analog I/O
Programing Arduino
Arduino Microcontroller
Subject on microcontroller
The subject of microcontroller can be viewed from some perspective:
Hardware > Electrical engineering Function and how to use it
Register file
Accumulator arithmetic / logic
Index register addressing mode
Stack pointer
Storing address and possibly register
content during subroutine or
interrupt.
Processor core 2.
Control unit
Determine which operation should be
executed next and configure the data path
accordingly (Instruction register)
Instruction
CISC (Complex Instruction Set Computer)
RISC (Reduced Instruction Set Computer)
Architecture
Von Neuman: Program and data are stored together and accessed through the same bus. It may
generate conflict
Harvard Architecture: data and program are in separate memories and separate bus. It requires
more hardware.
Launchpad vs Arduino
Memory
Memory Types:
Register file scratch pad (small size), internal
Data memory large, external
Instruction memory large external
Memory - FYI
Memory
Volatile > Needs power to retain (hold) the data
Parameter SRAM DRAM
Method Flip-Flop Capacitor
Hardware 6 transistor 1 transistor + 1 capacitor
Chip size (=storage) Large Small
EPROM
Pull up resistor
Pin 13 is hard to be an internal input. It has a resistor and LED. Enabling the
pull up resistor will generate error. Please read:
https://www.arduino.cc/en/Tutorial/DigitalPins
Digital Output
Current sink and current source is up to 20 mA.
Give an attention to short circuit possibility.
Set the value before setting the pin. So that it has no possibility to
have floating output. Please ensure the problem may be risen due to
the existence of pull up resistor.
1N4004
Arduino output
2N2222L L
1k O O
Arduino GND A A
D D
Line GND
Driving a relay, dont forget to put the fly wheel diode.
Digital Output
LOAD
Driving an optoisolator
Analog Input ADC
Comparator
Analog Input ADC
Successive Approximation
Analog input
DIGITAL SYSTEM
Quantization
Discretization
Analog input
Analog Output DAC
Summing Amplifier
Analog Output DAC
R2R Ladder
PWM Output
PWM Output
top: top value frequency of PWM
cmp: compare value duty cycle
=
Typical:
R = 3.9K
C = 0.1uF
PWM Output
PWM Output H bridge
Advanced topic
Interrupt, counter and timer
(Its OK as long as you can employ it.)
Communication interfaces
(For mechatronics student, I suggest to understand (at least read) this
topic.)
The Arduino
Studying Arduino
To start studying Arduino, the following book might be very helpful.
http://www.me.umn.edu/courses/me2011/arduino/arduinoGuide.pdf
A more comprehensive (if not difficult) project might be seen on
http://www.maerivoet.org/website/software/arduino/manuals/arduino
/arduino-cookbook.pdf
If you do not understand the function, you may see the hand book
provided by Arduino.
https://playground.arduino.cc/uploads/Main/arduino_notebook_v1-
1.pdf
For PID freak
http://blog.solutions-cubed.com/pid-motor-control-with-an-arduino/