Digital Code Lock

Will be uploaded very soon...

DTMF based device switching

Will be uploaded very soon..

DTMF based robot controll

Will be uploaded soon..

Showing posts with label Other. Show all posts
Showing posts with label Other. Show all posts

Monday, January 21, 2013

About Microcontrollers

What is microcontroller..?

        Microcontroller is a small size miniature computer that we find in all kind of gizmos. There are two words one is microprocessors and other one is microcontroller. 

Microprocessor:

          In microprocessor there is only CPU which includes ALU for perform arithmetic and logic operations, some registers for data storage and control unit which control over all operation of chip. It needs to interface with some external peripherals like RAM, ROM, Timer etc to be functional it.


Microcontroller:

          In microcontroller all this required peripherals like RAM, ROM, Timer etc are integrated in single unit. All you need is to connect crystal, and power supply with chip to be functional it.


Manufacturer of Microcontroller:

          There are so many company which manufactures microcontrollers. They are available in 8-bit, 16-bit and 32-bit. Some of manufactures are listed below...

ARM
Intel
Atmel
NXP
Texas
Dallas
Toshiba

Types of CPU:

      Today, lots of microcontrollers are available with different types of CPU. Most popular CPUs for microcontroller are 8051, AVR and PIC. Some of microcontrollers have inbuilt analog to digital and digital to analog converter in a single unit.

     We must need to program microcontrollers as per our requirement. For programming purpose of microcontrollers many softwares are available like keil, Mikroc, SDCC, Bascom etc.

Application of Microcontrollers:

      Microcontrollers can be used in automobile industry, control and automation, robotics, Home appliances, industrial appliances, electronics gadgets, communication equipment and count is continue...

Brown Out in Controller

There are so many circuits inside the chip. All these different circuits require different voltage levels. So when the supply voltage fall down from the minimum voltage level due to electrical noise or any other reason performance of these circuits goes out of control.


So chip has in built reset functionality to get overcome from this problem. This brown out usually occurs when supply gets turns off. So when supply voltage fall below the minimum required voltage level then there is automatically chip get restarted.

Please share this with your friend...

Understanding Intel Hex file

Intel hex file is a file which contains binary data values to program micro-controllers, EEPROMs,  and other chips. Compiler converts source code into machine code and outputs it into hex file. This hex file then burned into chip using burner for make chip functional.

Typical look of hex file is...


Now each line has six different meaningful parts and these parts are...

1) Starting Code
2) Byte Count
3) Memory Address
4) Record Type
5) Data
6) Checksum


1) Start Code: It is a single character an ASCII code of colon(":"). Every line of hex file is starts with colon. It indicates the new line in hex file.

2) Byte Count: It consist of two hex character and it represents the length of data bytes in the record.

3) Memory Address: It consist of 4-digit memory location that represent the starting address of subsequent data in the record. Data starts storing from this memory location and its increments after storing of each data byte.

4) Record type: It consists of two hex digits. There are six types of records. This field has only five possible values which are from 00 to 05.

=> 00 = Data record; which contains data and 16-bit address.

=> 01 = End of file records; every hex file must be end with end of file record type for that record type field must contains "01". End of file records always has following format.


=> 02 = Extended segment address records; it is also known as HEX86. Extended segment record must have two data bytes. Absolute 32-bit address is generated using addition of extended segment address's data field and data record's address field.

=> 04 = Start segment address record; this is for 80x86 processors. it specifies the initial contents of code segment and instruction pointer. Here 1st two values (bytes) of data field are for code segment and other two are for instruction pointer.

=> 05 = Start linear address records; This is for 80386 and higher CPU. Contents of data field that is of 32-bit are loaded into the EIP register.

5) Data Field: This field contents data byte and address as well. Content of record field differentiate whether it is data or an address.

6) Checksum: This is two hex digits appears at the end of each line. For calculating this number 1st add every hex number of line not include ":" and checksum field it self then perform 2's compliment of least significant byte.

Please share this with your friend...

Thursday, January 17, 2013

Dual Tone Multiple Frequency - DTMF

DTMF stands for dual tone multiple frequency. DTMF is a term which used in telephone industry. When any key on telephone or mobile phone is pressed one tone is generated and it is audible which is nothing but a DTMF tone. To decode DTMF tone from mobile phone we need MT8870 DTMF decoder IC, 3.5mm male and female connector.


What is DTMF code..??

When any of the key like "1", "2", "*", "#" etc is pressed particular code is transmitted. This code is consist of two frequency among which one is higher frequency and second one is lower frequency. Following table shows the combination of frequency for respected keys.

1 2 3 697 Hz
4 5 6 770 Hz
7 8 9 852 Hz
* 0 # 941 Hz
1209 Hz 1336 Hz 1447 Hz

According to above table "8" is combination of lower frequency of 852 Hz and higher frequency of 1336 Hz and "#" is of lower frequency of 941 Hz and higher frequency of 1447 Hz. So this is all about DTMF code, now let see about how DTMF code are generated, transmitted and Decoded in mobile phone system. Here i am only talk about GSM system.

