Posts

Showing posts from May, 2018

Bluetooth.

We're all used to wireless communication by now, even if we don't always realize it. Radio receivers and television sets pick up programs beamed in radio waves hundreds (possibly even thousands) of km/miles through the air. Cordless telephones use similar technologies to carry calls from a handset to a base station somewhere in your home. If you use Wi-Fi (wireless Internet), your computer sends and receives a steady stream of Internet data to and from a router that's probably wired directly to the Net. All these technologies involve sending information back and forth not along copper cables but in radio waves buzzing invisibly through the air. Bluetooth is a similar radio-wave technology, but it's mainly designed for communicating over short distances less than about 10m or 30ft. Typically, you might use it to download photos from a digital camera to a PC, to hook up a wireless mouse to a laptop, to link a...

Types of Transmission.

Image
Communication is probably, three types depend upon the transmission modes. Those are, Types of Transmissions: Simplex Communication:  In this mode of serial communication, data can only be transferred from transmitter to receiver and not vice versa. Half Duplex Communication:  this means that data transmission can occur in only one direction at a time, i.e. either from master to slave, or slave to master, but not both. Full Duplex Communication:  full duplex communication means that data can be transmitted from the master to the slave, and from slave to the master at the  same time!                           Serial Communication Terminologies Now its time to learn some new words, which we will use frequently in the next few posts. There are many terminologies or ‘keywords’ associated with a serial communication. We will discuss all of them one by one: MSB/LSB:  this stan...

Serial Transmission Modes.

Image
Serial Transmission Modes Serial data can be transferred in two modes – asynchronous and synchronous. Asynchronous Data Transfer: Data Transfer is called Asynchronous when data bits are not “synchronized” with a clock line, i.e. there is no clock line at all! Let's take an analogy. Imagine you are playing a game with your friend where you have to throw coloured balls (let’s say we have only two colours – red (R) and yellow (Y)). Let's assume you have an unlimited number of balls. You have to throw a combination of these coloured balls to your friend. So you start throwing the balls. You throw R, then R, then Y, then R again and so on. So you start your sequence RRYR… and then you end your round and start another round. How will your buddy on the other side know that you have finished sending him the first round of balls and that you are already sending him the second round of balls?? He/she will be completely lost! How nice it would be if you both sit together and f...

What is Serial Communication.

Image
In today's podcast, we will give a full description of communication and serial communication. What is Communication:     Before we move on to serial communication, let's discuss a bit about communication in general. In simple terms, communication is an exchange of ideas between two individuals. Ideas can be anything and in any form, they could be written/spoken words, in form of media like audio/video, or if you like sci-fi, then it can also in form of telepathy) Serial Communication:       In Telecommunication and Computer Science, serial communication is the process of sending/receiving data in one bit at a time. It is like you are firing bullets from a  machine gun  to a target… that’s one bullet at a time.   This serial communication, one data bit is only transferred at a time. and Obviously, it is a slower communication speed and it needs less number of cables.                 ...

TMOD Special Function Register.

TMOD register As we know there are 2 timer registers in 8051. Timer 0 and timer 1. Both of these registers use the same register called TMOD to set various timer operation modes. TMOD is an 8-bit register, in which lower 4 bits are for Timer 0 and upper 4 bits are for Timer 1. See table below. MSB ---- LSB GATE C/T M1 M0 GATE C/T M1 M0 TIMER 1 TIMER 0 Bit Description: Bit TMOD Bit Function 7 Gate -- OR gate enable bit which controls RUN/STOP of timer 1. Set to 1 by the program to enable the timer to run if bit TR1 in TCON is set and the signal on external interrupt is high. Cleared to 0 by the program to enable time to run if bit TR1 is set. 6 C/ T  -- Set to 1 by the program to make timer 1 act as a counter by counting pulses from external input pins 3.5. Cleared to zero by the program to make timer act as a timer by counting internal frequency. 5 M1 -- Timer/counter operating mode select bit 1. Set/cleared by the...

TCON Special Function register.

Image
If a counter is programmed to be a timer, it will count the internal clock frequency of the 8051 oscillator 12d. As an example, if the crystal frequency 6 MHz, then the timer clock will have a frequency of 500kHz.   The timers may operate in any one of four modes that are determined by the mode bits. In that the timer control TCON it is a special function register. TCON:   Pin Description of TCON: Bit Symbol TCON Bit Function 7 TF1l Timer 1 Overflow flag. Set when timer rolls from all 1's to 0. Cleared when processor vectors to execute interrupt service routine located at program address 001Bh. 6 TR1l Timer 1 run control bit. Set to 1 by a program to enable the timer to count; cleared to 0 by the program to halt timer. 5 TF0 l Timer 0 Overflow flag. Set when timer rolls from all 1's to 0. Cleared when processor vectors to execute interrupt service routine located at program address 000Bh. 4 TR0l Timer 0 run control bit. Set to 1 by a program to ...

Counters in 8051.

Image
Counters in 8051:       We can use a counter by keeping C/T bit high, i.e., logic ‘1’ in the TMOD register. For better understanding, we have given one program which uses timer 1 as a counter. Here the LEDs are connected to 8051 Port 2, and the switch to the timer1 pin P3.5; and therefore, if the switch is pressed, the value will be counted. Otherwise, an externally connected sensor to this counter pin as input does this counting operation. Digital Counter with 8051:      The Digital counter with 8051 is achieved by programming the microcontroller as discussed above and by attaching a sensor system to it. This object counter uses IR sensor that detects the obstacle near to it and also enables the pin of the microcontroller 06. When an object passes through the sensors, then the microcontroller gets an interrupt signal from the IR sensors and increment the count which is displayed in the7-segment display. Time delay circuit Us...

Timers in 8051

Image
What is a Timer The timer is a clock that controls the sequence of an event while counting in fixed intervals of time. A Timer is used for producing precise time delay. Secondly, it can be used to repeat or initiate an action after/at a known period of time. This feature is very commonly used in several applications. An example could be setting up an alarm which triggers at a point in time or after a period of time. Timers in a controller: Why to use them Most of the microcontrollers have inbuilt Timers. Timers in a controller not only generate time delays but they can also be used as counters. They are used to count an action or event. The value of counter increases by one, every time its corresponding action or event occurs. Timers in a controller are inbuilt chips that are controlled by special function registers (SFR) assigned for Timer operations.  These SFRs are used to configure Timers in different modes of operations. While working with microc...