Download - Micro-controllers for beginners
![Page 1: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/1.jpg)
![Page 2: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/2.jpg)
![Page 3: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/3.jpg)
• Embedded system is a special purpose system designed to perform one or few dedicated functions.
• It is usually Embedded as a part of complete device including hardware and mechanical parts (robots).
![Page 4: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/4.jpg)
• A general purpose system can do many different tasks depending on the running program.
![Page 5: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/5.jpg)
![Page 6: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/6.jpg)
Programmable Devices
ASIC
IC’s
![Page 7: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/7.jpg)
ASIC
1. Non-formal understanding
2. HDL (Formal) description
3. Verification
4. Logic synthesis
5. Gate level synthesis
6. Routing
7. Layout
![Page 8: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/8.jpg)
Programmable devices
• They do nothing unless they are programmed
1. FPGA(Field Programmable Gate Array)
2. Microcontrollers
![Page 9: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/9.jpg)
Microcontroller
![Page 10: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/10.jpg)
Microcontroller
• Is a common electronic building block
• Is a full computer inside a single IC chip
• Input circuitry -> MCU -> Output circuitry
• With a microcontroller you are in control, you decide :-
1. The function of the IC
2. For what the pins are used
3. What external devices the pins are connected to
![Page 11: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/11.jpg)
Where can I find a microcontroller?
![Page 12: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/12.jpg)
![Page 13: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/13.jpg)
Memory types
Volatile Non-volatile
Flash MemoryEEPROM
SRAM
![Page 14: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/14.jpg)
Memory Types
• Flash Memory:
Where you put your code.
• SRAM:
for variable storage and stack space during the runtime.
• EEPROM:
Access is slow; it serves as a form of secondary storage.
![Page 15: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/15.jpg)
Digital Input & Output
![Page 16: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/16.jpg)
Digital Input & Output
• Port = 8-pins
• Input only, output only, or bidirectional.
![Page 17: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/17.jpg)
Digital Input & Output
![Page 18: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/18.jpg)
What if the input signal is analogue???
• When using a photo transistor as a light sensor.
![Page 19: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/19.jpg)
Analogue comparator
• Compare them to each other or to a known reference voltage.
• When comparing is not sufficient we use ADC and DAC
![Page 20: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/20.jpg)
![Page 21: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/21.jpg)
Interrupt
• Signal indicating the need for attention
• Causes the processor to save its state and begin execution of interrupt handler.
Interrupt control
1. Enable global interrupt
2. Enable particular interrupt
3. Handler code
4. Facility to trigger the interrupt
![Page 22: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/22.jpg)
![Page 23: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/23.jpg)
Interrupt handling
• When the interrupt happens, an interrupt service routine is called.
• Maps interrupts to ISRs.
![Page 24: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/24.jpg)
Timer
• Magical register 8 or 16 bit.
![Page 25: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/25.jpg)
Timer
• Its value can increase automatically at defined rate.
• Take some actions automatically or inform the CPU upon certain conditions e.g. timer overflow, compare match, and input capture.
![Page 26: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/26.jpg)
CS2 CS1 CS0
0 0 0 stopped
0 0 1 Pck\8
0 1 0 Pck\64
0 1 1 Pck\256
1 0 0 Pck\1024
1 0 1 Tx falling
1 1 0 Tx rising
1 1 1 N\A
![Page 27: Micro-controllers for beginners](https://reader033.vdocuments.us/reader033/viewer/2022052602/559c07a11a28ab1e528b456a/html5/thumbnails/27.jpg)