Sunday, July 1, 2012

Micro controller part(3)


                                              Microcontroller  Overview
                                                    Part (3)


Intro:
Microcontroller part (2) deals with the definition of microcontroller (what it is ) and some basic components of the microcontroller (ports , register and ROM).
This blog will explain some other elements of the micro controller.
Elements of Micro Controller (continue ...)



Communication mechanism of micro controller
Serial communication
Serial communications take place by transmitting and receiving data in a stream of consecutive electrical pulses that represent data bits and control codes.In an single time
A single data stream will be send or receive.
Serial communication can be divide by asynchronous serial communication and synchronous serial communication
Asynchronous communication :
When device send something it must be receive by some device also. Asynchronous communication established when the time (clock) between receiver and transmitter is not the same.
Synchronous communication :
When the transmitter and receiver clock is synchronous (having same clock, it does not mean the identical clock ) then the communication topology is said synchronous communication .

Asynchronous communication is much more complicated than the synchronous communication. To make a communication successfully a protocol should be defined first between the transmitter and the receiver.

Communication speed which is measured number of bits per second , known as baud rate, important characteristics to establish a communication.


Serial communication can be done with micro controller by using the following system
• USART (universal synchronous/asynchronous receiver/transmitter)
• SPI (serial peripheral interface)
• I2C (inter-integrated circuit)
• CAN (controller area network)


USART:
Serial communication such as RS-232 , RS-485 can be done with USART subsystem of the micro controller.
When it is in synchronous mode additional clock information is to send with the packet data.
For asynchronous  communication it is not needed only the data packet following defined protocol (baud rate, start bit , stop bit , handshake).Baud rate should same with the transmitting/receiving devices.

SPI :
Micro Controller device can work with master salve architecture where each master/ salve may be another micro controller . To obtain these topology micro controller use serial peripheral interface. By using these interface micro controller is able to exchange data and not only that it is also able to select its slave to whom it wants to communicate,
To do that is use slave select (ss) i/o , Serial data out (sdo), serial data in(sdi)and serial clock (sck).

I2C :
Inter integrated circuit communication (I2C bus) is used to interconnect  at least two microcontroller or other integrated circuit devices. This is a synchronous protocol that allow slave to communicate with master controlled by the master.
Due to it is a synchronous communication clock is send with data , for this feature it does not matter if the clock is changed later. Serail clock line (SCL) is used for this purpose.
Data is send over the Serial data (SDA) line which is bi- directional line controlled by SCL.

Can Bus System:
CAN bus system is a serial communication bus system for multi master high speed system that is used around 1 Mega bit per second communication.
In can bus system the communication is usually broadcast over the network.

Oscillator :
Micro controller used oscillator for frequency stabilization. This oscillator is an external device that produce clock cycle for the micro controller which is required for its operation. Traditionally MCU perform each instruction for every 4 clock cycles. There are around eight oscillator mode is defined by the micro controller. The operating mode of the oscillator is defined by the program (code) and written into the non volatile memory. Which loaded as a system configuration when MCU start .


Interrupt:
Interrupt is way of communication between microcontroller itself with CPU. While CPU is busy in executing some programs in meanwhile if something happens such as a pin state change then  interrupt is called which inform the CPU to halt its execution and go the Interrupt service routine to do something according to the interrupt type.

Timer Module:
Timer is a special register which is associated with oscillator. For each and every pulse that comes from the Oscillator the value of the Timer register incremented by one. When the register is full another increment causes an overflow interrupt which inform CPU , used to design clock .

Watchdog Timer:
Fig: WatchDog Timer
Hardware can have fault due to many reason. Considering a Embedded Engineer when the hardware is in prototype phase , if something wrong as a example  microcontroller stop working and hanged in that  circumstances an embedded engineer usually restart the micro controller board . But if somebody does not exist at that moment micro controller should restarted by it self  , and that is happens by the  Watchdog timer .

A/D Converter:
Analog to Digital converter module is used to convert  the analog data to digital conversion. A/D module is multiplexed with the analog channels . So before Using the Analog conversion appropriate channel should be selected first. More over that analog to digital conversation involve sampling acquisition and conversion . For this case Sampling rate is important .

 To summarize all the basics components of the micro controller I would like to introduce the block diagram of the components added below. 


Fig: Basics Components inside A microController



No comments:

Post a Comment