













Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This course introduces the core principles and applications of microcontrollers, focusing on architecture, instruction sets, and hardware–software integration. Students learn how microcontrollers are programmed and interfaced with memory, sensors, and peripherals to build functional embedded systems.
Typology: Lecture notes
1 / 21
This page cannot be seen from the preview
Don't miss anything!














Name: Neil Robert Membreve, M.Eng. Date:
Department of Electrical Engineering
[~]$ [1/21]
Figure: Arduino Uno SMD R3 (^) Figure: ATmega328P
[1. It’s the MCU in the Arduino UNO]$ [2/21]
[3. It’s the MCU in the Arduino UNO]$ [4/21]
Figure: Atmega328 block diagram [4. Atmega 328 architecture]$ [5/21]
■ Bit ■ Building Block of Memory ■ Stores 1 piece of Boolean information (0 or 1) ■ Byte - 8 Bits. Usually minimum unit for access ■ Embedded systems usually have a few kilobytes of memory ■ Memory is one of the limiting factors in embedded systems
[6. ATMEGA128 memory system]$ [7/21]
■ Computer Systems contain a mixture of memories ■ Memory considerations technology:
■ Capacity ■ Power ■ Speed/Latency ■ Price
Figure: Memory hierarchy: The memory hierarchy separates computer storage into a hierarchy based on response time. Fast memory is usually small and expensive. Embedded systems are usually limited to small memory
[7. ATMEGA128 memory system]$ [8/21]
■ Read-Modify-Write capability, i,.e, you can change pin direction, pin value, or pin pull-up resistor without affecting any other pins in the port ■ All AVR ports have: ■ bit-selectable pull-up resistors ■ bit-selectable tri-state outputs ■ schmitt trigger (i.e., comparator circuit) input buffers ■ are synchronized to the system clock to prevent metastability ■ have symmetrical DC drive capability
Figure: AVR I/O Pin Equivalent Schematic: The AVR I/O ports are the path to the outside world. The ports has protection diodes and programmable pull-up resistor
[9. AVR IO port]$ [10/21]
Figure: The ports are bi-directional I/O ports with optional internal pull-ups.
[10. AVR IO port]$ [11/21]
[12. AVR IO port]$ [13/21]
[13. AVR IO port]$ [14/21]
■ VCC - this pin provides supply voltage to the chip. The typical voltage source is +5 V. Some AVR family members have lower voltage for VCC pins in order to reduce the noise and power dissipation of the AVR system ■ AVCC is the supply voltage pin for Port A and the A/D Converter. It should be externally connected to VCC, even if the ADC is not used. ■ AREF is the analog reference pin for ADC
[15. AVR MCU connection to a PCB]$ [16/21]
Figure: Insufficient power supply decoupling: The capacitor is placed too far away from the microcontroller, creating a large high current loop. As a result of this, noise is spread more easily to other devices on the board, and radiated emission from the board is increased even further. The whole ground plane will act as an antenna for the noise, instead of only the high current loop
Figure: Better placement of the capacitor: The lines that are part of the high current loop are not part of the power or ground planes. This prevents the power and ground planes to spread a lot of noise. Furthermore, a series inductor is inserted to reduce the switching noise on the power plane.
[16. AVR MCU connection to a PCB]$ [17/21]
■ The RESET pin on the AVR is active LOW, and setting the pin LOW externally will thus result in a reset of the AVR. ■ The recommended pull-up resistor is 4.7kOhm or larger ■ The capacitor protect the RESET line further from noise ■ The components should be located physically close to the RESET pin of the AVR Figure: Recommended Reset Pin connection
[18. AVR MCU connection to a PCB]$ [19/21]
■ The oscillator circuit is the "heartbeat" of the system and is crucial to correct operation. ■ As a general rule, the speed at which an embedded system runs is directly determined by the oscillator frequency: in most cases, if you double the oscillator frequency, the application will run twice as fast. ■ Although most MCU have internal oscillator, it is often necessarily to use an external oscillator for an accurate and stable frequency [19. AVR MCU connection to a PCB]$ [20/21]