Chapter III: Introduction to microcontrollers.L9.1: µC basics [P9] Description of microcontroller architecture. |
[26/11] |
3.1. Microcomputer architecture
3.1.1. Microprocessor (µP). Basics
3.1.2. Microcontroller (µC), RAM, ROM, I/O
Fig. 1. The idea of microcontroller (or microcomputer) integrating a microprocessor, program and data memnories and many dedicated peripherals (or subsystems) in a single chip (picture ref.) |
3.1.3. Harvard and Von Neumann architectures
Harvard architecture is used by Microchip PIC and AVR devices. Von Neumann is used by Intel 8051 microcontrollers.
Fig. 2. Harvard architecture has separated buses for program and data memories. |
3.1.4.PIC18F4520 chip architecture.8-bit microcontrollers from Microchip. The architecture of the PIC18F family.
3.1.5.Microchip: PIC16F877A, ATmega8535, ATmega328P (the one used in Arduino boards)
(Optional) Arduino platform is based on another microcontroller ATmega328P that has become very well known, so that you can program it using "*.ino" source files and its development environment Arduino IDE, or instead using "*.c" files and Microchip MPLABX IDE. At the EETAC we have acquired the academic cloud license to simulate Arduino boards and applications in Proteus. Hence, you are invited to try your own projects. In this Proteus unit there is a project sample.
3.1.6. Low-level assembly and high-level C languages
High level C language is prefered over the assembler language because most of the hardware details of the micrcontroller remain hidden for a beginner user. In this course we will use C to program applications and we wuill introduce only some basic concepts on assembly language.
Read from books in the library. For instance, this Chapter 1 in the Wilmshurst, Tim, Designing Embedded Systems with PIC Microcontrollers, Newnes, 2010. Available as an eBook at the UPC library.
Browsing Internet, in addition to the Wikipedia page on PIC microcontrollers or Microchip University pages where all company courses are listed, you can find very impressive and useful learning materials. For instance, these are some references for introducing microcontrollers:
3.2. Other µC families and chips
3.2.1. Texas Instruments
3.2.2. Renesas
3.2.3. NXP
3.2.4. ST Microelectronics
3.3. EDA tools (MPLABX) for developing and testing
3.3.1. Microchip integrated development environment (IDE)MPLAB X
3.3.2. C compiler XC8
3.3.3. Proteus VSM as the virtual laboratory simulation tool.
3.4. Digital I/O. Combinational circuits in C
3.4.1. Specifications
3.4.1.1. Truth table, symbol, timing diagram
3.4.1.2. Hardware-software diagram and software organisation
3.4.1.3. Software organisation: setup, main loop
Analysis of P9 highlighted project on the design of 1-digit BCD adder (Adder_BCD_1digit). What is BCD data?, why an error signal is required?, what algoritm allow us to add in BCD using components such Adder_4bit from P3?. Can you infer the circuit using a plan C2 using Adder_4bit components? How such circuit is translated now into C language?
Exercise: Find an 8-bit microcontroller from TI, ST, Renesas, NXP or Infineon and draw and discuss its internal architecture
Exercise: Compare these two microcontrollers: PIC18F4520 - ATmega328PB (Basics).
Harvard / Von Neumann
8/16/32/64 bit
Status flags
Program memory size
Data memory size
Example of an assembly language instruction
Oscillator circuit
Reset circuit
Ports
Peripherals included
Interrupt sources