Microcontroller Features / Modules
Quick MCU selection guide
The MCU may have more than one of the following features/modules depending on your specific application.
IO PORTS:
Hardware Input Output (IO) lines or pins that can carry data in both directions such as Input to the MCU and Output from the MCU. Some times they are called General Purpose Input Output pins (GPIO). These pins can be used to generate timed events, control devices, analyze the external world for decision-making, used to input or output data for internal or external storage, and so on. All controls are done via these IO pins.RESET:
It stops the MCU operation once activated and returns to a known condition or memory location. Reset can be generated internally or externally. External reset source can be due to hardware reset pin. Internal reset can be due to illegal code or address call in the routine, low voltage, or improper controller operation or WATCHDOG TIMER.INTERRUPT:
Is a temporary program suspension to serve a higher priority task. After finishing interrupt the program returns to where it was called from just before it served interrupt. Look for the average time it takes to execute one command and pick the shortest if your application is time critical. Interrupts make your MCU looks like a parallel processing machine but in reality it is not. It is used when you want to serve two events almost at the same time (within 200 uS or so). To us 200 uS is not recognizable but for the MCU it is. An example where you need Interrupt is when you are using single MCU to control the voice pitch and voice emphasis of the voice processor at the same time (well, within 100 uS).SERIAL COMMUNICATION:
This interface enables data communication between MCU and the external world, such as modems, motors, and lights, over single IO line. Serial communication is used when there may be shortage of IO pins.SERIAL PERIPHERAL INTERFACE (SPI):
This communication module uses 4 hardware pins for communication and operates on the Master-Slave principle. It is a full-duplex synchronous serial communication high-speed low cost method to communicate with external peripherals. The 4 pins used are Master In Slave Out (MISO), Master Out Slave In (MOSI), Slave Select (SS), and Master Clock Signal (SPSCK)CLOCK GENERATOR:
It is a programmable frequency generator that feeds from the crystal oscillator. It is used to time events, synchronize data communication, and sometimes generate INTERRUPT service routine.TIMERS:
They time MCU internal and/or external events by using internal oscillator or external crystal of lower or higher frequency of the timer. All frequencies can be programmed via MCU registers. Timers can also generate INTERRUPT event.WATCHDOG TIMER:
It saves the MCU operation from unexpected or catastrophic events such as dealing with software code when an event is not accounted for. The code could or could not be on fault or error but the event is/was unexpected. When the WATCHDOG timer reaches it's programmed final value (TIMEOUT) it resets the MCU unless it is programmed again with another timeout value. Use Watchdog timer when you are using your device containing the MCU in an environment where it is difficult or impossible to perform system quality control before launching your product. An example is stopping the car washing machine when a strange car enters the washing machine or diverts from the guidance track, or repositioning the missile or projectile path during extreme wind conditions. Use Assembly language for time critical events.TIMER MODULES:
They generate programmable periodic timing signals independent of the MCU system timer. Used to schedule events or serve certain INTERRUPTS, maintenance, and other service routines powering up on lower power requirements. Use when you need to time events independently and at lower power conditions.INTERFACE TIMERS:
User programmable timers to perform OUTPUT COMPARE, INPUT CAPTURE, or Pulse Width Modulation. Output Compare can be used to generate INTERRUPTS, timed events, or delays. The pin is configured as output. Input Capture can be used to time external events to the MCU such as measuring the width or the period of certain pulse or wave. The pin is configured as input. Pulse Width Modulation can be used to generate a PWM signal with programmed duty cycle or can be used in Digital to Analog conversion to be used with filters for smooth analog output. The pin is configured as output.LOW VOLTAGE PROTECTION:
The MCU may have a built in system that monitors the supply voltage and inhibit or reset MCU operation upon detecting unusual supply voltage conditions. MCU operation may be problematic when supply voltage deviates from the normal. This voltage can be programmed in MCU to different voltage levels. Use to protect against brown outs or extreme spikes.ADC:
Analog to Digital Converter (ADC) can perform in different resolutions. Resolution means that a more descriptive digital code with larger number of binary bits can be assigned to an analog signal inputted to the MCU. Resolution can be 8 bits, 10 bits or other. 10 binary bits ADC conversion has better resolution than 8 bits conversion which always uses 10 bits for any analog signal inputted to the MCU. Use ADC when you want to store an analog signal in digital format for later retrieval or to perform voltage measurement for example.FLASH MEMORY:
This high endurance memory can store the program inside the MCU. It can be programmed and erased by programming interface very fast thousands of times. A programming interface can be made as In-Circuit Programming (ICP) hardware to allow fast programming while MCU is on its final PCB board. This memory can also be protected by a security password to prevent unintended memory erase or code hacking. Memory size varies from MCU to another and from manufacturer to another.PROGRAMMING LANGUAGE:
Among programming languages available today are Basic, C, C++, and Assembly. Each has advantages and disadvantages. The Basic is being the easiest and Assembly is more complex. The final code space and execution speed varies with Assembly being the fastest and Basic being the slowest. Depending on the application any of these languages could be the best fit in term of programming speed, execution speed desired, price, overall development time frame, and tools and support available.DEVELOPMENT TOOLS:
Can be used to speed up time to market and save lots of time. It includes every thing you need to start developing and programming your product right of the box. See my page of Introduction to Microcontroller.
Among the widely recognized MCU manufacturers and their products are:
Microchip:
PIC 10, PIC 12, PIC 16, and PIC 18 families.Parallax:
BASIC Stamp: BS1, BS2, BS2e, BS2sx, and BS2p.Motorola:
68HC11, 68HC08 and 68HC908 family.Handyboard:
68HC11 based.Atmel:
AT90S1200, AT90S8515, AT90S8535. AT89Cx051.Intel:
87C51, 87C52.Kg Systems:
BASIC-Tiger.
MCU SELECTION:
To make the proper MCU selection for your project, refer to features and modules available in the MCUs from the manufacturers mentioned above. For example how many IO pins you need, do you need interrupts?, how much program code space you need?, the processing speed, the timers, voltage protection features, the Serial Communication modules, the ADC needed, the programming language supported, do you need a watchdog timer? and so on.
Engineer: Firas Faham