chitkara logo
Vol. 1, Issue 16, November 2015
Published by:- Chitkara University
Talking to Microcontrollers

Microcontroller is one of most popular electronic components when it comes to carrying out projects. Students use microcontrollers for building variety of applications ranging from simple LEDs blinking (On-Off control) to complex applications that require high computing capabilities thanks to large number of low cost &powerful microcontroller platforms available today that promise ease of use and programming (for example Arduino Uno, TI MSP430, STM Discovery and lot more.)


What I have personally seen while working on projects with students that students mostly use microcontroller as an ON-OFF smart switch and they don’t exploit all the other interfaces or communication protocols available on all modern day microcontrollers to communicate or interact with the outer world, sensors, and other electronic components etc. In this article I have briefly touched upon the various interfacing options available on microcontroller.

How microcontroller communicate with the outer world depend upon several factors, some of these factors are a) if the interface is analog or digital, b) if you need to employ a long distance or short distance communication, c) if you need parallel or serial communication d) speed of data transfer that you require etc. Based on these factors there are several interfacing options or communication protocols available, some of which are discussed here.

Digital Input/output - This is the most basic interfacing option that we use while working with microcontrollers (MCU). MCU has Digital General Purpose Input/Output Pins which can be configured as input or output. Common example is LED blinking application where GPIO is used as output and interfacing a push button (switch) where GPIO is used as input. This interface is high speed, programming is very easy and connection is quite straight forward.

Analog Input/output - Most modern day microcontroller comes with inbuilt analog components like ADC, DAC, Op-amps, and Comparators etc. This makes interfacing of analog components with microcontroller quite simple. MCUs have dedicated analog pins where you can connect analog sensors like temperature/pressure sensor (internal ADC will convert analog signal to digital for processing). This is simple interface, high speed, features simple programming. Similarly MCU has internal DAC which allows you to connect analog output device with the MCU, one example could be a speaker.

Parallel Communication - In parallel communication a number of digital GPIOs pins (normally 8 pins for 8 bit data) are used to connect an interfacing component with the microcontroller. This communication is fast as 8 bit of data is transmitted in one clock cycle, used for short distance communication (usually on a same PCB) and requires large number of GPIO pins to be used. Example of parallel communication is interfacing of alpha numeric LCD display with a microcontroller on a parallel bus. ISA & PCI are the popular parallel communication interfaces.

Serial Communication - Serial Communication is very important in microcontrollers and there are several reasons for this; some of which are mentioned here. Most modern day microcontroller need to communicate with the PC for programming, development and debugging. It is very convenient to employ serial communication between the microcontroller and PC through USB which is a high speed serial interface, other example is UART which is Full Duplex asynchronous interface. When interfacing with the sensors or any external peripherals serial communication protocols required fewer number of pins when compare to parallel communication and hence serial interfacing is more popular. Two of the popular serial protocols are 1) I2C which is a master slave communication that requires only two wires a) serial data line (SDA) and serial clock line (SCL). It is simple protocol to implement and is use to interface low speed peripherals. It is ideal for interfacing LCD displays and different sensors, low speed ADC, DAC etc 2) SPI is a four wire protocol and a full duplex interface used to interface variety of sensors, control devices, camera, RTL etc. Another advantage of serial communication is that it let inter microcontrollers’ communication with ease. A popular interface for this is CAN that create high speed communication between microcontrollers

Wireless Communication – For wireless communication modern day MCU employ protocols like embedded WiFi that let communication over the web at low data rates through universally available 2.4 GHz band and ZIGBEE protocol for building wireless sensor network applications. There are also many proprietary wireless protocols available today for wireless communication in microcontrollers

It is useful, rather important for the user to know which communication/interface protocol to use when interfacing external components/peripherals with microcontroller. The choice will depend upon various factors discussed in this article. In the subsequent issues we will try to discuss some of the popular communication protocol in more details.


By – Sagar Juneja, Research Associate, Chitkara University

Previous Issue

Electronic Paper Display



CLICK HERE

Chitkara Mandi

@ Paras DownTown Zirakpur
Nov 6-7

Four Electronics Products developed by ECE students of Chitkara University, H.P. will be available for SALE


Contribute to
Technology Connect

Students & Faculty are invited and encouraged to give
content for the newsletter. Write to

sagar.juneja@
chitkarauniversity.edu.in

Disclaimer:The content of this newsletter is contributed by Chitkara University faculty & taken from resources that are believed to be reliable.The content is verified by editorial team to best of its accuracy but editorial team denies any ownership pertaining to validation of the source & accuracy of the content. The objective of the newsletter is only limited to spread awareness among faculty & students about technology and not to impose or influence decision of individuals.