Transmission of DTMF code in GSM network

In GSM networks so many channels are available but mainly there is only two channels...
    1) Physical Channels
    2) Logical Channels

DTMF code are transmitted in FACCH i.e. fast associated control channel. Complete hierarchy of FACCH  is given below

  • GSM Channels
    • Logical Channels
      • Signalling Channels
        • Dedicated Control Channels
          • Fast Associated Control Channel

FACCH is a bidirectional channel i.e. uplink and downlink. It is used to transmit and receive emergency controlling signal messages. When any data or message need to be transmitted through this channel, it will replace the voice signal to digital signalling data for very short amount of time.

Decoding DTMF code

When any DTMF code has been received at mobile phone it can be audible through speaker. So to decode this DTMF code speaker output it self can be used. Output of speaker is connected to IC MT8870 which is DTMF decoder IC. (MT8870 Datasheet) It used widely to decode DTMF code. It gives 4-bit digital output q1, q2, q3, and q4 according to the received key. Following table shows the equivalent digital output for each key.

DTMF code table

Connecting mobile phone with MT8870

Our main aim is to connect mobile phone's speaker output to MT8870 so for achieving this we will use aux cable which has 3.5mm male audio jack at both its end as shown in below image. 3.5mm audio jack is a TRS connector which is Tip Riing Sleeve (ground) as shown in below image. Now we will use 3.5mm female audio jack to get mobile phone's speaker output and connect it with MT8870. Go through following images to get clear understanding..

Aux cable
Aux Audio Cable

 3.5mm jack specification
3.5mm Male Jack Specifications

3.5mm female connector
3.5mm Female Jack

Connection Diagram for MT8870

Circuit diagram for decoding DTMF code using MT8870 is given below. In our requirement MT8870 is configured in single-ended input configuration.

Circuit diagram to decode DTMF code using MT8870

As shown in circuit MT8870 needs crystal oscillator of 3.58MHz (Exactly 3.579545 MHz) and 5v Vcc supply to be functional. Crystal is connect in between pin no 7 and 8. Pin no 8 is connected to Vcc and 9 is connected to ground. Now lets talk about pin description of MT8870 but before that take look at internal structure of MT8870.

Courtesy : Mitel

Pin Description of MT8870:

1 IN+ : This pin is input to the non-inverting terminal of internal op-amp.

2 IN- : This pin is input to the inverting terminal of internal op-amp. Input signal from the mobile is applied to this pin using 3.5mm connector pairs and aux cable.

3 GS : Gain selector, This pin provides feedback to the op-amp circuitry. Feedback resistor of appropriate value is connected between this pin and input signal. Value of resistor decides the gain of amplification. 

4 Vref : Reference Voltage, This is output pin. Op-amp is configured in differential amplifier mode and both the inputs are bias in mid-rail range so for that generally Vcc/2 voltage is apply to non-inverting terminal hence Vref is connected to IN+ i.e. pin no 1.

5 INH : Inhibit, This is active high input pin. If you don't want to decode A,B,C,D then connect this pin to Vcc and if you want to decode them then connect it to ground, internally it is pulled down.

6 PD : Power down, This is also active high input pin. Vcc supply (High) at this pin enables the power down mode and in power down mode oscillator and internal filters stops functioning and IC goes to stand by mode.

10 TOE : Three state output enable, This is active high input pin. +Vcc at this pin will allow output Q1, Q2, Q3 and Q4 to latch data from internal latch circuitry. When this pin is connected to ground output Q1 to Q4 will not latch decoded DTMF code. This pin also pulled up internally.

11 to 14 Q1 to Q4 : four output bits, When TOE is connected to Vcc this will represents the DTMF code as per valid DTMF tone and when TOE is connected to ground this pins are remain in high impedance state.

15 StD : Delayed steering, This is output pin. When DTMF tone received, decoded and latched by the output pins Q1 to Q4 then Std will goes high and when voltage on pin no 17 i.e St/Gt falls below threshold voltage Vtst then Std again fall down to low.

16 ESt : Early steering, This is output pin. If valid DTMF tone is received then this pin goes high and remains high till any loss of signal occurs however Loss of signal make this pin to go logic low.

17 St/Gt : This is dual purpose pin and performed bidirectional operation i.e St - Steering input as input and Gt - Guard time as output. When voltage greater Vtst appears at St, it causes latch to register new output data. GT is used to configure time constant of Est pin.

Filters and Detector Section

This circuitry is varies vendor by vendor. But most of the ICs are used two band pass filters one is for low tone group frequency and another one for high tone group frequency. Mostly anti-aliasing and switched capacitor filters are used. Detector sections generally used digital counting techniques to verify the valid DTMF tone and produce output.

Complete process hierarchy is given in below image.

Process of decoding DTMF code using MT8870 from mobile phone

MT8870 IC don't have good noise immunity at output side so to remove this drawback inverter IC can be used which inverts the DTMF code and gives good noise immunity.


If you having any doubt feel free to do comment...