tag:blogger.com,1999:blog-21900292398491132722024-02-19T03:52:14.383-08:00ELECTRONICS LABAnonymoushttp://www.blogger.com/profile/13526216155838659104noreply@blogger.comBlogger117125tag:blogger.com,1999:blog-2190029239849113272.post-51387093564403321062016-09-28T00:22:00.000-07:002016-09-28T00:22:43.930-07:00Windows Comparator Using Op-Amp<div dir="ltr" style="text-align: left;" trbidi="on">
Windows Comparator Using Op-Amp<br />
Just Draw the Circuit on protious and Make Pcb For Windows Comparator Using Op-Amp. LF 353 is used for this purpose. It has a self frequency Compensation.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgF3X0Vp_1E3D2UTQAlKdVgCdSublE1kD2FeYt7OUpmlwugneQwTGX4KrfrzGmKKV-g4KDjzJq3dwpH0HjhoTdUH010c3u5pEd2c3rqqwumfkMGaewXF8OZvsiVnQ1QheKzph18sBqj__va/s1600/123.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgF3X0Vp_1E3D2UTQAlKdVgCdSublE1kD2FeYt7OUpmlwugneQwTGX4KrfrzGmKKV-g4KDjzJq3dwpH0HjhoTdUH010c3u5pEd2c3rqqwumfkMGaewXF8OZvsiVnQ1QheKzph18sBqj__va/s640/123.JPG" width="604" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Windows Comapartor </td></tr>
</tbody></table>
<br /></div>
Anonymoushttp://www.blogger.com/profile/13526216155838659104noreply@blogger.com1tag:blogger.com,1999:blog-2190029239849113272.post-66181837408864236652015-01-19T01:57:00.000-08:002015-10-02T11:24:34.714-07:00RTC using Ds1307 and 89c52 with Multiplex 7-segment display<div dir="ltr" style="text-align: left;" trbidi="on">
<h3 style="text-align: left;">
RTC using Ds1307 and 89c52 with Multiplex 7-segment display</h3>
<div style="text-align: justify;">
Salam ....Friends in this tutorial ,we are interfacing real time clock Ds1307 with 89c52 and displaying time on multiplex 7-segment display .In google there are many related projects about the Real Time Clock but no one use the 7-segment display so my method is different and less expensive ,because i don't use the crystal LCD. step1 is about RTC and I2c .</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
RTC is an electronic device which plays an essential role in realtime embedded system design.
It provides a precise time and date in various applications such as
system clock, student attendance system and alarm etc, that keep track
on current time and provides consistent result to the respective task.
This article presents RTC interfacing with 8051microcotrollerand basic
accessing of internal registers.</div>
<div style="text-align: justify;">
<br /></div>
<h2 style="text-align: justify;">
RTC Programming and Interfacing</h2>
<div style="text-align: justify;">
RTC interfacing with 89c52
microcontroller is similar to all other kinds of “Real Time Clocks”
interfaced to it. So let us look on simple RTC interfacing with 89c52 microcontroller and programming procedure involving in it.</div>
<h4 style="text-align: justify;">
Step1: Select RTC Device</h4>
<div style="text-align: justify;">
The various kinds of RTC chips are
available in the real time embedded world, which are classified based on
various criteria such as package type, supply voltage and pin
configuration etc. A few types of RTC devices are;</div>
<ul style="text-align: justify;">
<li>Two-Wire Serial Interface (I2C Bus)</li>
<li>Three-Wire Serial Interface (USB BUS)</li>
<li>Four-wire Serial interface (SPI BUS)</li>
</ul>
<div style="text-align: justify;">
First, we need to select type of RTC
device by category based on requirement like I2C Bus RTC or SPI Bus RTC
or other, which suitsfor interfacingwith respective microcontroller.
Then we can select features of RTC device depending on requirement of
application such as battery life, suitable package and clock frequency.
Let us consider two-wire interfacing RTC with 8051 microcontroller such as DS1307.<br />
<a name='more'></a><br />
<br /></div>
<h4 style="text-align: justify;">
Step2: Internal Register and Address of the RTC Device</h4>
<div style="text-align: justify;">
RTC stands for real time clock which
provides years, months, weeks, days, hours, minutes and seconds based on
crystal frequency. RTC consists of inbuilt RAM memory for data storage. A battery backup will be provided in case of failure of main power supply by connecting a battery to RTC device.</div>
<h4 style="text-align: justify;">
RTC DB1307 Configuration:</h4>
<div class="wp-caption aligncenter" id="attachment_26369" style="text-align: justify; width: 325px;">
<div>
<a href="https://www.elprocus.com/wp-content/uploads/2014/09/26.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img alt="RTC Internal Blocks and Pin Diagram" border="0" class=" wp-image-26369" height="261" src="https://www.elprocus.com/wp-content/uploads/2014/09/26.jpg" width="315" /></a></div>
<div class="wp-caption-text">
RTC Internal Blocks and Pin Diagram</div>
</div>
<div style="text-align: justify;">
<b>A0, A1, A2:</b> are address
pins of RTC DB1307 chip, which can be used to communicate with the
master device. We can control eight devices with RTC interfacing with 89c52 microcontroller by A0, A1, A2 bits using I2C protocol.</div>
<div style="text-align: justify;">
<b>VCC and GND:</b> VCC and GND are power supply and ground pins respectively. This device operated with 1.8V to 5.5V range.</div>
<div style="text-align: justify;">
<b>VBT:</b> VBT is a battery power supply pin. Battery power source must be held between 2V to 3.5V.</div>
<div style="text-align: justify;">
<b>SCL:</b> SCL is a serial clock pin and it is used to synchronize data on serial interface.</div>
<div style="text-align: justify;">
<b>SDL:</b> It is a serial input and output pin. It is used to transmit and receive the data on serial interface.</div>
<div style="text-align: justify;">
<b>Clock Out:</b> It is an optional square wave output pin.</div>
<div style="text-align: justify;">
<b>OSC0 and OSC1:</b> These
are crystal oscillator pins which are used to provide the clock signals
to the RTC device. The standard quartz crystal frequency is 22.768KHzs.</div>
<h4 style="text-align: justify;">
Device Addressing:</h4>
<div style="text-align: justify;">
I2C bus protocol allows many slave
devices at a time. Every slave device must consist of own address to
represent on it. The master device communicates with particular slave
device by an address. RTC device address is “0xA2” wherein “1010” is
given by manufacturer and A0, A1, A2 are user define address, which is
used to communicate eight RTC devices on the I2C bus protocol.</div>
<div class="wp-caption aligncenter" id="attachment_26370" style="text-align: justify; width: 455px;">
<a class="cb-lightbox" href="https://www.elprocus.com/wp-content/uploads/2014/09/36.jpg"><img alt="Device Addresing" class=" wp-image-26370" height="92" src="https://www.elprocus.com/wp-content/uploads/2014/09/36.jpg" width="445" /></a><br />
<div class="wp-caption-text">
Device Addresing</div>
</div>
<div style="text-align: justify;">
R/W bit is used to perform read and
write operations in RTC. If R/W=0, write operation is performed and
R/W=1 for read operation.</div>
<div style="text-align: justify;">
Address of Read operation of RTC= “0xA3”</div>
<div style="text-align: justify;">
Address of Write operation of RTC= “0xA2”</div>
<h4 style="text-align: justify;">
Memory Registers and Address:</h4>
<div style="text-align: justify;">
RTC registers are located in address
locations from 00h to 0Fh and RAM memory registers are located in
address locations from 08h to3Fh as shown in figure. RTC registers are
used to provide calendar functionality and drive time of day and to
display the weekends.</div>
<div class="wp-caption aligncenter" id="attachment_26371" style="text-align: justify; width: 371px;">
<a class="cb-lightbox" href="https://www.elprocus.com/wp-content/uploads/2014/09/45.jpg"><img alt="Memory Registers and Address" class=" wp-image-26371" height="338" src="https://www.elprocus.com/wp-content/uploads/2014/09/45.jpg" width="361" /></a><br />
<div class="wp-caption-text">
Memory Registers and Address</div>
</div>
<div style="text-align: justify;">
<b>Control/Status Registers:</b></div>
<div style="text-align: justify;">
DB1307 consists of two additional
registers such as control/status1 and control/status2 which are used to
control real time clock and interrupts.</div>
<div style="text-align: justify;">
<b>Control/Status Register1:</b></div>
<div class="wp-caption aligncenter" id="attachment_26372" style="text-align: justify; width: 448px;">
<a class="cb-lightbox" href="https://www.elprocus.com/wp-content/uploads/2014/09/54.jpg"><img alt="Control Status Register1" class=" wp-image-26372" height="96" src="https://www.elprocus.com/wp-content/uploads/2014/09/54.jpg" width="438" /></a><br />
<div class="wp-caption-text">
Control Status Register1</div>
</div>
<ul style="text-align: justify;">
<li>TEST1=0 normal mode</li>
</ul>
<div style="text-align: justify;">
=1 EXT-clock test mode</div>
<ul style="text-align: justify;">
<li>STOP=0 RTC starts</li>
</ul>
<div style="text-align: justify;">
=1 RTC stop</div>
<ul style="text-align: justify;">
<li>TESTC=0 power on reset disabled</li>
</ul>
<div style="text-align: justify;">
= power on reset enabled</div>
<div style="text-align: justify;">
<b>Control/Status Register2:</b></div>
<div class="wp-caption aligncenter" id="attachment_26373" style="text-align: justify; width: 422px;">
<a class="cb-lightbox" href="https://www.elprocus.com/wp-content/uploads/2014/09/62.jpg"><img alt="Control Status Register2" class=" wp-image-26373" height="91" src="https://www.elprocus.com/wp-content/uploads/2014/09/62.jpg" width="412" /></a><br />
<div class="wp-caption-text">
Control Status Register2</div>
</div>
<ul style="text-align: justify;">
<li>TI/TP= 0 INT active all the time</li>
</ul>
<div style="text-align: justify;">
=1 INT active required time</div>
<ul style="text-align: justify;">
<li>AF=0 Alarm does not match</li>
</ul>
<div style="text-align: justify;">
=1 Alarm match</div>
<ul style="text-align: justify;">
<li>TF=0 Timer overflow does not occur</li>
</ul>
<div style="text-align: justify;">
=1 Timer overflow occurs</div>
<ul style="text-align: justify;">
<li>ALE=0 Alarm interrupts disable</li>
</ul>
<div style="text-align: justify;">
=1 Alarm interrupts enabled</div>
<ul style="text-align: justify;">
<li>TIE=0 Timer interrupts disable</li>
</ul>
<div style="text-align: justify;">
=1 Timer interrupts enable</div>
<h4 style="text-align: justify;">
Step3: Interfacing RTC ds1307 with 89c52</h4>
<div style="text-align: justify;">
RTC can be interfaced to microcontroller by using different serial bus protocols such as I2C and SPI protocols
that provide communication link between them. The figure shows, real
time clock interfacing with 89c52/8051 microcontroller using I2C bus protocol.
I2C is a bi-directional serial protocol, which consist of two wires
such as SCL and SDA to transfer data between devices connected to bus.
89c52 microcontroller has no inbuilt RTC device therefore we have
connected externally through a serial communication for ensuring the consisting data.<br />
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfqvkOQfI21TCbz6gRoz12Y8RB16p81RPJFHVJCM-rB8JXUAXmt4NGJQthzzLybOIsQ_u66eUFiv8AAPwusy4PSwWpcy4xmlwYvu71kngkSghQr3aARBBFTJwgvoDIv1G3i996lJQUecyU/s1600/Rtc_circuit.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="348" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfqvkOQfI21TCbz6gRoz12Y8RB16p81RPJFHVJCM-rB8JXUAXmt4NGJQthzzLybOIsQ_u66eUFiv8AAPwusy4PSwWpcy4xmlwYvu71kngkSghQr3aARBBFTJwgvoDIv1G3i996lJQUecyU/s1600/Rtc_circuit.png" width="640" /> </a></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I2C devices have open drain outputs therefore, a pull-up resistors
must be connected to the I2C bus line with a voltage source. If the
resistors are not connected to the SCL and SDL lines, the bus will not
work.</div>
<h4 style="text-align: justify;">
Step4: RTC Data Framing Format</h4>
<div style="text-align: justify;">
Since RTC interfacing with 89c52
microcontroller uses I2C bus therefore the data transfer is in the form
of bytes or packets and each byte is followed by an acknowledgement.</div>
<div style="text-align: justify;">
<b>Transmitting Data Frame:</b></div>
<div style="text-align: justify;">
In transmitting mode, the master release
the start condition after selecting slave device by address bit. The
address bit contains 7-bit, which indicate the slave devices as ds1307
address. Serial data and serial clock are transmitted on SCL and SDL
lines. START and STOP conditions are recognized as beginning and ending
of a serial transfer. Receive and transmit operations are followed by
the R/W bit.</div>
<div class="wp-caption aligncenter" id="attachment_26375" style="text-align: justify; width: 454px;">
<a class="cb-lightbox" href="https://www.elprocus.com/wp-content/uploads/2014/09/81.jpg"><img alt="Transmitting Data Frame" class=" wp-image-26375" height="52" src="https://www.elprocus.com/wp-content/uploads/2014/09/81.jpg" width="444" /></a><br />
<div class="wp-caption-text">
Transmitting Data Frame</div>
</div>
<div style="text-align: justify;">
<b>Start:</b> Primarily, the data transfer sequence initiated by the master generating the start condition.</div>
<div style="text-align: justify;">
<b>7-bit Address:</b> After that the master sends the slave address in two 8-bit formats instead of a single 16-bit address.</div>
<div style="text-align: justify;">
<b>Control/Status Register Address:</b> The control/status register address is to allow the control status registers.</div>
<div style="text-align: justify;">
<b>Control/Status Register1:</b> The control status register1 used to enable the RTC device</div>
<div style="text-align: justify;">
<b>Control/Status Register2:</b> It is used to enable and disable interrupts.</div>
<div style="text-align: justify;">
<b>R/W:</b> If read and write bit is low, then the write operation is performed.</div>
<div style="text-align: justify;">
<b>ACK:</b> If write operation is performed in the slave device, then the receiver sends 1-bit ACK to microcontroller.</div>
<div style="text-align: justify;">
<b>Stop:</b> After completion of write operation in the slave device, microcontroller sends stop condition to the slave device.</div>
<div style="text-align: justify;">
<b>Receiving Data Frame:</b></div>
<div class="wp-caption aligncenter" id="attachment_26376" style="text-align: justify; width: 466px;">
<a class="cb-lightbox" href="https://www.elprocus.com/wp-content/uploads/2014/09/91.jpg"><img alt="Receiving Data Frame" class=" wp-image-26376" height="54" src="https://www.elprocus.com/wp-content/uploads/2014/09/91.jpg" width="456" /></a><br />
<div class="wp-caption-text">
Receiving Data Frame</div>
</div>
<div style="text-align: justify;">
<b>Start:</b> Primarily, the data transfer sequence initiated by the master generating the start condition.</div>
<div style="text-align: justify;">
<b>7-bit Address:</b> After that the master sends slave address in two 8-bit formats instead of a single 16-bit address.</div>
<div style="text-align: justify;">
<b>Control/Status Register Address:</b> The control/status register address is to allow control status registers.</div>
<div style="text-align: justify;">
Control/Status Register1: The control status register1 used to enable the RTC device</div>
<div style="text-align: justify;">
<b>Control/Status Register2: </b> It is used to enable and disable interrupts.</div>
<div style="text-align: justify;">
<b>R/W:</b> If read and write bit is high, then the read operation is performed.</div>
<div style="text-align: justify;">
<b>ACK:</b> If write operation is performed in the slave device, then the receiver sends 1-bit ACK to microcontroller.</div>
<div style="text-align: justify;">
<b>Stop:</b> After completion of write operation in the slave device, microcontroller sends stop condition to the slave device.</div>
<h4 style="text-align: justify;">
Step5: RTC Programming</h4>
<div style="text-align: justify;">
<b>Write Operation from Master to Slave:</b></div>
<ol style="text-align: justify;">
<li style="text-align: justify;">Issue the start condition from master to slave</li>
<li style="text-align: justify;">Transfer the slave address in write mode on SDL line</li>
<li style="text-align: justify;">Send the control register address</li>
<li style="text-align: justify;">Send the control/status register1value</li>
<li style="text-align: justify;">Send the control/status register2 value</li>
<li style="text-align: justify;">Send the date of the like minutes, seconds and hours</li>
<li><div style="text-align: justify;">
Send the stop bit</div>
<h2 style="text-align: justify;">
Coding :</h2>
<h3 style="text-align: justify;">
MAIN CODE :</h3>
<div style="text-align: justify;">
<span style="color: #38761d;">#include <AT89X52.h><br />#define DS1307_ID 0xD0 // DS1307 ID<br />#define SEC_ADDRESS 0x00 // Address to access Ds1307 SEC register<br />#define DATE_ADDRESS 0x04 // Address to access Ds1307 DATE register<br />#define CONTROL 0x07 // Address to access Ds1307 CONTROL register<br />#define DELAY 1000<br />sbit seg_1= P2^0; <br />sbit seg_2= P2^1; <br />sbit seg_3= P2^2;<br />sbit seg_4= P2^3; <br />sbit SCL=P1^0; //SCL Connected to P1.0<br />sbit SDA=P1^1; //SDA Connected to P1.1<br />sbit mode = P2^4;<br />sbit set_low = P2^5;<br />sbit set_high = P2^6;<br /><br /><br />extern void delay_sec(unsigned char sec_count);<br />extern void delay_ms(unsigned int ms_count);<br />extern void delay_for_segments(unsigned int ms_count);<br />extern void delay_us(unsigned int us_count);<br />extern void delay_us_seg(unsigned int us_count);<br />extern void I2C_Clock(void);<br />extern void I2C_Start();<br />extern void I2C_Stop(void);<br />extern void I2C_Write(unsigned char dat);<br />extern unsigned char I2C_Read(void);<br />extern void I2C_Ack();<br />extern void I2C_NoAck();<br />extern void DS1307_Init();<br />extern void DS1307_Write(unsigned char dat);<br />extern unsigned char DS1307_Read();<br />extern void DS1307_SetTime(unsigned char hh, unsigned char mm, unsigned char ss);<br />extern void DS1307_SetDate(unsigned char dd, unsigned char mm, unsigned char yy);<br />extern void DS1307_GetTime(unsigned char *h_ptr,unsigned char *m_ptr,unsigned char *s_ptr);<br />extern void DS1307_GetDate(unsigned char *d_ptr,unsigned char *m_ptr,unsigned char *y_ptr);<br />unsigned char hex2bcd (unsigned char x); <br />unsigned char bcd_value;<br />unsigned char hour,min,sec,year,month,date,set_h,set_m,set_s,set_d,set_mon,set_y,blank=11;<br />unsigned char hour_tens,min_tens,sec_tens,month_tens,year_tens,date_tens;<br />const unsigned char bcd_to_segment[12]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,0x7F,0xFF};<br />unsigned char D1,D2,D3,D4;<br />enum states { <br /> SHOW_TIME,<br /> SHOW_DATE,<br /> SHOW_YEAR,<br /> SETL_TIME,<br /> SETH_TIME,<br /> SET_DATE,<br /> SET_YEAR<br /> };<br /><br />void timer2() interrupt 5<br />{<br /> <br /> <br /> seg_1=0;<br /> seg_2=0;<br /> seg_3=0;<br /> seg_4=0;<br /> <br /> delay_ms(1); <br /> P0 = bcd_to_segment[D1];<br /> seg_1 = 1;<br /> <br /> delay_us(DELAY);<br /> seg_1 = 0;<br /><br /> delay_ms(1); <br /> P0 = bcd_to_segment[D2]; <br /> seg_2 = 1;<br /> <br /> delay_us(DELAY);<br /> seg_2 = 0;<br /> <br /> delay_ms(1); <br /> P0 = bcd_to_segment[D3];<br /> seg_3 = 1;<br /> <br /> delay_us(DELAY);<br /> seg_3 = 0;<br /> <br /> delay_ms(1); <br /> P0 = bcd_to_segment[D4]; <br /> seg_4 = 1;<br /> <br /> delay_us(DELAY);<br /> seg_4 = 0;<br /> delay_ms(1); <br /> TF2=0; //clear Timer2 flag <br />} // interrupt closed<br /><br />/* <br />void timer0(void) interrupt 1 <br />{<br /> <br />} <br /><br />void ISR_ex0(void) interrupt 0<br />{<br /> led=0;delay_sec(1);led=1;<br />}*/<br />void main()<br />{<br /> enum states state = SHOW_TIME;<br /><br /> D1 = D2 = D3 = D4 = 0;<br /> RCAP2L = 0x30; // lower value <br /> RCAP2H = 0xf8; // Specific values for 10ms <br /> ET2 = 1; <br /> /*TMOD=0x01;<br /> TH0=0x18;<br /> TL0=0xfc;<br /> TR0=1;<br /> ET0=1;<br /> <br /> //IE0=1; <br /> */<br /> <br /> set_h=0x12,set_m=0x11,set_s=0x00,set_d=0x17,set_mon=0x01,set_y=0x15; // setting time <br /> DS1307_Init();<br /> DS1307_SetTime(set_h,set_m,set_s);<br /> DS1307_SetDate(set_d,set_mon,set_y);<br /> set_low = 1;<br /> set_high = 1;<br /> mode = 1;<br /> TR2 = 1;<br /> EA = 1; <br /> <br /> while(1)<br /> { <br /> DS1307_GetTime(&hour,&min,&sec);<br /> sec_tens = sec & 0x0F;<br /> sec = sec >> 4 ; <br /> min_tens = min & 0x0F;<br /> min = min >> 4 ;<br /> hour_tens = hour & 0x0F;<br /> hour = hour >> 4 ; <br /> <br /> DS1307_GetDate(&date,&month,&year); <br /> date_tens = date & 0x0F;<br /> date = date >> 4 ;<br /> month_tens = month & 0x0F;<br /> month = month >> 4 ;<br /> year_tens = year & 0x0F;<br /> year = year >> 4 ;<br /> <br /> switch(state) <br /> {<br /> case SHOW_TIME:<br /> D1=hour;D2=hour_tens;D3=min;D4=min_tens;<br /> if(set_low==0) // if the lower buuton is pressed <br /> {<br /> set_h++; // then after some delay , increment the hour <br /> hex2bcd(set_h); // convert the hex value into bcd value <br /> if(set_h<=12) // this is check for hours <br /> DS1307_SetTime(bcd_value,set_m,set_s); // now the hour is updated with return bcd value <br /> else set_h=0; // if values (hour value greater than 12 then hour=00 )<br /> }<br /> <br /> if(set_high==0) // if the higer button is pressed <br /> {<br /> set_m++; // then after some delay , increment the hour <br /> hex2bcd(set_m); // convert the hex value into bcd value <br /> if(set_m<=59) // check for mints <br /> DS1307_SetTime(set_h,bcd_value,set_s); // now the mints is updated with return bcd value <br /> else set_m=0; // if mins greater than 59 then makes mints =00 <br /> }<br /> <br /> if(mode==0)<br /> {<br /> state = SHOW_DATE; <br /> }<br /> <br /> break;<br /> <br /> <br /> case SHOW_DATE:<br /> D1=date;D2=date_tens;D3=month;D4=month_tens;<br /> if(set_low==0) // if the lower buuton is pressed <br /> {<br /> set_d++; // then after some delay , increment the date <br /> hex2bcd(set_d); // convert the hex value into bcd value <br /> if(set_d<=30)<br /> DS1307_SetDate(bcd_value,set_mon,set_y); // now the date is updated with return bcd value <br /> else set_d=0;<br /> }<br /> <br /> if(set_high==0) // if the higher buuton is pressed <br /> {<br /> set_mon++; // then after some delay , increment the month <br /> hex2bcd(set_mon); // convert the hex value into bcd value <br /> if(set_mon<=12)<br /> DS1307_SetDate(set_d,bcd_value,set_y); // now the month is updated with return bcd value <br /> else set_mon=0;<br /> }<br /> <br /> if(mode==0)<br /> {<br /> state = SHOW_YEAR;<br /> } <br /> break;<br /> <br /> case SHOW_YEAR:<br /> D1=2;D2=0;D3=year;D4=year_tens;<br /> if(set_high==0) // if the higer buuton is pressed <br /> {<br /> set_y++; // then after some delay , increment the year <br /> hex2bcd(set_y); // convert the hex value into bcd value <br /> if(set_y<=99)<br /> DS1307_SetDate(set_d,set_mon,bcd_value); // now the year is updated with return bcd value <br /> else set_y=0;<br /> }<br /> <br /> if(mode==0)<br /> {<br /> state = SHOW_TIME;<br /> }<br /> <br /> break;<br /> } //switch close <br /> } //while loop close <br />} // main close <br /> <br /><br /><br />unsigned char hex2bcd (unsigned char x)<br />{<br /> <br /> bcd_value = (x / 10) << 4;<br /> bcd_value = bcd_value | (x % 10);<br /> return (bcd_value);<br />}</span></div>
<div style="text-align: justify;">
<br /></div>
<h3 style="text-align: justify;">
Functions Used In RTC Code :</h3>
<div style="text-align: justify;">
<span style="color: #660000;">#include <AT89X52.h><br />#define DS1307_ID 0xD0 // DS1307 ID<br />#define SEC_ADDRESS 0x00 // Address to access Ds1307 SEC register<br />#define DATE_ADDRESS 0x04 // Address to access Ds1307 DATE register<br />#define CONTROL 0x07 // Address to access Ds1307 CONTROL register<br />sbit seg_1= P2^0; <br />sbit seg_2= P2^1; <br />sbit seg_3= P2^2;<br />sbit seg_4= P2^3; <br />sbit SCL=P1^0; //SCL Connected to P1.0<br />sbit SDA=P1^1; //SDA Connected to P1.1<br /><br />void delay_sec(unsigned char sec_count);<br />void delay_ms(unsigned int ms_count);<br />void delay_us(unsigned int us_count);<br />void I2C_Clock(void);<br />void I2C_Start();<br />void I2C_Stop(void);<br />void I2C_Write(unsigned char dat);<br />unsigned char I2C_Read(void);<br />void I2C_Ack();<br />void I2C_NoAck();<br />void DS1307_Init();<br />void DS1307_Write(unsigned char dat);<br />unsigned char DS1307_Read();<br />void DS1307_SetTime(unsigned char hh, unsigned char mm, unsigned char ss);<br />void DS1307_SetDate(unsigned char dd, unsigned char mm, unsigned char yy);<br />void DS1307_GetTime(unsigned char *h_ptr,unsigned char *m_ptr,unsigned char *s_ptr);<br />void DS1307_GetDate(unsigned char *d_ptr,unsigned char *m_ptr,unsigned char *y_ptr);<br /><br />void delay_sec(unsigned char sec_count)<br /> {<br /> while(sec_count!=0)<br /> {<br /> delay_ms(1000); //delay_ms is called to generate 1sec delay<br /> sec_count--;<br /> }<br /> }<br /><br /><br />void delay_ms(unsigned int ms_count)<br /> {<br /> while(ms_count!=0)<br /> {<br /> delay_us(112); //delay_us is called to generate 1ms delay<br /> ms_count--;<br /> }<br /> }<br /> <br /> <br /> <br /> <br />void delay_us(unsigned int us_count)<br /> { <br /> while(us_count!=0)<br /> {<br /> us_count--;<br /> }<br /> }<br /><br /> <br />/*I2c Library .............................................................................*/<br /> <br />void I2C_Clock(void)<br /> <br />{<br /> delay_us(1);<br /> SCL = 1; // Wait for Some time and Pull the SCL line High<br /><br /> delay_us(1); // Wait for Some time<br /> SCL = 0; // Pull back the SCL line low to Generate a clock pulse<br />}<br /><br />void I2C_Start()<br />{<br /> SCL = 0; // Pull SCL low<br /><br /> SDA = 1; // Pull SDA High<br /> delay_us(1);<br /><br /> SCL = 1; //Pull SCL high<br /> delay_us(1);<br /><br /> SDA = 0; //Now Pull SDA LOW, to generate the Start Condition<br /> delay_us(1);<br /><br /> SCL = 0; //Finally Clear the SCL to complete the cycle<br />}<br /><br />void I2C_Stop(void)<br />{<br /> SCL = 0; // Pull SCL low<br /> delay_us(1);<br /><br /> SDA = 0; // Pull SDA low<br /> delay_us(1);<br /><br /> SCL = 1; // Pull SCL High<br /> delay_us(1);<br /><br /> SDA = 1; // Now Pull SDA High, to generate the Stop Condition<br />}<br /><br />void I2C_Write(unsigned char dat)<br />{<br /> unsigned char i;<br /><br /> for(i=0;i<8;i++) // loop 8 times to send 1-byte of data<br /> {<br /> SDA = dat & 0x80; // Send Bit by Bit on SDA line<br /> I2C_Clock(); // Generate Clock at SCL<br /> dat = dat<<1;<br /> }<br /> SDA = 1; // Set SDA at last<br />}<br /><br />unsigned char I2C_Read(void)<br />{<br /> unsigned char i, dat=0x00;<br /><br /> SDA=1; //Make SDA as I/P<br /> for(i=0;i<8;i++) // loop 8times to read 1-byte of data<br /> {<br /> delay_us(1);<br /> SCL = 1; // Pull SCL High<br /> delay_us(1);<br /><br /> dat = dat<<1; //dat is Shifted each time and<br /> dat = dat | SDA; //ORed with the received bit to pack into byte<br /><br /> SCL = 0; // Clear SCL to complete the Clock<br /> }<br /> return dat; // Finally return the received Byte*<br />}<br /><br />void I2C_Ack()<br />{<br /> SDA = 0; //Pull SDA low to indicate Positive ACK<br /> I2C_Clock(); //Generate the Clock<br /> SDA = 1; // Pull SDA back to High(IDLE state)<br />}<br /><br />void I2C_NoAck()<br />{<br /> SDA = 1; //Pull SDA high to indicate Negative/NO ACK<br /> I2C_Clock(); // Generate the Clock <br /> SCL = 1; // Set SCL */<br />}<br /><br />/*...............................1307 library ...............................*/<br /><br />void DS1307_Init()<br />{<br /> I2C_Start(); // Start I2C communication<br /><br /> DS1307_Write(DS1307_ID); // Connect to DS1307 by sending its ID on I2c Bus<br /> DS1307_Write(CONTROL); // Select the Ds1307 ControlRegister to configure Ds1307<br /><br /> DS1307_Write(0x00); // Write 0x00 to Control register to disable SQW-Out<br /><br /> I2C_Stop(); // Stop I2C communication after initilizing DS1307<br /><br /> }<br /><br />void DS1307_Write(unsigned char dat)<br />{<br /> I2C_Write(dat); // Connect to DS1307 by sending its ID on I2c Bus<br /> I2C_Clock();<br /> }<br /><br />unsigned char DS1307_Read()<br />{<br /> unsigned char dat;<br /> dat = I2C_Read(); // Connect to DS1307 by sending its ID on I2c Bus<br /> return(dat);<br /> }<br /><br />void DS1307_SetTime(unsigned char hh, unsigned char mm, unsigned char ss)<br />{<br /> I2C_Start(); // Start I2C communication<br /><br /> DS1307_Write(DS1307_ID); // connect to DS1307 by sending its ID on I2c Bus<br /> DS1307_Write(SEC_ADDRESS); // Select the SEC RAM address<br /> <br /> DS1307_Write(ss); // Write sec on RAM address 00H<br /> DS1307_Write(mm); // Write min on RAM address 01H<br /> DS1307_Write(hh); // Write hour on RAM address 02H<br /><br /> I2C_Stop(); // Stop I2C communication after Setting the Time<br />}<br /><br />void DS1307_SetDate(unsigned char dd, unsigned char mm, unsigned char yy)<br />{<br /> I2C_Start(); // Start I2C communication<br /><br /> DS1307_Write(DS1307_ID); // connect to DS1307 by sending its ID on I2c Bus<br /> DS1307_Write(DATE_ADDRESS); // Request DAY RAM address at 04H<br /><br /> DS1307_Write(dd); // Write date on RAM address 04H<br /> DS1307_Write(mm); // Write month on RAM address 05H<br /> DS1307_Write(yy); // Write year on RAM address 06h<br /><br /> I2C_Stop(); // Stop I2C communication after Setting the Date<br />}<br /><br />void DS1307_GetTime(unsigned char *h_ptr,unsigned char *m_ptr,unsigned char *s_ptr)<br />{<br /> I2C_Start(); // Start I2C communication<br /><br /> DS1307_Write(DS1307_ID); // connect to DS1307 by sending its ID on I2c Bus<br /> DS1307_Write(SEC_ADDRESS); // Request Sec RAM address at 00H<br /><br /> I2C_Stop(); // Stop I2C communication after selecting Sec Register<br /><br /> I2C_Start(); // Start I2C communication<br /> DS1307_Write(0xD1); // connect to DS1307( under Read mode)<br /> //by sending its ID on I2c Bus<br /><br /> *s_ptr = DS1307_Read(); I2C_Ack(); // read second and return Positive ACK<br /> *m_ptr = DS1307_Read(); I2C_Ack(); // read minute and return Positive ACK<br /> *h_ptr = DS1307_Read(); I2C_NoAck(); // read hour and return Negative/No ACK<br /><br /> I2C_Stop(); // Stop I2C communication after reading the Time<br /> }<br /><br />void DS1307_GetDate(unsigned char *d_ptr,unsigned char *m_ptr,unsigned char *y_ptr)<br />{<br /> I2C_Start(); // Start I2C communication<br /><br /> DS1307_Write(DS1307_ID); // connect to DS1307 by sending its ID on I2c Bus<br /> DS1307_Write(DATE_ADDRESS); // Request DAY RAM address at 04H<br /><br /> I2C_Stop(); // Stop I2C communication after selecting DAY Register<br /><br /><br /> I2C_Start(); // Start I2C communication<br /> DS1307_Write(0xD1); // connect to DS1307( under Read mode)<br /> // by sending its ID on I2c Bus<br /><br /> *d_ptr = DS1307_Read(); I2C_Ack(); // read Day and return Positive ACK<br /> *m_ptr = DS1307_Read(); I2C_Ack(); // read Month and return Positive ACK<br /> *y_ptr = DS1307_Read(); I2C_NoAck(); // read Year and return Negative/No ACK<br /><br /> I2C_Stop(); // Stop I2C communication after reading the Time<br /> }</span></div>
<div style="text-align: justify;">
///////////// This project is created in Kielu vesion 4 ........thanks </div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
</div>
ok friends if u have any problem in coding mail me Lcat215@gmail.com<br /><br /><br /><br /><br /><br />
<br />
<br />
<br /><br /><br /> </li>
</ol>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/13526216155838659104noreply@blogger.com2tag:blogger.com,1999:blog-2190029239849113272.post-36505718480905757072014-10-31T07:44:00.002-07:002015-10-02T10:43:12.258-07:00How to Interface IR Remotes with Arduino <div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
How to Interface IR Remotes with Arduino </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I'm tired of these complicated tutorials on how to use certain things. I
like simple, easy to understand, step by step instructions. My biggest
problem was with IR and POV*. I've finally mastered how to control my
project with any TV remote in a few minutes. In this i'ble I'm going to
show you simple, step by step instructions on how to control just about
anything with your IR remote.</div>
<div style="text-align: justify;">
<br /></div>
<h2 class="step-title" style="text-align: justify;">
Step 1: Ingredients:</h2>
<div style="text-align: justify;">
<b>Components : </b><br />
For Interfacing IR Remotes with Arduino </div>
<ul style="text-align: justify;">
<li> Arduino </li>
<li> Any IR remote </li>
<li> IR receiver </li>
<li> Breadboard </li>
<li> Jumper Cables </li>
<li> LED </li>
</ul>
<div style="text-align: justify;">
<br />
And here is the Make-To-Learn contest questions! - don't forget to vote!<br />
<a name='more'></a><br />
<br />
<b>What did you make?</b><br />
Well I didn't make anything specific in this instructable but it is
more of a guide to how to make your other projects 'wireless'.<br />
My projects works by taking TV remotes and other remotes, converting their signals to numbers, and using them.<br />
<b>How did you make it?</b><br />
I've been working on trying to use IR remotes. All the tutorials I
found didn't really put the all the bits and pieces together for me. My
main goal was to make an easy tutorial for others to follow.<br />
<b>Where did you make it?</b><br />
At my computer. I am now able to control my robots and other stuff,
like lights and lighting. For instance, I could make it so that whenever
I hit the play button on my DVD player remote, the lights in the room
dim, or go out.<br />
<b>What did you learn?</b><br />
My biggest challenge was finding a IR decoder that worked, and then finding installing the proper library</div>
<div style="text-align: justify;">
<br /></div>
<h2 class="step-title" style="text-align: justify;">
Step 2: All Those Remotes!</h2>
<div class="photoset" data-entry-id="S5Y9HUEHFD1DIHB" data-entry-url="/id/The-Easiest-Way-to-Use-Any-IR-Remote-with-Ardiuno/step3/All-Those-Remotes/" id="photoset-S5Y9HUEHFD1DIHB" style="text-align: justify;">
<div class="row" style="width: 600px;">
<a class="photoset-link selected" data-fancybox-href="http://cdn.instructables.com/FIL/JKCJ/HFD177QB/FILJKCJHFD177QB.LARGE.jpg" data-href="/file/FILJKCJHFD177QB" data-notes-lookup-id="FILJKCJHFD177QB-0" href="http://cdn.instructables.com/FIL/JKCJ/HFD177QB/FILJKCJHFD177QB.LARGE.jpg" id="photoset-link-FODS79II0G96XLX-0" rel="photoset-gallery-S5Y9HUEHFD1DIHB"></a><br />
<div class="photo-container" style="width: 600px;">
<a class="photoset-link selected" data-fancybox-href="http://cdn.instructables.com/FIL/JKCJ/HFD177QB/FILJKCJHFD177QB.LARGE.jpg" data-href="/file/FILJKCJHFD177QB" data-notes-lookup-id="FILJKCJHFD177QB-0" href="http://cdn.instructables.com/FIL/JKCJ/HFD177QB/FILJKCJHFD177QB.LARGE.jpg" id="photoset-link-FODS79II0G96XLX-0" rel="photoset-gallery-S5Y9HUEHFD1DIHB"><img alt="Picture of All Those Remotes!" class="photoset-photo id_FILJKCJHFD177QB " data-notes-lookup-id="FILJKCJHFD177QB-0" src="http://cdn.instructables.com/FIL/JKCJ/HFD177QB/FILJKCJHFD177QB.MEDIUM.jpg" style="width: 600px;" /></a></div>
<a class="photoset-link selected" data-fancybox-href="http://cdn.instructables.com/FIL/JKCJ/HFD177QB/FILJKCJHFD177QB.LARGE.jpg" data-href="/file/FILJKCJHFD177QB" data-notes-lookup-id="FILJKCJHFD177QB-0" href="http://cdn.instructables.com/FIL/JKCJ/HFD177QB/FILJKCJHFD177QB.LARGE.jpg" id="photoset-link-FODS79II0G96XLX-0" rel="photoset-gallery-S5Y9HUEHFD1DIHB">
</a></div>
</div>
<div style="text-align: justify;">
TV
Remotes, CD player remotes, heater remotes, DVD player remotes, all
those remotes! Many people just have old remotes laying around because
they item that the went to broke. I have collected quite a few remotes
over the past week. I just asked all my friends if they had any old
remotes laying around and sure enough I collected about 7 of them. So
finding a remote isn't very hard. I good option if you want a
professional looking one is to buy the specialty MP3 player remote. I
have one because it came with my Arduino kit.</div>
<div style="text-align: justify;">
<br /></div>
<h2 class="step-title" style="text-align: justify;">
Step 3: Installing the IR Library</h2>
<div class="txt step-body" style="text-align: justify;">
The
very first thing that we need to do associating with Arduino is to
download the IR library. Now just about every tutorial directed you to
Github, but it took me forever to find out how to even download it. Then
even after is was downloaded, it wasn't named properly. So, to make
things simpler, I have included a .zip of the IR library. Download it to
your computer, unzip it, then place it in your Arduino libraries
folder. Don't know where it is? <br />
Open up the Arduino IDE and on the menu select <b>Sketch>Import Library>Add Library</b> and select the 'IRremote' folder. <b><u>If you are on a PC you may need to delete the mac content within the IRremote folder. </u></b><br />
For resources here is the Github<br />
<br />
<br />
<a href="https://github.com/shirriff/Arduino-IRremote" rel="nofollow">https://github.com/shirriff/Arduino-IRremote</a><br />
<br />
<b>IF YOU HAVE ANY TROUBLE WITH THE .ZIP PLEASE PM ME OR COMMENT!</b><br />
<br />
<a href="http://www.mediafire.com/download/jd5j7911amju36g/IRremote.zip" rel="nofollow">http://www.mediafire.com/download/jd5j7911amju36g/IRremote.zip</a><br />
<br /></div>
<div class="ible-files" id="attachments" style="text-align: justify;">
<div class="entryExtra">
<a href="http://www.instructables.com/files/orig/FK6/1VSK/HFD1DNP8/FK61VSKHFD1DNP8.zip"><img alt="" src="http://www.instructables.com/static/defaultIMG/file/ZIP.gif" /><span class="entryExtraTitle">IRremote.zip</span></a>44 KB</div>
<div class="entryExtra">
</div>
<div class="entryExtra">
</div>
<div class="entryExtra">
<h2 class="step-title">
Step 4: Recognizing IR Signals</h2>
<div class="photoset" data-entry-id="SD7I6AZHFD1DNS2" data-entry-url="/id/The-Easiest-Way-to-Use-Any-IR-Remote-with-Ardiuno/step5/Recognizing-IR-Signals/" id="photoset-SD7I6AZHFD1DNS2">
<div class="row" style="width: 600px;">
<a class="photoset-link selected" data-fancybox-href="http://cdn.instructables.com/FBK/I2OF/HFD177UY/FBKI2OFHFD177UY.LARGE.jpg" data-href="/file/FBKI2OFHFD177UY" data-notes-lookup-id="FBKI2OFHFD177UY-0" href="http://cdn.instructables.com/FBK/I2OF/HFD177UY/FBKI2OFHFD177UY.LARGE.jpg" id="photoset-link-FQ1VNKWI0G96XM1-0" rel="photoset-gallery-SD7I6AZHFD1DNS2"></a><br />
<div class="photo-container" style="width: 431px;">
</div>
<a class="photoset-link selected" data-fancybox-href="http://cdn.instructables.com/FBK/I2OF/HFD177UY/FBKI2OFHFD177UY.LARGE.jpg" data-href="/file/FBKI2OFHFD177UY" data-notes-lookup-id="FBKI2OFHFD177UY-0" href="http://cdn.instructables.com/FBK/I2OF/HFD177UY/FBKI2OFHFD177UY.LARGE.jpg" id="photoset-link-FQ1VNKWI0G96XM1-0" rel="photoset-gallery-SD7I6AZHFD1DNS2">
</a></div>
</div>
<div class="txt step-body">
You now need to download the IR decoder sketch.<br />
<br />
<br />
<br />
<a href="http://cdn.instructables.com/FBK/I2OF/HFD177UY/FBKI2OFHFD177UY.MEDIUM.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img alt="Picture of Recognizing IR Signals" border="0" class="photoset-photo id_FBKI2OFHFD177UY " data-notes-lookup-id="FBKI2OFHFD177UY-0" src="http://cdn.instructables.com/FBK/I2OF/HFD177UY/FBKI2OFHFD177UY.MEDIUM.jpg" style="width: 431px;" /></a><a href="http://www.mediafire.com/view/6qnsndqp9a838xe/Decode_IR.ino" rel="nofollow">http://www.mediafire.com/view/6qnsndqp9a838xe/Decode_IR.ino</a><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
or copy and past this code<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<span style="color: #674ea7;">/*</span><br />
<span style="color: #674ea7;"> * Sketch modified by Enjoying Electronics: http://electronicsirfan.blogspot.com/2014/10/how-to-interface-ir-remotes-with-arduino.html: </span><br />
<span style="color: #674ea7;"> * IRremote</span><br />
<span style="color: #674ea7;"> * Version 0.1 July, 2009 </span><br />
<span style="color: #674ea7;"> * Copyright 2009 Ken Shirriff</span><br />
<span style="color: #674ea7;"> * For details, see http://arcfn.com/2009/08/multi-protocol-infrared-remote-library.html</span><br />
<span style="color: #674ea7;"><br /></span>
<span style="color: #674ea7;"> * Special thanks to dablondeemu http://www.instructables.com/member/dablondeemu/</span><br />
<span style="color: #674ea7;"> * and his instructable listed below, IR Remote Controlled Color Changing Cloud (Arduino) </span><br />
<span style="color: #674ea7;"> * http://www.instructables.com/id/IR-Remote-Controlled-Color-Changing-Cloud-Arduino/ </span><br />
<span style="color: #674ea7;"><br /></span>
<span style="color: #674ea7;"><br /></span>
<span style="color: #674ea7;"> * Lets get started:</span><br />
<span style="color: #674ea7;"><br /></span>
<span style="color: #674ea7;"> The IR sensor's pins are attached to Arduino as so:</span><br />
<span style="color: #674ea7;"> Pin 1 to Vout (pin 11 on Arduino)</span><br />
<span style="color: #674ea7;"> Pin 2 to GND</span><br />
<span style="color: #674ea7;"> Pin 3 to Vcc (+5v from Arduino)</span><br />
<span style="color: #674ea7;"><br /></span>
<span style="color: #674ea7;">*/</span><br />
<span style="color: #674ea7;"><br /></span>
<span style="color: #674ea7;">/*******************CODE BEGINS HERE********************/</span><br />
<span style="color: #674ea7;"><br /></span>
<span style="color: #674ea7;">#include <IRremote.h></span><br />
<span style="color: #674ea7;"><br /></span>
<span style="color: #674ea7;">int IRpin = 11;</span><br />
<span style="color: #674ea7;">IRrecv irrecv(IRpin);</span><br />
<span style="color: #674ea7;">decode_results results;</span><br />
<span style="color: #674ea7;"><br /></span>
<span style="color: #674ea7;">void setup()</span><br />
<span style="color: #674ea7;">{</span><br />
<span style="color: #674ea7;"> Serial.begin(9600);</span><br />
<span style="color: #674ea7;"> irrecv.enableIRIn(); // Start the receiver</span><br />
<span style="color: #674ea7;">}</span><br />
<span style="color: #674ea7;"><br /></span>
<span style="color: #674ea7;">void loop() </span><br />
<span style="color: #674ea7;">{</span><br />
<span style="color: #674ea7;"> if (irrecv.decode(&results)) </span><br />
<span style="color: #674ea7;"> {</span><br />
<span style="color: #674ea7;"> Serial.println(results.value, DEC); // Print the Serial 'results.value'</span><br />
<span style="color: #674ea7;"> irrecv.resume(); // Receive the next value</span><br />
<span style="color: #674ea7;"> }</span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;">} </span><br />
<span style="color: #674ea7;"><br /></span>
<span style="color: #674ea7;"><br /></span>
<span style="color: #674ea7;"><br /></span>
<br />
<br />
<br />
<br />
<br />
I totally re-edited the github sketch to make it work. I put all the
credits in the sketch. The sketch is attached to this step or you can
get if from step 2. Upload this sketch to your Arduino. Now hook up the
IR sensor.<br />
<br />
The IR sensor's pins are attached to Arduino as so: (from left to right with the sensor's head facing you)<br />
<br />
(Vout) Pin 1 to pin 11(Arduino)<br />
(GND) Pin 2 to GND(Arduino)<br />
(Vcc) Pin 3 to 5v(Arduino)<br />
<br />
Now open up granola cereal, wait no, I meant serial monitor. Aim your
remote at the sensor and press the POWER button. You should see a list
of numbers show. Now you can see we got the numbers:<br />
<span style="color: #6aa84f;"><br /></span>
<span style="color: #6aa84f;">16753245</span><br />
<span style="color: #6aa84f;">4294967295</span><br />
<span style="color: #6aa84f;">4294967295</span><br />
<span style="color: #6aa84f;">4294967295</span><br />
<br />
Notice you if hold down whatever button you were pressing that the second number just repeats itself.<br />
<br />
<span style="color: #6aa84f;">16753245</span><br />
<span style="color: #6aa84f;">4294967295</span><br />
<span style="color: #6aa84f;">4294967295</span><br />
<span style="color: #6aa84f;">4294967295</span><br />
<span style="color: #6aa84f;">4294967295</span><br />
<span style="color: #6aa84f;">4294967295</span><br />
<span style="color: #6aa84f;">4294967295</span><br />
<span style="color: #6aa84f;">4294967295</span><br />
<br />
Note what happens if you press another button<br />
<br />
<span style="color: #6aa84f;">16736925</span><br />
<span style="color: #6aa84f;">4294967295</span><br />
<span style="color: #6aa84f;">4294967295</span><br />
<span style="color: #6aa84f;">4294967295</span><br />
<span style="color: #6aa84f;">4294967295</span><br />
<br />
<b>You get a different first number, and the same second number!</b><br />
Obviously, we just need to use the first number. Try hitting different
buttons on the remote. You will notice that each different button has a
different first number.<br />
<br />
So what you need to do is to open up
serial monitor press each button, carefully recording the first number.
For example: I press the power button and the mode button, so in my text
editor program, I'll type,<br />
<br />
<span style="color: #6aa84f;">Power button = 16753245</span><br />
<span style="color: #6aa84f;">Mode button = 16736925</span><br />
<br />
And you do this for every button you need!<br />
With this knowledge we can construct some code!<br />
<br />
<br />
<h2 class="step-title">
Step 5: Arduino Test Code</h2>
<h2 class="step-title">
</h2>
<div class="txt step-body">
Upload this sketch to your Arduino.</div>
<div class="txt step-body">
<br />
<a href="http://www.mediafire.com/view/hmv13ynbihed0eg/Test_LED.ino" rel="nofollow">http://www.mediafire.com/view/hmv13ynbihed0eg/Test_LED.ino</a> <br />
<pre> </pre>
<pre> </pre>
<pre> </pre>
<pre> </pre>
<pre> </pre>
<pre><span style="color: #674ea7;">/*</span></pre>
<pre><span style="color: #674ea7;"> Some Sample code of how to use your IR remote
* Lets get started:
The IR sensor's pins are attached to Arduino as so:
Pin 1 to Vout (pin 11 on Arduino)
Pin 2 to GND
Pin 3 to Vcc (+5v from Arduino)
*/
#include <IRremote.h>
int IRpin = 11; // pin for the IR sensor
int LED = 13; // LED pin
IRrecv irrecv(IRpin);
decode_results results;
boolean LEDon = true; // initializing LEDon as true
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
pinMode(LED, OUTPUT);
}
void loop()
{
if (irrecv.decode(&results))
{
irrecv.resume(); // Receive the next value
}
if (results.value == 0) // change zero to your IR remote button number
{
if (LEDon == true) // is LEDon equal to true?
{
LEDon = false;
digitalWrite(LED, HIGH);
delay(100); // keeps the transistion smooth
}
else
{
LEDon = true;
digitalWrite(LED, LOW);
delay(100);
}
}
}
</span></pre>
<span style="color: #8e7cc3;"><br /></span>
<br />
<br />
This code is to turn an LED on and off with the same button. Notice this line in the code.<br />
<br />
<pre><span style="color: #674ea7;">if (results.value == 0) // change zero to your IR remote button number</span></pre>
<pre><span style="color: #674ea7;"> </span></pre>
<br />
You
will change 0 to whatever number your IR remote button makes. For
instance, my power button's number is 16753245, so I will change the
code to this:<br />
<br />
<pre><span style="color: #674ea7;">if (results.value == 16753245)</span></pre>
<pre> </pre>
<pre> </pre>
results.value
is just what you see in the serial monitor. So if I say, if
results.value is equal to 16753245, then do such and such. Make sense?!
So the rest of the code if for making the same button turn an LED on and
off. When the LED if off and you hit the button it turns on and if the
LED is on and if you hit the same button again it turns off.</div>
<br />
<br />
<br />
<h2 class="step-title">
Step 6: More Code!</h2>
So
what if we want each button on the remote to do a different function?
Making a lot of 'if' statements would be way too much typing! So lets
simplify this with a switch/case statement.<br />
<pre>switch(results.value)</pre>
We are going to put this after the void loop and after the first if statement. Here's the whole thing-<br />
<pre>void loop()
<span style="color: #674ea7;"> if (irrecv.decode(&results))
{
irrecv.resume(); // Receive the next value
}
switch(results.value)
{</span></pre>
<pre> </pre>
<br />
So now we need finish the code. If you don't know what the switch/case are<br />
<br />
see <a href="http://arduino.cc/en/Reference/SwitchCase" rel="nofollow">http://arduino.cc/en/Reference/SwitchCase</a><br />
<br />
Here is the final code. You can keep on adding cases. Now where it says
'case 03' you change the '03' to whatever button number you wish. For
instance, the first case could say:<br />
<br />
<pre><span style="color: #674ea7;">case 16753245:
// do this
break;</span></pre>
<pre><span style="color: #674ea7;"> </span></pre>
And we just keep on adding different button numbers for to do different things.</div>
<div class="txt step-body">
<br />
<h4>
like <i><b><span style="color: yellow;"><span style="background-color: #38761d;">control Four relays</span></span></b></i> .... By using this code</h4>
<br />
<br />
<br />
<br />
<span style="color: #674ea7;">/*</span><br />
<span style="color: #674ea7;"> Some Sample code of how to use your IR remote</span><br />
<span style="color: #674ea7;"><br /></span>
<span style="color: #674ea7;"> * Lets get started:</span><br />
<span style="color: #674ea7;"><br /></span>
<span style="color: #674ea7;"> The IR sensor's pins are attached to Arduino as so:</span><br />
<span style="color: #674ea7;"> Pin 1 to Vout (pin 11 on Arduino)</span><br />
<span style="color: #674ea7;"> Pin 2 to GND</span><br />
<span style="color: #674ea7;"> Pin 3 to Vcc (+5v from Arduino)</span><br />
<span style="color: #674ea7;"><br /></span>
<span style="color: #674ea7;">*/</span><br />
<span style="color: #674ea7;"><br /></span>
<span style="color: #674ea7;">#include <IRremote.h></span><br />
<span style="color: #674ea7;"><br /></span>
<span style="color: #674ea7;">int IRpin = 2; // pin for the IR sensor</span><br />
<span style="color: #674ea7;">int RelayOne = 3;</span><br />
<span style="color: #674ea7;">int RelayTwo = 4;</span><br />
<span style="color: #674ea7;">int RelayThree = 5;</span><br />
<span style="color: #674ea7;">int RelayFour = 6; </span><br />
<span style="color: #674ea7;">IRrecv irrecv(IRpin);</span><br />
<span style="color: #674ea7;">decode_results results;</span><br />
<span style="color: #674ea7;">boolean RelayOneOn = true; // initializing RelayOneOn as true</span><br />
<span style="color: #674ea7;">boolean RelayTwoOn = true; </span><br />
<span style="color: #674ea7;">boolean RelayThreeOn = true; </span><br />
<span style="color: #674ea7;">boolean RelayFourOn = true; </span><br />
<span style="color: #674ea7;"><br /></span>
<span style="color: #674ea7;">void setup()</span><br />
<span style="color: #674ea7;">{</span><br />
<span style="color: #674ea7;"> Serial.begin(9600);</span><br />
<span style="color: #674ea7;"> irrecv.enableIRIn(); // Start the receiver</span><br />
<span style="color: #674ea7;"> pinMode(RelayOne, OUTPUT);</span><br />
<span style="color: #674ea7;"> pinMode(RelayTwo, OUTPUT);</span><br />
<span style="color: #674ea7;"> pinMode(RelayThree, OUTPUT);</span><br />
<span style="color: #674ea7;"> pinMode(RelayFour, OUTPUT);</span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;">}</span><br />
<span style="color: #674ea7;"><br /></span>
<span style="color: #674ea7;">void loop() </span><br />
<span style="color: #674ea7;">{</span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;"> if (irrecv.decode(&results)) </span><br />
<span style="color: #674ea7;"> {</span><br />
<span style="color: #674ea7;"> Serial.println(results.value, DEC); // Print the Serial 'results.value' </span><br />
<span style="color: #674ea7;"> irrecv.resume(); // Receive the next value</span><br />
<span style="color: #674ea7;"> }</span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;"> switch(results.value)</span><br />
<span style="color: #674ea7;"> {</span><br />
<span style="color: #674ea7;"><br /></span>
<span style="color: #674ea7;"> case 16724175: //Recorded Value of One </span><br />
<span style="color: #674ea7;"> {</span><br />
<span style="color: #674ea7;"> if (RelayOneOn == true) // is LEDon equal to true? </span><br />
<span style="color: #674ea7;"> {</span><br />
<span style="color: #674ea7;"> RelayOneOn = false; </span><br />
<span style="color: #674ea7;"> digitalWrite(RelayOne, HIGH);</span><br />
<span style="color: #674ea7;"> delay(100); // keeps the transistion smooth</span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;"> }</span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;"> else</span><br />
<span style="color: #674ea7;"> {</span><br />
<span style="color: #674ea7;"> RelayOneOn = true;</span><br />
<span style="color: #674ea7;"> digitalWrite(RelayOne, LOW);</span><br />
<span style="color: #674ea7;"> delay(100);</span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;"> }</span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;"> }</span><br />
<span style="color: #674ea7;"> break;</span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;"> case 16718055:</span><br />
<span style="color: #674ea7;"> {</span><br />
<span style="color: #674ea7;"> if (RelayTwoOn == true) // is LEDon equal to true? </span><br />
<span style="color: #674ea7;"> {</span><br />
<span style="color: #674ea7;"> RelayTwoOn = false; </span><br />
<span style="color: #674ea7;"> digitalWrite(RelayTwo, HIGH);</span><br />
<span style="color: #674ea7;"> delay(100); // keeps the transistion smooth</span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;"> }</span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;"> else</span><br />
<span style="color: #674ea7;"> {</span><br />
<span style="color: #674ea7;"> RelayTwoOn = true;</span><br />
<span style="color: #674ea7;"> digitalWrite(RelayTwo, LOW);</span><br />
<span style="color: #674ea7;"> delay(100);</span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;"> }</span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;"> }</span><br />
<span style="color: #674ea7;"> break;</span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;"> case 16743045:</span><br />
<span style="color: #674ea7;"> {</span><br />
<span style="color: #674ea7;"> if (RelayThreeOn == true) // is LEDon equal to true? </span><br />
<span style="color: #674ea7;"> {</span><br />
<span style="color: #674ea7;"> RelayThreeOn = false; </span><br />
<span style="color: #674ea7;"> digitalWrite(RelayThree, HIGH);</span><br />
<span style="color: #674ea7;"> delay(100); // keeps the transistion smooth</span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;"> }</span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;"> else</span><br />
<span style="color: #674ea7;"> {</span><br />
<span style="color: #674ea7;"> RelayThreeOn = true;</span><br />
<span style="color: #674ea7;"> digitalWrite(RelayThree, LOW);</span><br />
<span style="color: #674ea7;"> delay(100);</span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;"> }</span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;"> }</span><br />
<span style="color: #674ea7;"> break;</span><br />
<span style="color: #674ea7;"> case 16716015:</span><br />
<span style="color: #674ea7;"> {</span><br />
<span style="color: #674ea7;"> if (RelayFourOn == true) // is LEDon equal to true? </span><br />
<span style="color: #674ea7;"> {</span><br />
<span style="color: #674ea7;"> RelayFourOn = false; </span><br />
<span style="color: #674ea7;"> digitalWrite(RelayFour, HIGH);</span><br />
<span style="color: #674ea7;"> delay(100); // keeps the transistion smooth</span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;"> }</span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;"> else</span><br />
<span style="color: #674ea7;"> {</span><br />
<span style="color: #674ea7;"> RelayFourOn = true;</span><br />
<span style="color: #674ea7;"> digitalWrite(RelayFour, LOW);</span><br />
<span style="color: #674ea7;"> delay(100);</span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;"> }</span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;"> }</span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;"> // default:</span><br />
<span style="color: #674ea7;"> // digitalWrite(LED, LOW);</span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;"> }</span><br />
<span style="color: #674ea7;"> </span><br />
<span style="color: #674ea7;">} </span></div>
</div>
<div class="entryExtra">
</div>
<div class="entryExtra">
</div>
<div class="entryExtra">
Electronics Lab is Created by Muhammad Irfan </div>
<div class="entryExtra">
</div>
<div class="entryExtra">
</div>
<div class="entryExtra">
</div>
</div>
<table cellpadding="0" cellspacing="0" class="adwrapper"><tbody>
<tr><td class="adhole"><br /></td><td class="adgutter">
</td></tr>
</tbody></table>
<br />
<h2 class="step-title">
</h2>
<br /></div>
Anonymoushttp://www.blogger.com/profile/13526216155838659104noreply@blogger.com0tag:blogger.com,1999:blog-2190029239849113272.post-22404818977862492602014-10-26T09:31:00.000-07:002015-10-02T10:43:35.547-07:00Build Your Own Arduino Board <div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
Build Your Own Arduino Board</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Build Your Own Arduino Board is a very very Fantastic Tutorial .....................</div>
<div style="text-align: justify;">
<br /></div>
<div dir="ltr" style="text-align: justify;">
After having fun and experimenting with your Arduino board, you will most likely think of various projects that could be
self-contained, if only they didn't rely on using a whole Arduino or
compatible board. Or you may wish to experiment with the Arduino
platform at a lower cost. In these and many other cases you can in fact
build your own Arduino-compatible circuit using a solderless breadboard.</div>
<div>
</div>
<div dir="ltr" style="text-align: justify;">
After looking at your full-sized Arduino or Eleven board
you may think that the circuitry is quite complex, however in reality it
is very simple… and by following the instructions detailed below you'll
have your own version operating in a short period of time.</div>
<div style="text-align: justify;">
<br /></div>
<div dir="ltr" style="text-align: justify;">
<i><b>Required Parts </b></i></div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
for build your own Arduino Board .... </div>
<div dir="ltr" style="text-align: justify;">
As well as a solderless breadboard, you will need a few basic parts as shown in the image below:<br />
<a name='more'></a></div>
<div style="text-align: justify;">
</div>
<b><b><img alt="" height="342px;" src="https://lh4.googleusercontent.com/QhYQAkoJK874u9c_HH0WZnLbQCP1vkWQc8ScklTN5ydZZFbmgZvTi0YgZvbFDjjBoSsUNsGq_BZjtwaYyE4pH-4YVoL2vXVX9kq7U79Z2nfBuwbo06bb5N6f9Q" style="display: block; margin-left: auto; margin-right: auto;" width="393px;" /></b></b><br />
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
Listed from left to right are:</div>
<div style="text-align: justify;">
</div>
<ul style="text-align: justify;">
<li><span style="line-height: 1.2;">10 kΩ ¼ watt resistor</span></li>
<li><span style="line-height: 1.2;">two 22 pF ceramic capacitors</span></li>
<li><a href="http://www.freetronics.com/collections/arduino/products/atmega328p-mcu-with-arduino-bootloader" style="line-height: 1.2;">ATmega328P microcontroller</a><span style="line-height: 1.2;"> with Arduino bootloader</span></li>
<li><span style="line-height: 1.2;">16 MHz crystal</span></li>
</ul>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
Furthermore, if you don’t have a regulated 5V DC power
supply - you can make a simple one that fits right on the breadboard,
using the following parts shown below:</div>
<div style="text-align: justify;">
</div>
<b><b><img alt="" height="225px;" src="https://lh5.googleusercontent.com/yy-3zn1HHGUZFiXLQCXP4kw_tt02Gv8ETWVTHhZ1jWH3rUzBmecynZVyJXEzGJ7wFTR8liKwcvC-h85b0ErZi_8GR8nMpCugKrX4rdrhCDlD9oiBuZa1Jek9qw" style="display: block; margin-left: auto; margin-right: auto;" width="344px;" /></b></b><br />
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
Listed from left to right are:</div>
<div style="text-align: justify;">
</div>
<ul style="text-align: justify;">
<li><span style="line-height: 1.2;">7805 voltage regulator</span></li>
<li><span style="line-height: 1.2;">two 100 uF 25 V electrolytic capacitors</span></li>
</ul>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
Using these parts allows you to use a power supply of
between 7 and 12 V DC. You will also want a variety of jumper and
connecting wires to use with your solderless breadboard</div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
<i><b>Assembling the circuit</b></i></div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
for build your own Arduino Board .... </div>
<div dir="ltr" style="text-align: justify;">
Now we will build the circuit, step-by-step on the solderless breadboard.</div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
<i>Step One:</i></div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
First, take your microcontroller and place it around the centre of the breadboard as such:</div>
<div style="text-align: justify;">
</div>
<b><b><img alt="" height="257px;" src="https://lh5.googleusercontent.com/uIYEukOv8C9uaPqahCVY_0YOi1I9EnnMTnphcmQbr4Q-gtHcikeOW3P9siVlssS90S1SvFJOu0Y3VvvxC5MoRVf-DROfjZcLsnPKiVwTs6IHvaMVazI2bjq6FA" style="display: block; margin-left: auto; margin-right: auto;" width="500px;" /></b></b><br />
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
Note how the label shows the equivalent to the Arduino
pinouts. If your microcontroller doesn’t have the label (which you can
order <a href="http://www.freetronics.com/collections/arduino/products/microcontroller-labels-arduino-pinout">separately</a>) make sure pin one is at the bottom-left when positioning on the breadboard, as shown with the yellow circle below:</div>
<div style="text-align: justify;">
</div>
<b><b><img alt="" height="310px;" src="https://lh4.googleusercontent.com/g0ySlB_aSb0g2v4GmdMY5tJK9L465b3VSLt1_V_gdNpDJh0P4UeR-uD9MnqfOzTbTVvAeilBWJsDEX7FAnB3urL2c1Q0MKvKsgAAa24HBoYS_jMiUs0tPyI6" style="display: block; margin-left: auto; margin-right: auto;" width="500px;" /></b></b><br />
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
<i>Step Two:</i></div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
Next we’ll add the circuit for the power supply. (You can
skip these and move forward to Step Five if you have a regulated 5V
supply). Take your 7805 regulator and place it very close to the
far-left of the breadboard:</div>
<div style="text-align: justify;">
</div>
<b><b><img alt="" height="313px;" src="https://lh6.googleusercontent.com/MkmIpZMh4xmpH3-x7VV_4wnqphqpG7m6bGlB5MCqEsN02sfrNgRyTjo08fHnX5hiIxQY8CsUwUHQx5ZbDTob0Gk855Fv7hTU6q6D99cYVpJDCeTnCw168vId7g" style="display: block; margin-left: auto; margin-right: auto;" width="327px;" /></b></b><br />
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
<i>Step Three:</i></div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
Add the following three wires to the breadboard as shown below:</div>
<div style="text-align: justify;">
</div>
<b><b><img alt="" height="369px;" src="https://lh4.googleusercontent.com/seFqwoIF5hu6xNX71qLFv-fs2R0j4SLgaVDjR07mChuArbz36Sq1dON8ku5cxbFkonZ6CSfcdhvPSh9TtYLeByquv-0ZeH9ESPj-C7GF3qXgLqfCq2_gEdO23A" style="display: block; margin-left: auto; margin-right: auto;" width="500px;" /></b></b><br />
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
The wire on the left connects to the column where you will
feed in between 7 and 12 V to power the circuit (but don’t connect the
power yet!), the centre wire connects to the GND row and the wire on the
right is the 5V output.</div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
<i>Step Four:</i></div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
Now add the two electrolytic capacitors. One will bridge
the power-input column (the left-hand leg of the voltage regulator) and
the GND column, and the other will bridge GND and the 5V rows at the
bottom of the breadboard. The negative side of the capacitors will
connect to the GND column and row.. The negative leg of the electrolytic
capacitor is closes to the white stripe:</div>
<div style="text-align: justify;">
</div>
<b><b><img alt="" height="442px;" src="https://lh6.googleusercontent.com/viOvnq7NKHzpMBKOK54BnwHYRQoh7eZzOz6jBlEvzb4JVapQ1oWtSd1ldQ8WkDJTkV3XEE7uo5mMYDqZ4tOhSnQChadp0SLwqUbhZ4qGDgKSWJ4CqGIN4jKloQ" style="display: block; margin-left: auto; margin-right: auto;" width="500px;" /></b></b><br />
<br />
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
<i>Step Five:</i></div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
At this point add two jumper wires across the top and
bottom centre parts of the 5V and GND rows - this ensures they are
available across the entire length of the breadboard. Furthermore, run a
jumper to connect the bottom 5V and GND rows with the rows at the top:</div>
<div style="text-align: justify;">
</div>
<b><b><img alt="" height="246px;" src="https://lh3.googleusercontent.com/oUeLvoWLu_3elddQHupgfPPWm1UHxGyCD_haw16OURYt0lrftp9AZDgfL0IynWIgKaDDOstB9Q-flIMR26VRMelSWFH7gpmLV0I8ToShSvkqGRg3U-JtQLQofg" style="display: block; margin-left: auto; margin-right: auto;" width="500px;" /></b></b><br />
<br />
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
Furthermore, run a jumper to connect the bottom and top 5V and GND rows respectively:</div>
<div style="text-align: justify;">
</div>
<b><b><img alt="" height="343px;" src="https://lh4.googleusercontent.com/76sDNjo8Z2DzRiWIclFN2IxEOMWWybzWezsqmF2mVUqWVwNGyA1IGZERdTUsAuk4NuMEXvAlvsWkWxbfTGsu931djs8R3NRQOIfxfY2q2KcdYycWig5KRNl6PQ" style="display: block; margin-left: auto; margin-right: auto;" width="500px;" /></b></b><br />
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
<i>Step Six:</i></div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
Now let’s get the microcontroller wired up. Connect the 10
kΩ resistor between pin one of the microcontroller and the 5V row, and
the following jumpers to your breadboard:</div>
<div style="text-align: justify;">
</div>
<b><b><img alt="" height="475px;" src="https://lh5.googleusercontent.com/CZwDG1nuR1TNj9OKt_eJAF2ieE6a_RIgIBuagHcxJZL39L5EhEaeAfScvJMTrie_2rCSMB_mrNmFUHs4S_9Lzn93FeOvrjHIsd6G4jaVJnY3c1mR3xLmJ5s1LQ" style="display: block; margin-left: auto; margin-right: auto;" width="500px;" /></b></b><br />
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
<i>Step Seven:</i></div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
Next, add the two horizontal jumpers as shown below:</div>
<div style="text-align: justify;">
</div>
<b><b><img alt="" height="229px;" src="https://lh5.googleusercontent.com/P6RcX-ZasURatvMPAg8yr9tCJf3bRBCeKI5XyHzcUQ8_omO-v2Jca6tCvHXegpQVczUqnjX8vcdMvLNyHWZD9oAkNH3FPLWkYdkXiBZpfYP0BlJ6d_P5xTn7VQ" style="display: block; margin-left: auto; margin-right: auto;" width="500px;" /></b></b><br />
<br />
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
Note that one is connected to the pin labelled X1 and
continues two columns further to the right of the lower jumper connected
to X2.</div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
<i>Step Eight:</i></div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
In this step you add the crystal - making sure one leg
connects to the jumper to X1 and the other to the jumper connected to X2
as shown below. Next, connect the two ceramic capacitors. Be careful to
ensure each one connects between a column of the crystal leg and GND:</div>
<div style="text-align: justify;">
</div>
<b><b><img alt="" height="451px;" src="https://lh5.googleusercontent.com/FrZKdSIopTA3yJ4RtPktrX0-GkE68yK_xuxhqex9EMyC4WPS_oeHeU8Ebcsp1S0PFl1XQzb0gNRYAz3DVscivIjoS_0X-rFgWnurj5LfT801U2zbzDVQR9wBHw" style="display: block; margin-left: auto; margin-right: auto;" width="500px;" /></b></b><br />
<br />
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
Step Nine:</div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
At this point your breadboard-Arduino is finished, with
power supply if required. Take a moment to review the steps and
double-check your connections:</div>
<div style="text-align: justify;">
</div>
<b><b><img alt="" height="265px;" src="https://lh6.googleusercontent.com/U3Y50CcOjEddU008cZ3_UtUDo8EENs1Wkb5bHKUIseH43_2nrqjmhcND9PMFqBDfGM0x_TmFFfc0uSPqyU2KrxDUUl0BzhExaJddOnphcRvKiPq80h3wNlWhdQ" style="display: block; margin-left: auto; margin-right: auto;" width="613px;" /></b></b><br />
<br />
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
<i><b>Uploading sketches to the breadboard Arduino</b></i></div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
As the breadboard lacks a USB socket to allow simple
uploading of sketches, you have a few alternatives to get your project
running:</div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
<br /></div>
<div dir="ltr" style="text-align: justify;">
<i><b>Using a USBasp programmer</b></i></div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
for build your own Arduino Board .... </div>
<div dir="ltr" style="text-align: justify;">
If you’re working more often with your breadboard Arduino
and find yourself constantly uploading and testing sketch revisions it
really pays to have an external programmer such as our <a href="http://www.freetronics.com/collections/modules/products/usbasp-icsp-programmer-for-avr-arduino">USBasp</a>.
This is a small board that connects to your PC via USB, and has a
six-wire lead which can program Arduino and compatible boards as well as
your breadboard Arduino:</div>
<div style="text-align: justify;">
</div>
<b><b><img alt="" height="319px;" src="https://lh6.googleusercontent.com/LKr7RZHbMYDwNoBGYYLwcSZ91dV10Eu0nCvHzzb_Z7dfx4VMVTR4xWZtARfTfNMpy1S52aqLJsRz8MfN5f_E9bq2l6W4CYoF-CiTQfEc2T5azwnxh6gCaPl2Cg" style="display: block; margin-left: auto; margin-right: auto;" width="480px;" /></b></b><br />
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
Using the programmer is very easy. You will need six jumper
wires, which are connected to the socket at the end of the ribbon cable
included with your USBasp. When looking at the ribbon cable connector,
have the holes facing you - and note the pins are numbered 1/2, 3/4, 5/6
from top to bottom:</div>
<div style="text-align: justify;">
</div>
<b><b><img alt="" height="236px;" src="https://lh5.googleusercontent.com/bSPIvl4AzWWu4WpVMMfzonzDnak_Uim5Uf3T073X6tMlknctw6GxUqVbVi646etI5YJaeMFJGNDs0PYZ1aR6iX_qXnFTh306kWx1KlYhqDA8K_KhOohg3oDt" style="display: block; margin-left: auto; margin-right: auto;" width="500px;" /></b></b><br />
<br />
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
Now connect jumper wires from the connector holes as follows:</div>
<div style="text-align: justify;">
</div>
<ol style="text-align: justify;">
<li><span style="line-height: 1.2;">Connect to the 5V row at the top or bottom of the breadboard;</span></li>
<li><span style="line-height: 1.2;">connect to the microcontroller pin labelled “D12” (physical pin 18);</span></li>
<li><span style="line-height: 1.2;">connect to the microcontroller pin labelled “D11” (physical pin 17);</span></li>
<li><span style="line-height: 1.2;">connect to the microcontroller pin labelled “D13” (physical pin 19);</span></li>
<li><span style="line-height: 1.2;">connect to the GND row at the top or bottom of the breadboard;</span></li>
<li><span style="line-height: 1.2;">connect to the microcontroller pin labelled RST (physical pin 1).</span></li>
</ol>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
Finally check the target voltage switch on the USBasp is
set to 5V, then connect it to your PC via the USB port. Then open your
sketch in the Arduino IDE and use the following menu items:</div>
<div style="text-align: justify;">
</div>
<ol style="text-align: justify;">
<li dir="ltr">
<div dir="ltr">
Select Tools > Board and select Arduino Uno;</div>
</li>
<li dir="ltr">
<div dir="ltr">
Select Tools > Programmer and select "USBasp" as the programmer type;</div>
</li>
<li dir="ltr">
<div dir="ltr">
Finally - Select File > Upload Using Programmer. The
Arduino IDE will then compile and upload your sketch onto the breadboard
Arduino</div>
</li>
</ol>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
<i><b>Add a USB serial port to your breadboard</b></i></div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
for build your own Arduino Board .... </div>
<div dir="ltr" style="text-align: justify;">
You can add a USB serial port to your breadboard Arduino in no time at all with our <a href="http://www.freetronics.com/products/usb-serial-adapter">USB-Serial Adapter</a>.
It gives you all the functionality that a normal board has - a USB
socket to upload sketches, and full serial access so you can use the
Serial Monitor - or send and receive data with other PC-based
applications in python, etc.</div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
<span style="line-height: 1.2;">To use this method, you
will need (apart from the USB-Serial Adapter) a 0.1 uF capacitor and
(optionally) a six-way header pin, as shown below:</span></div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
<i><b><b><img alt="" height="221px;" src="https://lh5.googleusercontent.com/l69h03jt_DN5C0ZIMNwwsEk0hWkPePgV97KtAHm-N89YQWNubpwUymD9mG6l6bP86WfZDi_gQAPmDIal7_7BMPo9i5Il4CJgJAYmZZ6hInDhrZnvRiBNWsmbDA" style="display: block; margin-left: auto; margin-right: auto;" width="597px;" /></b></b></i></div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
Adding the required wiring to the breadboard is easy. You
need to connect five of the sockets on the end of the USB-Serial Adapter
to the microcontroller on the breadboard as listed below:</div>
<div style="text-align: justify;">
</div>
<ul style="text-align: justify;">
<li><span style="line-height: 1.2;">GND to the GND line;</span></li>
<li><span style="line-height: 1.2;">Vout to the 5V line;</span></li>
<li><span style="line-height: 1.2;">TX to pin 2 on the microcontroller (labelled “RX”);</span></li>
<li><span style="line-height: 1.2;">RX to pin 3 on the microcontroller (labelled “TX”);</span></li>
<li><span style="line-height: 1.2;">CTS to one end of the 0.1 uF capacitor. The connect the other side of the capacitor to pin 1 on the microcontroller.</span></li>
</ul>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
<span style="line-height: 1.2;">You may wish to follow the wiring as shown below:</span></div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
<i><b><b><img alt="" height="322px;" src="https://lh4.googleusercontent.com/N8xdiJDqpGL7C1GAVcQLTLBqbDg1gm3MpBlJ9l33tAYySUK42UgIo7GJaPHI-Lpk7vwZnFX7RJ5W47h9zNyK1WG1CB2IkHCUyPl75HyJI9mqvLjKSBI92dDDMA" style="display: block; margin-left: auto; margin-right: auto;" width="393px;" /></b></b></i></div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
At which point you can fit the header pins to the USB-Serial Adapter, then insert it into the breadboard as shown:</div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
<i><b><b><img alt="" height="453px;" src="https://lh3.googleusercontent.com/TuMLOCdLfveFguLR9zLVo9ObI16wUMGQDMnQJEZFXy65YbGyZf4wOEYxUUCXgpW3OwvSM4Iiib_UcQxVVNkXiqJcmy37038P6N0bRQwz-hOVMyu57saa6JQK" style="display: block; margin-left: auto; margin-right: auto;" width="400px;" /></b></b></i></div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
Now you can treat the breadboard Arduino just like an
Arduino Uno or Freetronics Eleven board - and have a convenient and
reliable method of uploading sketches or using serial with your project.
Be sure to set your board type to “Arduino Uno” in the IDE. Before
using the adapter for the first time, please follow the <a href="http://www.freetronics.com/pages/usbserial-usb-serial-adapter-quickstart-guide">Quickstart Guide</a> for the USB-Serial adapter - then you can simply connect the included USB cable and move forward with your project.</div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
<i style="line-height: 1.2;"><b>Where to from here?</b></i></div>
<div style="text-align: justify;">
</div>
<div dir="ltr" style="text-align: justify;">
Now you have the freedom to use all the functionality of an
Arduino board inside your own circuitry, or put yourself on the path of
creating a final prototype or product based on the Arduino platform.
All the familiar pins such as analogue and digital I/O are marked on the
label affixed to the microcontroller, leaving you to move forward with
your own designs.</div>
<div style="text-align: justify;">
Furthermore for help or general discussion - check out our support forum at </div>
<br />
<a href="http://www.electronicsirfan.blogspot.com/">www.electronicsirfan.blogspot.com</a><br />
<br />
<a href="http://www.electronicsirfan.blogspot.com/" target="_blank">Electronics Lab</a> Created By Muhammad Irfan </div>
Anonymoushttp://www.blogger.com/profile/13526216155838659104noreply@blogger.com0tag:blogger.com,1999:blog-2190029239849113272.post-41683772395076221502014-03-30T00:32:00.001-07:002015-10-02T10:45:34.817-07:00Ultrasonic Distance Finder By Using 89c51<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: center;">
Ultrasonic Distance Finder By Using 89c51</h2>
<div style="text-align: left;">
Bismiallah Hirahman Niraheem </div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoojgTbsC9l0Up9YUQt8lDpQxc-uxSvaDjCcE8M1Dap3zOVxrKSpkrghSjSLhJxvkvm3XGcY8eXo1ujCiGwT5TtZPB9urgv9fV_N4JkwqwZ-OoW6xW2C3l0niW3wBltb1UslCXf_E9h0_9/s1600/vlcsnap-2014-03-30-12h19m17s156.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoojgTbsC9l0Up9YUQt8lDpQxc-uxSvaDjCcE8M1Dap3zOVxrKSpkrghSjSLhJxvkvm3XGcY8eXo1ujCiGwT5TtZPB9urgv9fV_N4JkwqwZ-OoW6xW2C3l0niW3wBltb1UslCXf_E9h0_9/s1600/vlcsnap-2014-03-30-12h19m17s156.png" width="640" /></a></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMk_fBqZ94Q2RWXLV-1mLXHPrb2uQzfPH0p4Nd9iFGyAMsAGdLWL7_LRq6dOy1zZOS-emGu31Ijg0pPAEd_k0KFWvL9EsPtaMtlRYLNsxTvKPQ7FmH5XEmSZyiXmulEcS_gNhNzyYRIBv8/s1600/button.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
<br />
As you see below there are two code one is main code and another is a external function code and this is for serial transmit ...when main code call this function then serial transmission is occur .<br />
<div style="text-align: left;">
Important thing is that i use cyrstal oscillator of 11.0592 Mhz for serial communication ...12Mhz oscillator not worked .</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMzO2W4Ml42ktcLaZm4lVT98ZEGsuDF0iq5kOhWedDpsXWnOfRz0H-KAagz-gveS7nGGD-hNwfCUKzhd40W88tRYaUEH96veBMrk1xNOwQx6Z9_pa-1ztAfZ1_syXlQcEkuZrZVNVtVuaY/s1600/butto2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
<div style="text-align: left;">
<br />
<a name='more'></a><br /></div>
<div style="text-align: left;">
<b>You can Also DOWNLOAD hex File from Link given in the end of this page </b></div>
<div style="text-align: left;">
</div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/6WABeXx9Dw4?feature=player_embedded' frameborder='0'></iframe></div>
<div style="text-align: left;">
</div>
<div style="text-align: left;">
<br /></div>
<h3 style="background-color: #ea9999; text-align: center;">
Main Code :</h3>
<h3 style="text-align: center;">
</h3>
<div style="background-color: #ea9999; text-align: justify;">
#include <AT89X51.h></div>
<div style="background-color: #ea9999; text-align: justify;">
#include <stdio.h></div>
<div style="background-color: #ea9999; text-align: justify;">
<br /></div>
<div style="background-color: #ea9999; text-align: justify;">
extern void <span style="background-color: magenta;">SerialTx</span>(signed int);</div>
<div style="background-color: #ea9999; text-align: justify;">
<br />
sbit Trigger=P1^0;</div>
<div style="background-color: #ea9999; text-align: justify;">
sbit Eco=P1^1;</div>
<div style="background-color: #ea9999; text-align: justify;">
sbit Led=P1^2;</div>
<div style="background-color: #ea9999; text-align: justify;">
<br />
void main (void)</div>
<div style="background-color: #ea9999; text-align: justify;">
{</div>
<div style="background-color: #ea9999; text-align: justify;">
int c;</div>
<div style="background-color: #ea9999; text-align: justify;">
unsigned int t;</div>
<div style="background-color: #ea9999; text-align: justify;">
float s;</div>
<div style="background-color: #ea9999; text-align: justify;">
float f;</div>
<div style="background-color: #ea9999; text-align: justify;">
<br />
SerialTx(-3); // External Function Call ( board rate 9600 )</div>
<div style="background-color: #ea9999; text-align: justify;">
TMOD=0x21; //use Timer 1 in mode 2 and Timer 0 in mode 1 , {timer 0 } start and stop from externally</div>
<div style="background-color: #ea9999; text-align: justify;">
TI=1;</div>
<div style="background-color: #ea9999; text-align: justify;">
<br />
Trigger=0; // Make trigger as output</div>
<div style="background-color: #ea9999; text-align: justify;">
Eco=1; // Make Eco as Input </div>
<div style="background-color: #ea9999; text-align: justify;">
</div>
<div style="background-color: #ea9999; text-align: justify;">
while(1)</div>
<div style="background-color: #ea9999; text-align: justify;">
{</div>
<div style="background-color: #ea9999; text-align: justify;">
</div>
<div style="background-color: #ea9999; text-align: justify;">
</div>
<div style="background-color: #ea9999; text-align: justify;">
TH0=0xD8; // initialized by 38ms for Eco check </div>
<div style="background-color: #ea9999; text-align: justify;">
TL0=0xF0;</div>
<div style="background-color: #ea9999; text-align: justify;">
<br />
Trigger=1;</div>
<div style="background-color: #ea9999; text-align: justify;">
for(c=0;c<1;c++); // From calculation this is Aprox 14 usec delay </div>
<div style="background-color: #ea9999; text-align: justify;">
Trigger=0;</div>
<div style="background-color: #ea9999; text-align: justify;">
</div>
<div style="background-color: #ea9999; text-align: justify;">
while(Eco==0){ ; } // Wait until eco = 0</div>
<div style="background-color: #ea9999; text-align: justify;">
TR0=1;</div>
<div style="background-color: #ea9999; text-align: justify;">
while(Eco==1) // Wait until eco = 1</div>
<div style="background-color: #ea9999; text-align: justify;">
{</div>
<div style="background-color: #ea9999; text-align: justify;">
if(TF0 == 1)</div>
<div style="background-color: #ea9999; text-align: justify;">
{</div>
<div style="background-color: #ea9999; text-align: justify;">
printf("Object is out of range...........\n "); </div>
<div style="background-color: #ea9999; text-align: justify;">
TF0 = 0;</div>
<div style="background-color: #ea9999; text-align: justify;">
break;</div>
<div style="background-color: #ea9999; text-align: justify;">
}</div>
<div style="background-color: #ea9999; text-align: justify;">
} </div>
<div style="background-color: #ea9999; text-align: justify;">
TR0 = 0;</div>
<div style="background-color: #ea9999; text-align: justify;">
t = TH0;</div>
<div style="background-color: #ea9999; text-align: justify;">
t = t<<8;</div>
<div style="background-color: #ea9999; text-align: justify;">
t = t+TL0;</div>
<div style="background-color: #ea9999; text-align: justify;">
t = t - 0xD8F0;</div>
<div style="background-color: #ea9999; text-align: justify;">
Led=~Led;</div>
<div style="background-color: #ea9999; text-align: justify;">
s=.0165F*t; //formula for coverting into centimeter</div>
<div style="background-color: #ea9999; text-align: justify;">
f=s*.0300F; //formula for converting into foots</div>
<div style="background-color: #ea9999; text-align: justify;">
<br />
</div>
<div style="background-color: #ea9999; text-align: justify;">
<br />
</div>
<div style="background-color: #ea9999; text-align: justify;">
<br />
printf("Timer Exact Value = %u \n\n\n" ,t); // Exact value </div>
<div style="background-color: #ea9999; text-align: justify;">
printf("Counted Distance Value = %f cm \n\n\n " ,s);</div>
<div style="background-color: #ea9999; text-align: justify;">
printf("Counted Distance Value = %f Foot \n\n\n " ,f); // Calculated Distance </div>
<div style="background-color: #ea9999; text-align: justify;">
</div>
<div style="background-color: #ea9999; text-align: justify;">
</div>
<div style="background-color: #ea9999; text-align: justify;">
</div>
<div style="background-color: #ea9999; text-align: justify;">
}</div>
<div style="background-color: #ea9999; text-align: justify;">
</div>
<div style="background-color: #ea9999; text-align: justify;">
}</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<h3 style="text-align: center;">
External Function Serial Transmit <span style="background-color: magenta;"> SerialTx</span> : </h3>
<h3 style="text-align: center;">
</h3>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: left;">
<b style="background-color: magenta;">#include <reg51.h><br />#include <stdio.h><br />void SerialTx(signed int );<br />void SerialTx(signed int a)<br />{<br /><br />TH1=a; //9600 baud rate FD = -3 <br />SCON=0x50;<br />TR1=1; <br />} </b></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<b>Download Hex File Click Here <a href="http://www.mediafire.com/view/7tj9ei5qaq9ivdv/Ultrasonic_Range_Finder_.Hex" target="_blank"><br /></a></b></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.mediafire.com/view/7tj9ei5qaq9ivdv/Ultrasonic_Range_Finder_.Hex" target="_blank"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihjjSzN8E7ycuNS9e1cJj3PEACGUZCpUrAca91tueL03k6URJxaBVvkKMOh2fiC4I0YE2FKbAAw0KxozH147r3RDddhpyTlvInlpaLHLFF7KhIZSMucCyp_S5gRxL9nZiUctG2FgRNWu0J/s1600/butto2.png" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
Electronics Lab Created By Muhammad Irfan</div>
<h3 style="text-align: center;">
<br /><br /><br /><br /></h3>
</div>
Anonymoushttp://www.blogger.com/profile/13526216155838659104noreply@blogger.com0tag:blogger.com,1999:blog-2190029239849113272.post-74564438817598277952014-03-25T05:01:00.002-07:002014-03-25T05:10:09.135-07:00How To Read The Timer Value Of 89c51 When Program Running<div dir="ltr" style="text-align: left;" trbidi="on">
<h3 style="text-align: center;">
How To Read The Timer Value Of 89c51 When Program Running</h3>
<div style="text-align: left;">
Ok this very difficult to find the Timer values of Microcontroller when a program is running but no problem im here ......</div>
<div style="text-align: left;">
first of all i use Timer 1 in mode 2 for serial data transmission ( Means Read the timer value to serial port )</div>
<div style="text-align: left;">
Now i use the Timer 0 in mode 1 and Start the initial value from 00H .In my given code the Port 1 is reserved for starting and stopping the Timer 0 .As in given code </div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="background-color: #ead1dc; color: blue; text-align: left;">
#include <reg51.h><br />
#include <stdio.h><br />
extern void MSDelay(unsigned int);<br />
extern void SerialTx(signed int);<br />
<br />
void main (void)<br />
{<br />
int x;<br />
SerialTx(-3);<br />
TMOD=0xA1; //use Timer 1 in mode 2 and Timer 0 in mode 1 both are start and stop from externally<br />
TH0=0x00;<br />
TL0=0x00;<br />
<br />
while(1)<br />
<br />
{<br />
if( P1==0)<br />
{<br />
TR0=1;<br />
TI=1;<br />
<br />
x=TH0;<br />
x=x<<8;<br />
x=x+TL0;<br />
<br />
printf("The Timer 0 is ON. And The Value Is : ");<br />
printf("%x, \n",x);<br />
MSDelay(60);<br />
}<br />
<br />
else <br />
{<br />
<br />
TI=1;<br />
printf("The Timer 0 is OFF. \n");<br />
MSDelay(60); <br />
}<br />
<br />
}<br />
<br />
} </div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<span style="background-color: yellow;"></span><br /></div>
<div style="text-align: left;">
As you see the blue colored code is my main code but in the main code there are two external Functions </div>
<div style="text-align: left;">
<span style="background-color: orange;">extern void MSDelay(unsigned int);</span><br />
<span style="background-color: orange;">
extern void SerialTx(signed int); </span></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
the First Function is Delay Function And This is given below</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<span style="background-color: #6aa84f;">#include <reg51.h></span><br />
<span style="background-color: #6aa84f;">#include <stdio.h></span><br />
<span style="background-color: #6aa84f;">void MsDelay( unsigned int);</span><br />
<span style="background-color: #6aa84f;">void MsDelay( unsigned int itime)</span><br />
<span style="background-color: #6aa84f;">{</span><br />
<span style="background-color: #6aa84f;">unsigned int i , j ;</span><br />
<span style="background-color: #6aa84f;">for (i=0;i<itime;i++)</span><br />
<span style="background-color: #6aa84f;">{</span><br />
<span style="background-color: #6aa84f;">for (j=0;j<1275;j++);</span><br />
<span style="background-color: #6aa84f;">}</span><br />
<span style="background-color: #6aa84f;">}</span></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
And another Function is Serial Data Transmit Function which is also given Below</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<span style="background-color: #c27ba0;">#include <reg51.h></span><br />
<span style="background-color: #c27ba0;">#include <stdio.h></span><br />
<span style="background-color: #c27ba0;">void SerialTx(signed int );</span><br />
<span style="background-color: #c27ba0;">void SerialTx(signed int a)</span><br />
<span style="background-color: #c27ba0;">{</span><br />
<span style="background-color: #c27ba0;">TMOD=0xA0;</span><br />
<span style="background-color: #c27ba0;">TH1=a; //9600 baud rate FD = -3 </span><br />
<span style="background-color: #c27ba0;">SCON=0x50;</span><br />
<span style="background-color: #c27ba0;">TR1=1; </span><br />
<span style="background-color: #c27ba0;">}</span></div>
<div style="text-align: left;">
</div>
<div style="text-align: left;">
</div>
<div style="text-align: left;">
</div>
<div style="text-align: left;">
</div>
<div style="text-align: left;">
</div>
<div style="text-align: left;">
</div>
<div style="text-align: left;">
</div>
<div style="text-align: left;">
</div>
<div style="text-align: left;">
<br style="background-color: #c27ba0;" />
Now Proteuos Work </div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
When The Project is stopped</div>
<div style="text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWi_2JXZeI9c8TAwEH9NdyFXyKVxcMiejGV5uetfYan7rkD4DOLR5bXiGy_O97pyszP4hjsyANOgzrwmCiAgTgc5eZTdfoKJj1vGVd0e9PsjoSYbNch2liVeSTaB1_d5IBuhZAPDbs_8Rq/s1600/whenstoped.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWi_2JXZeI9c8TAwEH9NdyFXyKVxcMiejGV5uetfYan7rkD4DOLR5bXiGy_O97pyszP4hjsyANOgzrwmCiAgTgc5eZTdfoKJj1vGVd0e9PsjoSYbNch2liVeSTaB1_d5IBuhZAPDbs_8Rq/s1600/whenstoped.png" height="400" width="640" /></a></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
When Project is On But Button is Off no data received from Timer 0 </div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgf8ubxyaUAcWEDgr5ua0WeXB63879ioGLjY2wot_A2_czR-U8F4tGvYZmR60jiX2NZg3jQ6xkUgHNkDbpCpKJv3h8nPkwfWydaalGLuYDNbVO7Xtq3uz63aE7J2Wfosul9pDUTTpLxLvcV/s1600/sada.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaNsgFZc6jpevNtClXugXaYpadFW1pY7t7T6uIKweBDlcCc1kRhrX6bRkwLwUkMHZxBF8nVvfO69qYSJg1miEqUxcgh6s4OLsA4MZmcuWMJ0y0JmPobRSV62eXdHWanxEO1pztza81x2Ih/s1600/whenon.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaNsgFZc6jpevNtClXugXaYpadFW1pY7t7T6uIKweBDlcCc1kRhrX6bRkwLwUkMHZxBF8nVvfO69qYSJg1miEqUxcgh6s4OLsA4MZmcuWMJ0y0JmPobRSV62eXdHWanxEO1pztza81x2Ih/s1600/whenon.png" height="400" width="640" /></a></div>
<br />
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
When Button is On and data received from Timer 0 ........</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgf8ubxyaUAcWEDgr5ua0WeXB63879ioGLjY2wot_A2_czR-U8F4tGvYZmR60jiX2NZg3jQ6xkUgHNkDbpCpKJv3h8nPkwfWydaalGLuYDNbVO7Xtq3uz63aE7J2Wfosul9pDUTTpLxLvcV/s1600/sada.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgf8ubxyaUAcWEDgr5ua0WeXB63879ioGLjY2wot_A2_czR-U8F4tGvYZmR60jiX2NZg3jQ6xkUgHNkDbpCpKJv3h8nPkwfWydaalGLuYDNbVO7Xtq3uz63aE7J2Wfosul9pDUTTpLxLvcV/s1600/sada.png" height="400" width="640" /></a></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
Thanks for watching you know my english is week but i think you understand my code ....but if any problem so Inform me </div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<a href="http://www.electronicsirfan.blogspot.com/" target="_blank"><br /></a></div>
<div style="text-align: left;">
<a href="http://www.electronicsirfan.blogspot.com/" target="_blank"> Electronics Lab Created By Muhammad Irfan</a></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
</div>
<div style="text-align: left;">
</div>
</div>
Anonymoushttp://www.blogger.com/profile/13526216155838659104noreply@blogger.com1tag:blogger.com,1999:blog-2190029239849113272.post-73416791887679117252014-03-18T03:55:00.000-07:002014-03-18T03:55:25.966-07:00GETTING STARTED WITH 8051/AT89C51 USING KEIL uVISION 4 AND PROTEUS<div dir="ltr" style="text-align: left;" trbidi="on">
<h4 style="text-align: justify;">
<span style="background-color: #d9ead3;"><b>In this step-by-step tutorial you will find:</b></span></h4>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxjORQSmM1l4vKkjZFxgY5sWvEfMxbUImBQoHG4rCISrpXbxD-hvT_RIVPlzJ0gApSXMmhGeVi1SnzpDBgZW1iE5QA9ApelWAFl7jRZSU7KNYcqfpOwIkDGTbi6THYYdPut-L3rTClaV4/s1600/DSCN0884A+SM.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxjORQSmM1l4vKkjZFxgY5sWvEfMxbUImBQoHG4rCISrpXbxD-hvT_RIVPlzJ0gApSXMmhGeVi1SnzpDBgZW1iE5QA9ApelWAFl7jRZSU7KNYcqfpOwIkDGTbi6THYYdPut-L3rTClaV4/s320/DSCN0884A+SM.jpg" width="320" /></a></div>
<div style="text-align: justify;">
<br />
-<b>-Basic connection diagram of 8051 micro-controller</b><br /><br /><b>--</b><b>Stuff about how to write your very basic program for 8051
micro-controller using Keil uVision software and making final .HEX file
with it </b><br /><br />
--<b>Using Proteus simulation software to simulate 4-bit counter circuit behavior and program</b><br /><br />
-- <b>A example video showing 4-Bit counter program</b><br /><br /></div>
<div style="text-align: justify;">
</div>
<h2 style="text-align: justify;">
<span style="background-color: yellow; text-align: left;"><span style="color: blue; font-size: medium;"><b><u>Basic connection diagram of 8051 micro-controller</u></b></span></span></h2>
<div style="text-align: justify;">
Notes:<br />
-Do not forget to connect EA pin to 5V as this pin can not be left unconnected.<br />
-30pF capacitor are most suitable but their unavailability has moved me use 20pF capacitors.<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgv3eb1S7mpAWcI85TluTXfI09BiW0WAcmx4iVfxfmF3yAP4IYvBiNZBGHos8OChwguw2Hq9g3DqTqafDIc_0VpAhZ4DcraJUGqBcEYpLuHdkGFEZ4Np9z_jyahQpSfc7neoSZPHizLg7U/s1600/DSCN0884A+SM1.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgv3eb1S7mpAWcI85TluTXfI09BiW0WAcmx4iVfxfmF3yAP4IYvBiNZBGHos8OChwguw2Hq9g3DqTqafDIc_0VpAhZ4DcraJUGqBcEYpLuHdkGFEZ4Np9z_jyahQpSfc7neoSZPHizLg7U/s640/DSCN0884A+SM1.jpg" width="640" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRzmta-uOalcNd_jBnnBN0O-vHYqJSDLCOAaY67rOtPZLvcFbsgGmQZduBkayveuGMOnpiNANijwLzePm1yrRt9X-dZhanTEE0YUoeWjQVBiNZ-rD-v_zwJi7CL5weQef13UguHx9fx6I/s1600/BASIC1.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRzmta-uOalcNd_jBnnBN0O-vHYqJSDLCOAaY67rOtPZLvcFbsgGmQZduBkayveuGMOnpiNANijwLzePm1yrRt9X-dZhanTEE0YUoeWjQVBiNZ-rD-v_zwJi7CL5weQef13UguHx9fx6I/s320/BASIC1.jpg" width="301" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<h2 style="text-align: justify;">
<span style="background-color: yellow;"><span style="color: blue;">USING KEIL uVISION 4.0 TO WRITE CODE</span></span></h2>
<div style="text-align: justify;">
<span style="background-color: yellow;"><span style="color: blue;"><br /></span></span></div>
<div style="text-align: justify;">
<span style="background-color: white;">1)As you will open Keil software , you will see following screen:</span></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQB9RlORE8JXsfyeMH8ZN8aze4cK24aExJ5ob59r3EEPjzx3nVct4Otwzt3sAcjBQUdB3Dw-AcfL4dsbe7h-1Y9Jx1BoJacara-Ps_hKZVjhtBb3PiDErE-mdGYIS7JRM860Vft-NC_M0/s1600/1+%281%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="361" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQB9RlORE8JXsfyeMH8ZN8aze4cK24aExJ5ob59r3EEPjzx3nVct4Otwzt3sAcjBQUdB3Dw-AcfL4dsbe7h-1Y9Jx1BoJacara-Ps_hKZVjhtBb3PiDErE-mdGYIS7JRM860Vft-NC_M0/s640/1+%281%29.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
2)Create new project as shown below:</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdHpmLsyHwVCx3MLAEIBhWgFvJ8TxDAOxOWcxms8QMGcijJPz2MgEzPLrvSYf82lwT5bCvKI9G1iWz8yNfuuch-vHUjIIjOH5sAz_EQJfBKI5sPwQqCZ40qRoUeRDlB17-XijfAvqmO_I/s1600/1+%282%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="361" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdHpmLsyHwVCx3MLAEIBhWgFvJ8TxDAOxOWcxms8QMGcijJPz2MgEzPLrvSYf82lwT5bCvKI9G1iWz8yNfuuch-vHUjIIjOH5sAz_EQJfBKI5sPwQqCZ40qRoUeRDlB17-XijfAvqmO_I/s640/1+%282%29.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
3)Name it. Make sure that you already have made the separate folder to
minimize confusion of new project files with old ones. New folder will
keep all files related to only to one project hence making it easy to
locate files you need afterwards.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-LGMV3KLJCSmAfrXFIrPzsMUvzHNq6WwlvucqASjLyl2JZvJCPMKVpd7ixqM35frlCO4OaE8qUKda29GiBN0PszuqLJns8RFs_7_yma2J8xpaPPS197DeED6BJxrob0BmM2EckHM-OjM/s1600/1+%283%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="361" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-LGMV3KLJCSmAfrXFIrPzsMUvzHNq6WwlvucqASjLyl2JZvJCPMKVpd7ixqM35frlCO4OaE8qUKda29GiBN0PszuqLJns8RFs_7_yma2J8xpaPPS197DeED6BJxrob0BmM2EckHM-OjM/s640/1+%283%29.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
4)Select chip manufacturer, in our case Atmel then select chip model i-e AT89c51</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzGll2V_5x2DI2cRtvuB3isX56En1vF_tSsQhlSq5KvnMb15HR8IJy_fbQdSTcuO783uvuFfQI1Hs8-gGoMghQqs957x1sk96Fi4B4oTZXVc9hK2V74hmvdLQJd7VvsCRus0WI5ynMHUM/s1600/1+%284%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="361" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzGll2V_5x2DI2cRtvuB3isX56En1vF_tSsQhlSq5KvnMb15HR8IJy_fbQdSTcuO783uvuFfQI1Hs8-gGoMghQqs957x1sk96Fi4B4oTZXVc9hK2V74hmvdLQJd7VvsCRus0WI5ynMHUM/s640/1+%284%29.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigOGj79n3QUXNNC13EsOplrAbO1cuz4BiQWPVlYGt7ct1riiZFO-ebKNNH8NRuGYtZVdpFxv-5AP9Aeo3PfKCslssP-8pdY_zVr00o0zBt6tWB9DZ2OohWP-DW5J1MrzDiPGFfl-HS5JY/s1600/1+%285%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="361" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigOGj79n3QUXNNC13EsOplrAbO1cuz4BiQWPVlYGt7ct1riiZFO-ebKNNH8NRuGYtZVdpFxv-5AP9Aeo3PfKCslssP-8pdY_zVr00o0zBt6tWB9DZ2OohWP-DW5J1MrzDiPGFfl-HS5JY/s640/1+%285%29.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
5) Software will ask you whether to include 8051 start up code, select NO.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiejQ8RMABLh6OLshwF-nVFZ0RG-5_q_amDg8QBnLr0Km97Je2jJyk3NRwBUOt_SEt9u8mAaxfzRl36D3FJbfuXovB0zUvMUcl6snDolpgBrBkc-wq8tmOEx9g_z0moSrdn1GoQA_NvK74/s1600/1+%286%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="361" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiejQ8RMABLh6OLshwF-nVFZ0RG-5_q_amDg8QBnLr0Km97Je2jJyk3NRwBUOt_SEt9u8mAaxfzRl36D3FJbfuXovB0zUvMUcl6snDolpgBrBkc-wq8tmOEx9g_z0moSrdn1GoQA_NvK74/s640/1+%286%29.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
6)This is how you working environment should look like till now:</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_2hKtJhexInbAJnfRz4IXJYw4-rCI6c45C54SfBoK0O-W_TC91rXuhidBrj0DdB8YQNBgK6GI462mzp3E9gJ0_MR_I3ONdl10gYUEEgxjqssRuhgk0RV25TvFXYO1U9q7PfcUWorEMY0/s1600/1+%287%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="361" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_2hKtJhexInbAJnfRz4IXJYw4-rCI6c45C54SfBoK0O-W_TC91rXuhidBrj0DdB8YQNBgK6GI462mzp3E9gJ0_MR_I3ONdl10gYUEEgxjqssRuhgk0RV25TvFXYO1U9q7PfcUWorEMY0/s640/1+%287%29.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
6) As new project folders are created, now it is time to create a text
file which will include your assembly code. Goto file drop down menu and
select "New" or simply click blank paper icon in file toolbar.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLtY6SiKzvH1hAxxJCbmKx1aFHWM-Cr9HNzUKy9wrXfTPvjgZ9P2TANFb7dAXBQSN0sg5euwFYlOV1_JDnB3rp8yNLsMlz_CCvmPbzZXbUWfiI0yg_OK7GkUVPhA3WE6i3uX69P2cQ2hI/s1600/1+%288%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="361" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLtY6SiKzvH1hAxxJCbmKx1aFHWM-Cr9HNzUKy9wrXfTPvjgZ9P2TANFb7dAXBQSN0sg5euwFYlOV1_JDnB3rp8yNLsMlz_CCvmPbzZXbUWfiI0yg_OK7GkUVPhA3WE6i3uX69P2cQ2hI/s640/1+%288%29.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigOZsuYlJBbxUmRGmlSELrUfIAcizf_kLJXA5u4G8HC5ebGK_c6bTraUn7ya1GK8bhpAqc3w-ethCytKwUmXdH39a6gCZCAsPHjrwszAsElGn3XajFVrj-9YvFqm-JczDipXvDJnITfMM/s1600/1+%289%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="361" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigOZsuYlJBbxUmRGmlSELrUfIAcizf_kLJXA5u4G8HC5ebGK_c6bTraUn7ya1GK8bhpAqc3w-ethCytKwUmXdH39a6gCZCAsPHjrwszAsElGn3XajFVrj-9YvFqm-JczDipXvDJnITfMM/s640/1+%289%29.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
7) Write your code in the new white work space that just has been created.</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuhVb2aWLERnoZjbPMC6mqgmsL-RtU_kxECzcPVZCymhJW_GyTfJ8Vo4e47_WJadGZ4QfqvSsGzlzF_EeJ0JoZPSCWBWGXWbxy-EMDNpMcJQG_ptCDsSJlKVH4USk76F24NgmD6wAlQfY/s1600/1+%2810%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="361" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuhVb2aWLERnoZjbPMC6mqgmsL-RtU_kxECzcPVZCymhJW_GyTfJ8Vo4e47_WJadGZ4QfqvSsGzlzF_EeJ0JoZPSCWBWGXWbxy-EMDNpMcJQG_ptCDsSJlKVH4USk76F24NgmD6wAlQfY/s640/1+%2810%29.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4IL1e8UoMJ5xbPyPohW9p69i5Ia-jt506MPSJWb3zBTRN42NB43mwYR7FT9_sbs6MsSVRZ4QxC0eGlUF8qmEZa-qsZXQDgtA6GvmOpDclDr9aENPsXfXP4wz0xahMf-ynDx-UqiauTvk/s1600/1+%2811%29.png" style="margin-left: 1em; margin-right: 1em; text-align: left;"><img border="0" height="358" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4IL1e8UoMJ5xbPyPohW9p69i5Ia-jt506MPSJWb3zBTRN42NB43mwYR7FT9_sbs6MsSVRZ4QxC0eGlUF8qmEZa-qsZXQDgtA6GvmOpDclDr9aENPsXfXP4wz0xahMf-ynDx-UqiauTvk/s640/1+%2811%29.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
8) Its time to save your assembly code file now. Go to file drop down
menu and select save. Save the file into your main project folder.</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
<span style="background-color: black;"><span style="color: yellow;">NOTE: SAVE FILE WITH .ASM EXTENSION AS OUR CODE IS IN ASSEMBLY LANGUAGE.</span></span></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
As you will save the file, the software will detect the .asm language
keywords and they become colorful to make them prominent from rest of
code. </div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeJ0LOY1-RE6NHiRI_3jkKGaG2_FYZAmy_-5qSxqVKKwpYHtFCt5J59PWzTa1zZU7GV5-FB7A9HIdDoaJsPMzZ5CgbeG_MVXZb94FkDJHCFNO0qMbDCd6djnqvbey6J0mrO8hRF9AAfTk/s1600/1+%2812%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="361" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeJ0LOY1-RE6NHiRI_3jkKGaG2_FYZAmy_-5qSxqVKKwpYHtFCt5J59PWzTa1zZU7GV5-FB7A9HIdDoaJsPMzZ5CgbeG_MVXZb94FkDJHCFNO0qMbDCd6djnqvbey6J0mrO8hRF9AAfTk/s640/1+%2812%29.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
9) Now you have to add .asm code file to your project. Right click on
the source group folder(sub-folder of main target1 folder) and select
"Add files to group (source group)"</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPRBmTmIpZXlvrYUm0xJrn0MdGkNiMqjObkfDSOjGrIyqij2lwQ6mJQxl5yEN2ITKUdJzpgOLfKDaT2aB5V9tnKTaXi0qQjC3eNBcWHzraM2R1BHhBYyR-eBKsYHuN1LC7L2FdHq7EZNU/s1600/1+%2813%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="361" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPRBmTmIpZXlvrYUm0xJrn0MdGkNiMqjObkfDSOjGrIyqij2lwQ6mJQxl5yEN2ITKUdJzpgOLfKDaT2aB5V9tnKTaXi0qQjC3eNBcWHzraM2R1BHhBYyR-eBKsYHuN1LC7L2FdHq7EZNU/s640/1+%2813%29.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
10) A small window will appear asking you for location of your .asm code
file. Give it the path of wherever you have saved your file, it should
be in your project folder. Select the file click "Add".</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsqf78msclypHO0YvlK7h02l0PMQ_je8gP8G8N71bWVfmI8IRVPiPHKwMxH82jhXkRE9vkHzdsdVCf6ZuYPjorw9DClvh91ZIrIKB3ydey5QOpW4G6gsigHlzeh-DEJ4dQm35S7aHrpY4/s1600/1+%2814%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="361" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsqf78msclypHO0YvlK7h02l0PMQ_je8gP8G8N71bWVfmI8IRVPiPHKwMxH82jhXkRE9vkHzdsdVCf6ZuYPjorw9DClvh91ZIrIKB3ydey5QOpW4G6gsigHlzeh-DEJ4dQm35S7aHrpY4/s640/1+%2814%29.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRWgl43muOnNPc4PiIKpZMZtKuGZm78M9EKwW4M6Vk4qrRDmRDUpxgGXi-wnkI7nvHR21g9xCqqQbOWQycxKCuLkmznkDSwlAyCHv51btNvtihZmg9fXNYRWEtSmeWKeFE0EuNjdi4IHU/s1600/1+%2815%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="361" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRWgl43muOnNPc4PiIKpZMZtKuGZm78M9EKwW4M6Vk4qrRDmRDUpxgGXi-wnkI7nvHR21g9xCqqQbOWQycxKCuLkmznkDSwlAyCHv51btNvtihZmg9fXNYRWEtSmeWKeFE0EuNjdi4IHU/s640/1+%2815%29.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
11) You may check the .asm file by clicking on the little plus sign at the left of source group.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2DeAXh2zUdJF4cqwa-cfuCVQkKltrMbjeaWxSTTVeu8WCg5NQV4pBNlk0MxRqXDfYSZkvzfoxhg_BUAR5qx4P0Ikwuk2pGXeT0lx4zqHMZOkxjR08mfPiQqI8GQul5zsw7EZL__NXNYk/s1600/1+%2816%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="361" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2DeAXh2zUdJF4cqwa-cfuCVQkKltrMbjeaWxSTTVeu8WCg5NQV4pBNlk0MxRqXDfYSZkvzfoxhg_BUAR5qx4P0Ikwuk2pGXeT0lx4zqHMZOkxjR08mfPiQqI8GQul5zsw7EZL__NXNYk/s640/1+%2816%29.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
12)There are some configuration changes that you have to make before you build the final .HEX file. </div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLm2veJRqFoQcTchLQbUkd23fwxMo1YmP7LwM9ZbocFMXk9cApI0-lmzqLb1fyh1Y4FD_qpUCwe4k5-xaDQ70irWkHg3H1oIAONxa1tABhfhOIh_kbPpFM6DR8pbeAGrhVa35QtmdZLaE/s1600/1+%2817%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="361" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLm2veJRqFoQcTchLQbUkd23fwxMo1YmP7LwM9ZbocFMXk9cApI0-lmzqLb1fyh1Y4FD_qpUCwe4k5-xaDQ70irWkHg3H1oIAONxa1tABhfhOIh_kbPpFM6DR8pbeAGrhVa35QtmdZLaE/s640/1+%2817%29.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
-In target tab set the frequency that you are using with 8051, in our case 10.0MHz. So change default value 24.0MHz to 10.0Mhz</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcPE1Zr23ttxUYze4IUboPeVLyvgt88ge1Ia63UC_0l-FGyTYgxCBCIgyh_BArlOJgiJ2A4hIA-IReZsl1-GZBPHpfWxURoqDTwvWymq0C19fmjcX65ULiKgc7QRR1ON4x_3kP0krfKLA/s1600/1+%2818%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="361" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcPE1Zr23ttxUYze4IUboPeVLyvgt88ge1Ia63UC_0l-FGyTYgxCBCIgyh_BArlOJgiJ2A4hIA-IReZsl1-GZBPHpfWxURoqDTwvWymq0C19fmjcX65ULiKgc7QRR1ON4x_3kP0krfKLA/s640/1+%2818%29.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
-In output tab check the "Create HEX file" box otherwise HEX file will not be created.</div>
<div class="separator" style="clear: both; text-align: justify;">
After all these settings click OK.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBJGTT8Nv0AlmKucChckKR8u6zFOltOOII-SlON8hGuJBhiWKgdyuBRGZqOJbuZ6mrWK9QpTjv65C7YET-RqmE8Nn-A09_FSsMltuLlhB3_BmaX7vahV-H3BubWKvB1hYrBL9YMTC5tN0/s1600/1+%2819%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="361" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBJGTT8Nv0AlmKucChckKR8u6zFOltOOII-SlON8hGuJBhiWKgdyuBRGZqOJbuZ6mrWK9QpTjv65C7YET-RqmE8Nn-A09_FSsMltuLlhB3_BmaX7vahV-H3BubWKvB1hYrBL9YMTC5tN0/s640/1+%2819%29.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
13) Its now time to get final output that HEX file.</div>
<div class="separator" style="clear: both; text-align: justify;">
Right click on .asm file which is in source group folder and select "<b>Build target</b>" .</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjACU3uTSBvklSp32ZdwYRz2GMenim1KWRHDpkTj9Sz2HCJxQQxP69WgWrgd0XwnINPlVGTNAB-yCIUZB8ooVuNvsbq3SBxT18yuCGPOlxtFdwP5LWGAc-IWzgzXRi0sLYf8VMKrzRhPZY/s1600/1+%2820%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="361" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjACU3uTSBvklSp32ZdwYRz2GMenim1KWRHDpkTj9Sz2HCJxQQxP69WgWrgd0XwnINPlVGTNAB-yCIUZB8ooVuNvsbq3SBxT18yuCGPOlxtFdwP5LWGAc-IWzgzXRi0sLYf8VMKrzRhPZY/s640/1+%2820%29.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
14)If there are no errors in code your code will be compiled in couple of seconds showing progress in window at the bottom.</div>
<div class="separator" style="clear: both; text-align: justify;">
If there are errors in code then they will also be mentioned in same
bottom window with number of line that contains error. You may recheck
that line rectifying the mistake(s).</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSx4uiT_IkGBd5QuErKAtbqdKGNRkPb7i5FeqXj159_INeosZr3aUyY9fs1cB0aF5dOOkMXguWmxlxf478W2O2nLWeUYnLwHUBzQGtT-WQmNmnvpzyveE6npx1xXD67qjVgYuPYCxQjLA/s1600/1+%2821%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="345" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSx4uiT_IkGBd5QuErKAtbqdKGNRkPb7i5FeqXj159_INeosZr3aUyY9fs1cB0aF5dOOkMXguWmxlxf478W2O2nLWeUYnLwHUBzQGtT-WQmNmnvpzyveE6npx1xXD67qjVgYuPYCxQjLA/s640/1+%2821%29.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
15) After successful compilation of code you can find final HEX file in
same project folder that contains main project file/asm file/other
files.</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTrFhJh7bVh6X_wEFPy4BDlYsHZL2Cfi-6mHJ3TuY83v7szJTErKgObEyWVJ-V3y4DOalIkN0fp9KwlEEuEjx0_vQ4ycI993N6WEKKXoDLJEd0pRpdbZqIYBOF3IxFAP__0Z8uUimoAYc/s1600/1+%2822%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="361" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTrFhJh7bVh6X_wEFPy4BDlYsHZL2Cfi-6mHJ3TuY83v7szJTErKgObEyWVJ-V3y4DOalIkN0fp9KwlEEuEjx0_vQ4ycI993N6WEKKXoDLJEd0pRpdbZqIYBOF3IxFAP__0Z8uUimoAYc/s640/1+%2822%29.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<h2 style="text-align: justify;">
<span style="background-color: yellow; color: blue;">USING PROTEUS TO SIMULATE 4-BIT COUNTER CIRCUIT</span></h2>
<div style="text-align: justify;">
<span style="color: blue;">Important: As Proteus does not bound us to
connect power supply, XTAL,reset circuit,EA pin and other basic
connections so we are ignoring them for sake of simplicity. The
important things like Xtal frequency of micro controller can be set from
properties of micro controller, as discussed below.</span></div>
<div style="text-align: justify;">
<span style="background-color: yellow; color: blue;"><br /></span></div>
<div style="text-align: justify;">
<span style="background-color: white; color: blue;">While in actual hardware form for you must follow basic circuit shown at very beginning of this post.</span></div>
<div style="text-align: justify;">
<span style="background-color: yellow; color: blue;"><br /></span></div>
<div style="text-align: justify;">
<span style="background-color: yellow; color: blue;"><br /></span></div>
<div style="text-align: justify;">
<span style="background-color: yellow; color: blue;"><br /></span>
<span style="background-color: white;">1) Open Proteus</span></div>
<div style="text-align: justify;">
<span style="background-color: yellow; color: blue;"><br /></span></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDngzBZUXzv5glWd4a2-FYLS9KGMxYtyzTSlZMkTXH8ppRVLKfqu1s2gdpg4_NOyMNTIZ52Kj2hgv4Vprvut7MB1uwuWfSEZmGjK12pywnB_wL5CeGVtLYvaOUdLBMNQOxz5eGBR2xpno/s1600/1+%281%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="364" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDngzBZUXzv5glWd4a2-FYLS9KGMxYtyzTSlZMkTXH8ppRVLKfqu1s2gdpg4_NOyMNTIZ52Kj2hgv4Vprvut7MB1uwuWfSEZmGjK12pywnB_wL5CeGVtLYvaOUdLBMNQOxz5eGBR2xpno/s640/1+%281%29.png" width="640" /></a></div>
<div style="text-align: justify;">
<br /><br />
2) Click on "<b>P</b>"<b> </b>to open up part list.<br />
Locate AT89C51 IC as shown below:<br /><br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOerfu1vFK4KWMSMcNcXKpB9z357NJlo_pMtfG_DepDmYuuniKkoARBEB1tkYnTqv1z9f5dzHZPL-aibvbaRSETTIIErEmP0Q0R65DPlzrDEJ2IHxzjlri-_UB679fAkpi0jTSIZRODIE/s1600/1+%282%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="364" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOerfu1vFK4KWMSMcNcXKpB9z357NJlo_pMtfG_DepDmYuuniKkoARBEB1tkYnTqv1z9f5dzHZPL-aibvbaRSETTIIErEmP0Q0R65DPlzrDEJ2IHxzjlri-_UB679fAkpi0jTSIZRODIE/s640/1+%282%29.png" width="640" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAjNs5aAKF8WkRuwQGR4nEAVHTYoSsV0HAYIBe5agxzfxyGfX_t_lr6ETGt7Fm836aX366DgrHH6QUNtPBEIhEcbkhZe0Evy0Qk3eTlFKCTIORbL0u4LRf4ikvgIGWIQPiTyBt_Qg4AE0/s1600/1+%283%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="364" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAjNs5aAKF8WkRuwQGR4nEAVHTYoSsV0HAYIBe5agxzfxyGfX_t_lr6ETGt7Fm836aX366DgrHH6QUNtPBEIhEcbkhZe0Evy0Qk3eTlFKCTIORbL0u4LRf4ikvgIGWIQPiTyBt_Qg4AE0/s640/1+%283%29.png" width="640" /></a></div>
<div style="text-align: justify;">
<br /><br />
3) Locate LEDs as shown below<br /><br /><br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMLSXO1WgBEXywoEqgb-FFjsHzOAZrWuMMktaWCEIyRAMRkwikONdsLV_Nd4-_fL1kHNhyphenhyphen3rrsfrFepbjZkkUsjTvbC0bmIIi1JU-CINRFeIByUt-RZJ8yom8r8AbNzGzXxwQwCWaAUCA/s1600/1+%284%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="364" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMLSXO1WgBEXywoEqgb-FFjsHzOAZrWuMMktaWCEIyRAMRkwikONdsLV_Nd4-_fL1kHNhyphenhyphen3rrsfrFepbjZkkUsjTvbC0bmIIi1JU-CINRFeIByUt-RZJ8yom8r8AbNzGzXxwQwCWaAUCA/s640/1+%284%29.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
4) Make connections from 8051 to LEDs</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFS9CTvK4dw5SV_xftQWDcJSpvtI2RcN6rRMKOxsi7SLKWeSe6pbGNZi3QU3I_CKDc3Ubkn4sIsu2A3KtJRcJqXPkyx6Ifp-moJ-UsSVCSrNynnP5cbUUeJnZNcmxSNvV3RmAabjsNgLQ/s1600/1+%285%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="364" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFS9CTvK4dw5SV_xftQWDcJSpvtI2RcN6rRMKOxsi7SLKWeSe6pbGNZi3QU3I_CKDc3Ubkn4sIsu2A3KtJRcJqXPkyx6Ifp-moJ-UsSVCSrNynnP5cbUUeJnZNcmxSNvV3RmAabjsNgLQ/s640/1+%285%29.png" width="640" /></a></div>
<div style="text-align: justify;">
<br /><br /><br />
5)Locate GND terminal as shown below<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcfub0U6_31PGwLFjhDJRSCkew9iZ24yTrgjYlns00uWJcJ-netfHVz8wecRwuxTOEp1tWMmdeXXfZMCByW6XBy6EP2UsuT_nH0DEuLS6nPwD0lea1esda6YtJgUd7uWLmemRfMfpPkZo/s1600/1+%286%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="364" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcfub0U6_31PGwLFjhDJRSCkew9iZ24yTrgjYlns00uWJcJ-netfHVz8wecRwuxTOEp1tWMmdeXXfZMCByW6XBy6EP2UsuT_nH0DEuLS6nPwD0lea1esda6YtJgUd7uWLmemRfMfpPkZo/s640/1+%286%29.png" width="640" /></a></div>
<div style="text-align: justify;">
<br />
6) Connect all LEDs to GND<br /><br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPjKuUBXkiTeriXYHzpaZ-2NqT9JNO6pbGc0U0JXDp9AoLJh33mjApxQqfG5mIzkXxGygX1pNQVn-UCxIZhYM3ZII8qe2hr_3adSN4geLiQrPZUPCuSBikitmzRUwk1AeU_vST_wvFZ-w/s1600/1+%287%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="364" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPjKuUBXkiTeriXYHzpaZ-2NqT9JNO6pbGc0U0JXDp9AoLJh33mjApxQqfG5mIzkXxGygX1pNQVn-UCxIZhYM3ZII8qe2hr_3adSN4geLiQrPZUPCuSBikitmzRUwk1AeU_vST_wvFZ-w/s640/1+%287%29.png" width="640" /></a></div>
<div style="text-align: justify;">
<br /><br /><br />
7) Double click on 8051 IC to open up its proerties window.<br /><br />
--- Set the operating frequency i-e 10.0MHz<br />
--- Give controller the desirewd HEX file.<br /><br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhX8Dz3epYEcJLTaotTkfiz-MJ3kmjzkjzPs6kjyVMlEYd6lNa63fMjv0sKkC_1ic03z16ThHwRWlvHkChT3dPIXyGvS75Vh6DfSxxY9oeupj92hwyRYTWN1pQjaFgYfpXThyphenhyphenxZLoMMTUA/s1600/1+%288%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="364" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhX8Dz3epYEcJLTaotTkfiz-MJ3kmjzkjzPs6kjyVMlEYd6lNa63fMjv0sKkC_1ic03z16ThHwRWlvHkChT3dPIXyGvS75Vh6DfSxxY9oeupj92hwyRYTWN1pQjaFgYfpXThyphenhyphenxZLoMMTUA/s640/1+%288%29.png" width="640" /></a></div>
<div style="text-align: justify;">
<br />
8) Click on Play Button to start simulation<br /><br /></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-ZZMYC4PsRydD_zcZfUuVeh1KXnOmexBzV-fzeKpz7T7_vf8vndsPdFVWBAWbQDnYsnX1bNmFPfiJn9N1DYRrt4uJxDpUZgofrpgqB1_CzceQovhpQaLWWmLqAEWWz5Pz_ZBNFnTqVoA/s1600/1+%289%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="364" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-ZZMYC4PsRydD_zcZfUuVeh1KXnOmexBzV-fzeKpz7T7_vf8vndsPdFVWBAWbQDnYsnX1bNmFPfiJn9N1DYRrt4uJxDpUZgofrpgqB1_CzceQovhpQaLWWmLqAEWWz5Pz_ZBNFnTqVoA/s640/1+%289%29.png" width="640" /></a></div>
<div style="text-align: justify;">
<br /><br /></div>
<h4 style="text-align: justify;">
<span style="background-color: yellow;">CIRCUIT SHOULD START WORKING AS SHOWN BELOW</span></h4>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja1hpRA9kHQndU8QoWzRIu7Ug9r7VvkLFOHyrexvXrYkvrnuwC2Wyop_BNYOwG-axnRScorIc7tdbO3wpIu4Dd65EonWOrYMFPYbYef2gZxSj-tKz9xM3D8EUg80hOvb4_zGd0U-ydSKk/s1600/1+%2810%29.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="364" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja1hpRA9kHQndU8QoWzRIu7Ug9r7VvkLFOHyrexvXrYkvrnuwC2Wyop_BNYOwG-axnRScorIc7tdbO3wpIu4Dd65EonWOrYMFPYbYef2gZxSj-tKz9xM3D8EUg80hOvb4_zGd0U-ydSKk/s640/1+%2810%29.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<h2 style="text-align: justify;">
4-BIT COUNTER CODE:</h2>
<div style="text-align: justify;">
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #274e13;">;------4 bit counter code</span><br />
<span style="color: #274e13;"><span class="Apple-tab-span" style="white-space: pre;"> </span>ORG 0</span><br />
<span style="color: #274e13;"><span class="Apple-tab-span" style="white-space: pre;"> </span>MOV P1,#0</span><br />
<span style="color: #274e13;">BACK1:<span class="Apple-tab-span" style="white-space: pre;"> </span>MOV A,#0</span><br />
<span style="color: #274e13;">BACK:<span class="Apple-tab-span" style="white-space: pre;"> </span>MOV P1,A</span><br />
<span style="color: #274e13;"><span class="Apple-tab-span" style="white-space: pre;"> </span>INC A</span><br />
<span style="color: #274e13;"><span class="Apple-tab-span" style="white-space: pre;"> </span>ACALL DELAY</span><br />
<span style="color: #274e13;"><span class="Apple-tab-span" style="white-space: pre;"> </span>CJNE A,#15,BACK</span><br />
<span style="color: #274e13;"><span class="Apple-tab-span" style="white-space: pre;"> </span>SJMP BACK1</span><br />
<span style="color: #274e13;"><br /></span>
<span style="color: #274e13;">DELAY: MOV R1,#45</span><br />
<span style="color: #274e13;">H3:<span class="Apple-tab-span" style="white-space: pre;"> </span>MOV R2,#100</span><br />
<span style="color: #274e13;">H2:<span class="Apple-tab-span" style="white-space: pre;"> </span>MOV R3,#100</span><br />
<span style="color: #274e13;">H1:<span class="Apple-tab-span" style="white-space: pre;"> </span>DJNZ R3,H1</span><br />
<span style="color: #274e13;"><span class="Apple-tab-span" style="white-space: pre;"> </span>DJNZ R2,H2</span><br />
<span style="color: #274e13;"><span class="Apple-tab-span" style="white-space: pre;"> </span>DJNZ R1,H3</span><br />
<span style="color: #274e13;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>RET</span><br />
<span style="color: #274e13;"><br /></span>
<span style="color: #274e13;"><span class="Apple-tab-span" style="white-space: pre;"> </span>END</span></div>
</div>
Anonymoushttp://www.blogger.com/profile/13526216155838659104noreply@blogger.com0tag:blogger.com,1999:blog-2190029239849113272.post-86617509096260877282014-03-16T05:05:00.002-07:002014-03-16T05:05:40.475-07:00TRANSISTOR CONFIGURATIONS<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
<span style="font-family: Courier New; font-size: x-small;">
</span></div>
<span style="font-family: Courier New; font-size: x-small;">TRANSISTOR CONFIGURATIONS </span><br />
<span style="font-family: Courier New; font-size: x-small;">
A transistor may be connected in any one of three basic configurations (fig. 2-16):
common emitter (CE), common base (CB), and common collector (CC). The term <u>common</u>
is used to denote the element that is common to both input and output circuits. Because
the common element is often grounded, these configurations are frequently referred to as
grounded emitter, grounded base, and grounded collector. <br />
Figure 2-16. - Transistor configurations. <br />
<div align="center">
<img height="415" src="http://www.tpub.com/neets/book7/0075.GIF" width="354" /> </div>
Each configuration, as you will see later, has particular <span class="IL_AD" id="IL_AD1">characteristics</span> that make it
suitable for specific applications. An easy way to identify a specific transistor
configuration is to follow three simple steps: <br />
<ul>
<li>
Identify the element (emitter, base, or collector) to which the input signal is applied.
</li>
<li>
Identify the element (emitter, base, or collector) from which the output signal is
taken.
</li>
<li>
The remaining element is the common element, and gives the configuration its name.
</li>
</ul>
Therefore, by <span class="IL_AD" id="IL_AD4">applying</span> these three simple steps to the circuit in figure 2-12, we can
conclude that this circuit is more than just a basic transistor amplifier. It is a
common-emitter amplifier. <br />
Common Emitter <br />
The common-emitter configuration (CE) shown in figure 2-16 view A is the arrangement
most frequently used in practical amplifier circuits, since it provides good voltage,
current, and power gain. The common emitter also has a somewhat low input resistance (500
ohms-1500 ohms), because the input is applied to the forward-biased junction, and a
moderately high output resistance (30 kilohms-50 kilohms or more), because the output is
taken off the reverse-biased junction. Since the input signal is applied to <span class="IL_AD" id="IL_AD3">the
base</span>-emitter circuit and the output is taken from <span class="IL_AD" id="IL_AD2">the collector</span>-emitter circuit, the
emitter is the element common to both input and output. <br />
Since you have already covered what you now know to be a common-emitter amplifier (fig.
2-12), let's take a few minutes and review its operation, using the PNP <u>common-emitter</u>
configuration shown in figure 2-16 view A.<br />
When a transistor is connected in a common-emitter configuration, the input signal is
injected between the base and emitter, which is a low resistance, low-current circuit. As
the input signal swings positive, it also causes the base to swing positive with respect
to the emitter. This action decreases forward bias which reduces collector current (I<sub>C</sub>)
and increases collector voltage (making V<sub>C</sub> more negative). During the negative
alternation of the input signal, the base is driven more negative with respect to the
emitter. This increases forward bias and allows more current carriers to be released from
the emitter, which results in an increase in collector current and a decrease in collector
voltage (making V<sub>C</sub> less negative or swing in a positive direction). The
collector current that flows through the high resistance reverse-biased junction also
flows through a high resistance load (not shown), resulting in a high level of
amplification. <br />
Since the input signal to the common emitter goes positive when the output goes
negative, the two signals (input and output) are 180 degrees out of phase. The
common-emitter circuit is the only configuration that provides a phase reversal. <br />
The common-emitter is the most popular of the three transistor configurations because
it has the best combination of current and voltage gain. The term <i>GAIN</i> is used to
describe the amplification capabilities of the amplifier. It is basically a ratio of
output versus input. Each transistor configuration gives a different value of gain even
though the same transistor is used. The transistor configuration used is a matter of
design consideration. However, as a technician you will become interested in this output
versus input ratio (gain) to determine whether or not the transistor is working properly
in the circuit. <br />
The current gain in the common-emitter circuit is called BETA (<span style="font-family: Symbol;">b</span>).
Beta is the relationship of collector current (output current) to base current (input
current). To calculate beta, use the following formula: <br />
<div align="center">
<img height="52" src="http://www.tpub.com/neets/book7/0076.GIF" width="66" /> </div>
(<span style="font-family: Symbol;">D</span> is the Greek letter delta, it is used to indicate a small
change) <br />
</span><br />
<div style="text-align: justify;">
<span style="font-family: Courier New; font-size: x-small;">For example, if the input current (I<sub>B</sub>) in a common emitter changes from 75 <span style="font-family: Symbol;">m</span>A to 100 </span><span style="font-family: Symbol; font-size: x-small;">m</span><span style="font-family: Courier New; font-size: x-small;">A and the output current (I<sub>C</sub>) changes from 1.5 mA
to 2.6 mA, the current gain (<span style="font-family: Symbol;">b</span>) will be 44. </span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New; font-size: x-small;">
<div align="center">
<img height="56" src="http://www.tpub.com/neets/book7/0077.GIF" width="174" /> </div>
This simply means that a change in base current produces a change in collector current
which is 44 times as large. <br />
</span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New; font-size: x-small;">You may also see the term h<sub>fe</sub> used in place of </span><span style="font-family: Symbol; font-size: x-small;">b</span><span style="font-family: Courier New; font-size: x-small;">. The terms h<sub>fe</sub> and </span><span style="font-family: Symbol; font-size: x-small;">b</span><span style="font-family: Courier New; font-size: x-small;"> are equivalent and may
be used interchangeably. This is because "h<sub>fe</sub>" means: h = <u>h</u>ybrid
(meaning mixture) </span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New; font-size: x-small;">
f = <u>f</u>orward current transfer ratio </span><br /><span style="font-family: Courier New; font-size: x-small;">
e = common <u>e</u>mitter configuration <br />
The resistance gain of the common emitter can be found in a method similar to the one
used for finding beta: <br />
<div align="center">
<img height="56" src="http://www.tpub.com/neets/book7/0078.GIF" width="67" /> </div>
</span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New; font-size: x-small;">Once the resistance gain is known, the voltage gain is easy to calculate since it is
equal to the current gain (</span><span style="font-family: Symbol; font-size: x-small;">b</span><span style="font-family: Courier New; font-size: x-small;">) multiplied by the resistance gain (E = </span><span style="font-family: Symbol; font-size: x-small;">b</span><span style="font-family: Courier New; font-size: x-small;">R). And, the power gain
is equal to the voltage gain multiplied by the current gain </span><span style="font-family: Symbol; font-size: x-small;">b</span><span style="font-family: Courier New; font-size: x-small;"> (P = </span><span style="font-family: Symbol; font-size: x-small;">b</span><span style="font-family: Courier New; font-size: x-small;">E). </span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New; font-size: x-small;">
Common Base <br />
The common-base configuration (CB) shown in figure 2-16, view B is mainly used for
impedance matching, since it has a low input resistance (30 ohms-160 ohms) and a high
output resistance (250 kilohms-550 kilohms). However, two factors limit its usefulness in
some circuit applications: (1) its low input resistance and (2) its current gain of less
than 1. Since the CB configuration will give voltage amplification, there are some
additional applications, which require both a low-input resistance and voltage
amplification, that could use a circuit configuration of this type; for example, some
microphone amplifiers. <br />
In the common-base configuration, the input signal is applied to the emitter, the
output is taken from the collector, and the base is the element common to both input and
output. Since the input is applied to the emitter, it causes the emitter-base junction to
react in the same manner as it did in the common-emitter circuit. For example, an input
that aids the bias will increase transistor current, and one that opposes the bias will
decrease transistor current. <br />
Unlike the common-emitter circuit, the input and output signals in the common-base
circuit are in phase. To illustrate this point, assume the input to the PNP version of the
common-base circuit in figure 2-16 view B is positive. The signal adds to the forward
bias, since it is applied to the emitter, causing the collector current to increase. This
increase in Ic results in a greater voltage drop across the load resistor R<sub>L</sub>
(not shown), thus lowering the collector voltage V<sub>C</sub>. The collector voltage, in
becoming less negative, is swinging in a positive direction, and is therefore in phase
with the incoming positive signal. <br />
The current gain in the common-base circuit is calculated in a method similar to that
of the common emitter except that the input current is I<sub> E</sub> not I<sub>B</sub>
and the term ALPHA (<span style="font-family: Symbol;">a</span>) is used in place of beta for gain. Alpha
is the relationship of collector current (output current) to emitter current (input
current). Alpha is calculated using the formula: <br />
<div align="center">
<img height="56" src="http://www.tpub.com/neets/book7/0079.GIF" width="69" /> </div>
For example, if the input current (I<sub>E</sub>) in a common base changes from 1 mA to
3 mA and the output current (I<sub>C</sub>) changes from 1 mA to 2.8 mA, the current gain
(<span style="font-family: Symbol;">a</span>) will be 0.90 or: <br />
<div align="center">
<img height="51" src="http://www.tpub.com/neets/book7/0080.GIF" width="190" /> </div>
This is a current gain of less than 1. <br />
Since part of the emitter current flows into the base and does not appear as collector
current, collector current will <u>always</u> be less than the emitter current that causes
it. (Remember, I<sub>E </sub>= I<sub>B</sub> + I<sub>C</sub>) Therefore, ALPHA is ALWAYS
LESS THAN ONE FOR A COMMON-BASE CONFIGURATION. <br />
</span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New; font-size: x-small;">Another term for "</span><span style="font-family: Symbol; font-size: x-small;">a</span><span style="font-family: Courier New; font-size: x-small;">" is h<sub>fb</sub>. These terms (and h<sub>fb</sub>) are
equivalent and may be used interchangeably. The meaning for the term h<sub>fb</sub> is
derived in the same manner as the term h<sub>fe</sub> mentioned earlier, except that the
last letter "e" has been replaced with "b" to stand for common-<u> b</u>ase
configuration. </span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New; font-size: x-small;">
</span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New; font-size: x-small;">Many transistor manuals and data sheets only list transistor current gain
characteristics in terms of </span><span style="font-family: Symbol; font-size: x-small;">b</span><span style="font-family: Courier New; font-size: x-small;"> or h<sub>fe</sub>. To find alpha (</span><span style="font-family: Symbol; font-size: x-small;">a</span><span style="font-family: Courier New; font-size: x-small;">) when given beta (</span><span style="font-family: Symbol; font-size: x-small;">b</span><span style="font-family: Courier New; font-size: x-small;">), use the following
formula to convert </span><span style="font-family: Symbol; font-size: x-small;">b</span><span style="font-family: Courier New; font-size: x-small;"> to </span><span style="font-family: Symbol; font-size: x-small;">a</span><span style="font-family: Courier New; font-size: x-small;">
for use with the common-base configuration: </span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New; font-size: x-small;">
<div align="center">
<img height="51" src="http://www.tpub.com/neets/book7/0081.GIF" width="63" /> </div>
</span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New; font-size: x-small;">To calculate the other gains (voltage and power) in the common-base configuration when
the current gain (</span><span style="font-family: Symbol; font-size: x-small;">a</span><span style="font-family: Courier New; font-size: x-small;">) is known, follow the procedures described earlier under the common-emitter
section. </span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New; font-size: x-small;">
Common Collector <br />
The common-collector configuration (CC) shown in figure 2-16 view C is used mostly for
impedance matching. It is also used as a current driver, because of its substantial
current gain. It is particularly useful in switching circuitry, since it has the ability
to pass signals in either direction (bilateral operation). <br />
In the common-collector circuit, the input signal is applied to the base, the output is
taken from the emitter, and the collector is the element common to both input and output.
The common collector is equivalent to our old friend the electron-tube cathode follower.
Both have high input and low output resistance. The input resistance for the common
collector ranges from 2 kilohms to 500 kilohms, and the output resistance varies from 50
ohms to 1500 ohms. The current gain is higher than that in the common emitter, but it has
a lower power gain than either the common base or common emitter. Like the common base,
the output signal from the common collector is in phase with the input signal. The common
collector is also referred to as an <u>emitter-follower</u> because the output developed
on the emitter follows the input signal applied to the base. <br />
</span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New; font-size: x-small;">Transistor action in the common collector is similar to the operation explained for the
common base, except that the current gain is not based on the emitter-to-collector current
ratio, alpha (</span><span style="font-family: Symbol; font-size: x-small;">a</span><span style="font-family: Courier New; font-size: x-small;">). Instead, it is based on the emitter-to-base current ratio called GAMMA (<span style="font-family: Symbol;">g</span>), because the output is taken off the emitter. Since a small change
in base current controls a large change in emitter current, it is still possible to obtain
high current gain in the common collector. However, since the emitter current gain is
offset by the low output resistance, the voltage gain is always less than 1 (unity),
exactly as in the electron-tube cathode follower </span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New; font-size: x-small;">
</span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New; font-size: x-small;">The common-collector current gain, gamma (</span><span style="font-family: Symbol; font-size: x-small;">g</span><span style="font-family: Courier New; font-size: x-small;">), is defined as </span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New; font-size: x-small;">
<div align="center">
<img height="51" src="http://www.tpub.com/neets/book7/0082.GIF" width="56" /> </div>
</span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New; font-size: x-small;">and is related to collector-to-base current gain, beta (</span><span style="font-family: Symbol; font-size: x-small;">b</span><span style="font-family: Courier New; font-size: x-small;">), of the common-emitter
circuit by the formula: </span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New; font-size: x-small;">
<div align="center">
<img height="38" src="http://www.tpub.com/neets/book7/0083.GIF" width="67" /> </div>
</span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New; font-size: x-small;">Since a given transistor may be connected in any of three basic configurations, there
is a definite relationship, as pointed out earlier, between alpha (</span><span style="font-family: Symbol; font-size: x-small;">a</span><span style="font-family: Courier New; font-size: x-small;">), beta (</span><span style="font-family: Symbol; font-size: x-small;">b</span><span style="font-family: Courier New; font-size: x-small;">), and gamma (</span><span style="font-family: Symbol; font-size: x-small;">g</span><span style="font-family: Courier New; font-size: x-small;">). These relationships
are listed again for your convenience: </span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New; font-size: x-small;">
<div align="center">
<img height="49" src="http://www.tpub.com/neets/book7/0084.GIF" width="206" /> </div>
Take, for example, a transistor that is listed on a manufacturer's data sheet as having
an alpha of 0.90. We wish to use it in a common emitter configuration. This means we must
find beta. The calculations are: <br />
<div align="center">
<img height="46" src="http://www.tpub.com/neets/book7/0085.GIF" width="203" /> </div>
Therefore, a change in base current in this transistor will produce a change in
collector current that will be 9 times as large. <br />
</span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New; font-size: x-small;">If we wish to use this same transistor in a common collector, we can find gamma (</span><span style="font-family: Symbol; font-size: x-small;">g</span><span style="font-family: Courier New; font-size: x-small;">) by: </span></div>
<div style="text-align: justify;">
<span style="font-family: Courier New; font-size: x-small;">
<div align="center">
<img height="35" src="http://www.tpub.com/neets/book7/0086.GIF" width="135" /> </div>
To summarize the properties of the three transistor configurations, a comparison chart
is provided in table 2-1 for your convenience. <br />
Table 2-1. - Transistor Configuration Comparison Chart <br />
<div align="center">
<center>
<table border="1" cellpadding="2" id="table1">
<tbody>
<tr>
<td><b>AMPLIFIER TYPE</b></td>
<td><b>COMMON BASE</b></td>
<td><b>COMMON EMITTER</b></td>
<td><strong>COMMON COLLECTOR</strong></td>
</tr>
<tr>
<td>INPUT/OUTPUT PHASE RELATIONSHIP</td>
<td>0°</td>
<td>180°</td>
<td>0°</td>
</tr>
<tr>
<td>VOLTAGE GAIN</td>
<td>HIGH</td>
<td>MEDIUM</td>
<td>LOW</td>
</tr>
<tr>
<td>CURRENT GAIN</td>
<td>LOW(<span style="font-family: Symbol; font-size: x-small;">a</span><span style="font-family: Courier New; font-size: x-small;">)</span></td>
<td>MEDIUM(<span style="font-family: Symbol; font-size: x-small;">b</span><span style="font-family: Courier New; font-size: x-small;">)</span></td>
<td>HIGH(<span style="font-family: Symbol; font-size: x-small;">g</span><span style="font-family: Courier New; font-size: x-small;">) </span></td>
</tr>
<tr>
<td>POWER GAIN</td>
<td>LOW</td>
<td>HIGH</td>
<td>MEDIUM</td>
</tr>
<tr>
<td>INPUT RESISTANCE</td>
<td>LOW</td>
<td>MEDIUM</td>
<td>HIGH</td>
</tr>
<tr>
<td>OUTPUT RESISTANCE</td>
<td>HIGH</td>
<td>MEDIUM</td>
<td>LOW</td>
</tr>
</tbody></table>
</center>
</div>
Now that we have analyzed the basic transistor amplifier in terms of bias, class of
operation, and circuit configuration, let's apply what has been covered to figure 2-12. A
reproduction of figure 2-12 is shown below for your convenience. <br />
<div align="center">
<img height="376" src="http://www.tpub.com/neets/book7/0087.GIF" width="458" /> </div>
This illustration is not just the basic transistor amplifier shown earlier in figure
2-12 but a class A amplifier configured as a common emitter using fixed bias. From this,
you should be able to conclude the following: <br />
<ul>
<li>
Because of its fixed bias, the amplifier is thermally unstable.
</li>
<li>
Because of its class A operation, the amplifier has low efficiency but good fidelity.
</li>
<li>
Because it is configured as a common emitter, the amplifier has good voltage, current,
and power gain.
</li>
</ul>
In conclusion, the type of bias, class of operation, and circuit configuration are all
clues to the function and possible application of the amplifier. <br />
Q.26 What are the three transistor configurations?<a href="http://www.tpub.com/neets/book7/25l.htm" target="_blank"><img alt="answer.gif (214 bytes)" height="20" src="http://www.tpub.com/neets/answer.gif" width="60" /></a></span><br /><span style="font-family: Courier New; font-size: x-small;">
Q.27 Which transistor configuration provides a phase reversal between the input and output
signals? <a href="http://www.tpub.com/neets/book7/25l.htm" target="_blank"><img alt="answer.gif (214 bytes)" height="20" src="http://www.tpub.com/neets/answer.gif" width="60" /></a></span><br /><span style="font-family: Courier New; font-size: x-small;">
Q.28 What is the input current in the common-emitter circuit?<a href="http://www.tpub.com/neets/book7/25l.htm" target="_blank"><img alt="answer.gif (214 bytes)" height="20" src="http://www.tpub.com/neets/answer.gif" width="60" /></a></span><br /><span style="font-family: Courier New; font-size: x-small;">
Q.29 What is the current gain in a common-base circuit called? <a href="http://www.tpub.com/neets/book7/25l.htm" target="_blank"><img alt="answer.gif (214 bytes)" height="20" src="http://www.tpub.com/neets/answer.gif" width="60" /></a></span><br /><span style="font-family: Courier New; font-size: x-small;">
Q.30 Which transistor configuration has a current gain of less than 1? <a href="http://www.tpub.com/neets/book7/25l.htm" target="_blank"><img alt="answer.gif (214 bytes)" height="20" src="http://www.tpub.com/neets/answer.gif" width="60" /></a></span><br /><span style="font-family: Courier New; font-size: x-small;">
Q.31 What is the output current in the common-collector circuit? <a href="http://www.tpub.com/neets/book7/25l.htm" target="_blank"><img alt="answer.gif (214 bytes)" height="20" src="http://www.tpub.com/neets/answer.gif" width="60" /></a></span><br /><span style="font-family: Courier New; font-size: x-small;">
Q.32 Which transistor configuration has the highest input resistance? <a href="http://www.tpub.com/neets/book7/25l.htm" target="_blank"><img alt="answer.gif (214 bytes)" height="20" src="http://www.tpub.com/neets/answer.gif" width="60" /></a></span><br /><span style="font-family: Courier New; font-size: x-small;">
Q.33 What is the formula for GAMMA (<span style="font-family: Symbol; font-size: x-small;">g</span>)? <a href="http://www.tpub.com/neets/book7/25l.htm" target="_blank"><img alt="answer.gif (214 bytes)" height="20" src="http://www.tpub.com/neets/answer.gif" width="60" /></a></span></div>
<span style="font-family: Courier New; font-size: x-small;">
</span></div>
Anonymoushttp://www.blogger.com/profile/13526216155838659104noreply@blogger.com0tag:blogger.com,1999:blog-2190029239849113272.post-39077224320422632082014-03-16T03:57:00.001-07:002014-03-16T05:03:33.781-07:00Transistors "Bipolar Basics"<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: justify;">
<span style="color: red; font-size: medium;"><i>"We look at the tiny devices that have reshaped the world of electronics."</i></span><br />
<br />
Along with the solid-state diode, the point-contact transistor--invented in 1947 at Bell Labs--started the semiconductor
revolution and has gone on the become one of the rudimentary devices in today's electronic equipment. The transistor,
whether in discrete or IC form, is at the heart of most modern circuitry. Therefore, understanding how transistors
function will help you properly design circuits containing them, and in case of a failure, enable you to find and
correct the problem.<br />
<br />
<span style="font-size: small;"><b><u>Bipolar-Transistor Composition:</u></b></span><br />
A bipolar transistor is basically a two PN junctions connected back-to-back within the same piece of semiconductor
material and sharing a common P- or N-doped semiconductor region. There are two types of bipolar transistor, the NPN
and the PNP. <span style="color: red;">Fig. 1A</span> is a simplified illustration of the composition of the NPN type of
transistor. In our illustration, the NPN type unit is shown as P-doped semiconductor material sandwiched between two
layers of N-doped material. The composition of a PNP transistor is just the opposite of that, (i.e. the N- and P-doped
materials in the transistor are interchanged). It follows then that biasing considerations for NPN units are also
opposite from those for the PNP unit.<br />
<br />
Note from <span style="color: red;">Fig. 1A</span> that a bipolar transistor is comprised of a center region called the
base surrounded by two other regions known as the collector and the emitter. The difference between them will be
discussed shortly. The two junctions are arranged so that they are very close together; that's done by making the
shared base region very thin and lightly doped. That causes the two junctions to interact with one another.
Conduction is the collector-base junction depends largely on what happens in the emitter-base junction.<br />
Because the region is lightly doped, it has a relatively small number of free carriers (holes in a P-type base and
electronics in an N-type base) to conduct current. On the other hand, the emitter region is quite heavily doped,
containing a much larger amount of donor impurity (for the NPN type) or acceptor impurity (for the PNP type), so there
are many more free carriers available in the emitter region to conduct current than in the adjacent base region.
Because of that, the emitter-base junction, when forward biased, conducts much the same as a common PN junction diode.<br />
The current that flows (composed of electrons for NPN units and holes, in the case of PNP transistors) is mainly from
the emitter to the base rather than vice versa. That is where the emitter derives its name--it emits or injects
current carriers in the other regions of the device.<br />
<br />
The third region of a transistor, the collector, is lightly doped, much the same as the base, except with the opposite
type of doping impurity, so it (like the base region) has relatively few free carriers available to conduct current in
the normal way. The collector-base junction is normally reverse biased, so a depletion layer forms, spreading out on
either side of the junction. The depletion layer effectively removes the carriers that would otherwise balance out
the charges on the fixed impurity atoms of the crystals, setting up a potential barrier to match the applied reverse
voltage.<br />
<br />
<img alt="Simplified NPN Composition" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor1/1fig1.gif" height="510" width="496" /><br />
To the normal majority carriers in the base and emitter, that potential barrier is a big wall that must be overcome
before they can pass to the other side. So just as in the case of a normal diode, virtually no current flows across
the collector-base junction when left to its own devices. However, the junction is not left to its own devices.<br />
Remember that the base region is deliberately made very thin and lightly doped, while the emitter is made much more
heavily doped. Because of that, applying a forward bias to the emitter-base junction causes vast majority carriers
to be injected into th the base, and straight into the reverse-biased collector-base junction. Those carriers are
actually minority carriers in the base region, because that region is of opposite semiconductor type to the emitter.
To those majority-turned-minority carriers, the collector-base junction depletion region is not a barrier at all but
an inviting, accelerating filed; so as soon as they reach the depletion layer, they are immediately swept into the
collector region.<br />
Forward biasing the emitter-base junction causes two things to happen that might seem surprising at first: Only a
relatively small current actually flows between the emitter and the base. much smaller than would flow in a normal PN
diode despite the forward bias applied to the junction between them. A much larger current instead flows directly
between the emitter and the collector regions, in this case, despite the fact that the collector-base junction is
reversed biased.<br />
That effect is illustrated in <span style="color: red;">Fig. 1A</span>, which (hopefully) will help you to understand what
is going on. The diagram shows a NPN transistor, but the action in a PNP unit is similar except for the opposite
region polarity and conduction mainly by holes rather than electrons.<br />
From a practical point of view, the behavior of bipolar transistors means that, unlike the simple PN-junction diode, it
is capable of amplification. In effect, a small input current made to flow between the emitter and collector. Only a
small voltage--around 0.6 volts for a typical silicon transistor--is needed to produce the small input current
required.<br />
In contrast, the reverse-bias voltage applied across the collector-base junction can be much larger; typically
anywhere from 6 to 90 volts or more. So in producing and being able to control a larger current in this much
higher-output circuit, the transistor's small input current and voltage can achieve considerable voltage, power, and
current, gains.<br />
Bipolar transistors, therefore, work very well as both amplifiers and electronics switches. That is why they have
become the workhorses of modern electronics, virtually replacing the vacuum tube. The diagram in <span style="color: red;">Fig. 1A</span>
is designed to show how a bipolar transistor works, rather than its physical construction. The actual form of the
modern, planar, double-defuse epitaxial-junction transistor is shown in <span style="color: red;">Fig. 1A</span>.<br />
The collector region is formed from a lightly doped layer grown epitaxially on the main substrate, which is made from
the same type (but more heavily doped) material to provide a low resistance connection. Here, both are N-doped material;
for a PNP transistor, they would be P-doped material.<br />
The base region is formed by lightly diffusing the opposite type impurity into a medium-sized area of the chip surface
to reverse that type of area and create the base-collector unction. The emitter region is formed by a second and
heavier diffusion over the smaller area inside the first, but this time with the same kind of impurity as used for the
epitaxial collector region.<br />
The second diffusion is very carefully controlled so that the emitter region that results extends almost--but not
quite--to the bottom of the base. That leaves the area of the base right below the emitter quite thin to ensure that
as many as possible of the carriers are injected from the emitter region will be swept through to the collector. The
thinner that active base region, the higher (in general) the gain of the transistor.<br />
Note that although the collector and emitter regions are made of the same type of semiconductor material, the two are
physically quite different. The emitter is heavily doped (for a good carrier injection) and can be relatively small
since the emitter-base junction does not need to dissipate much power (heat). In contrast, the collector is lightly
doped (for a wide depletion area) and its junction is much larger since, being reversed biased, it must dissipate much
more power.<br />
Connections to the emitter and base regions are made by way of aluminum electrodes deposited on the surface. Thin
wires are bonded to the electrodes for connection to the main device leads. The low-resistance substrate itself is
used to connect to the collector region.<br />
That is the basic construction used for most modern bipolar transistors, whether they are discrete units or part of an
<br />
<img align="left" alt="PNP Version of Fig. 1A" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor1/1fig2.gif" height="299" width="275" />
IC containing thousands of transistors. The main difference is size, although, in an IC, the collector region of the
transistor will generally be in an epitaxial layer grown on the opposite kind of substrate, and separated by diffused
walls (of the opposite type material) to separate the transistors from each other.<br />
In an IC, the active part of an individual transistor might only be a couple micrometers square, while a very large
transistor (used to switch hundreds of amperes) might be on a single wafer of 10 mm or more in diameter. Typical
small-to-medium power, discrete transistors used in consumer and hobby electronics are grown on chips measuring from
1- to about 3-mm square--the rest of the component is protective packaging.<br />
<br />
<span style="font-size: small;"><b><u>Transistor Operation:</u></b></span><br />
Refer to <span style="color: red;">Fig. 2</span>, a PNP version of the illustration shown in <span style="color: red;">Fig. 1A</span>.
Note that both are essentially the same, except that in this instance, the collector is more negative than the base or
the emitter. That is an important characteristic to remember when it comes to the operation of bipolar transistors.<br />
<br />
If a positive voltage is applied to the P-doped emitter (to the left), current will be swept through the base-emitter
junction--with the holes from the P-doped material moving to the right and the electrons form the N-doped material
moving to the left. Some of the holes moving into the N-doped base region will combine with the electrons and become
neutralized, while others will migrate to the base-collector junction.<br />
Normally, if the base-collector junction is negatively biased, there would be no current flow in the circuit. However,
there would be additional holes in the junction to travel to the base-collector junction, and electrons can then
travel toward the base-emitter junction, so a current flows even through that section of the sandwich is biased (at
cutoff) to prevent conduction. Most of the current travels between the emitter and collector and does not flow out
through the base.<br />
The amplitude of the collector current depends principally on the magnitude of emitter current (e.g., the collector
current). Note that between each PN junction, there is an area known as the depletion or transition region that is
similar in some characteristics to a dielectric layer. That layer varies in accordance with the operating voltage.
The semiconductor materials on either side of the depletion regions constitute the plates of a capacitor. The
base-collector capacitance is indicated in <span style="color: red;">Fig. 2</span> as C<sub>bc</sub>, and the base-emitter
capacitance is designated C<sub>be</sub>. A change in signal and operating voltages causes a non-linear change in
those junction capacitances.<br />
<br />
There is also a base-emitter resistance (R<sub>be</sub> that must be considered. In practical transistors, emitter
resistance is on the order of a few ohms, while the collector resistance is many hundreds or even thousands of times
larger. The junction capacitance in combination with the base-emitter resistance determine the useful upper-frequency
limit of a transistor by establishing an RC time constant.<br />
Because the collector is reversed biased, the collector-to-base resistance is high. On the other hand, the emitter and
collector currents are substantially equal, so the power in the collector circuit is larger than the power in the
emitter circuit.<br />
(P = I<sup>2</sup>R, so the powers are proportional to the respective resistances, if the currents are the same.)<br />
<br />
In practical transistors, emitter resistance is on the order of a few ohms, while the collector resistance is many
hundreds or thousands of times larger, so power gains of 20 to 40dB, or even more, are possible.<br />
<img align="left" alt="Schematic symbols for NPN and PNP" border="1" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor1/1fig3.gif" height="229" width="254" /><span style="color: red;">Figure 3</span> shows the schematic symbols for both the NPN and PNP version of the bipolar
transistor. The first two letters of the designators (NPN or PNP) indicate the polarities of the voltages applied to
the collector and emitter in normal operation. For example, in a PNP unit, the emitter is made more positive with
respect to the collector and the base, and the collector is made more negative with respect to the base. Another way
of saying that is: the collector is more negative than the base and the base is more negative than the emitter.<br />
<br />
<span style="font-size: small;"><b><u>Transistor Amplifiers:</u></b></span><br />
Transistors are among the most commonly used building blocks in electronics. While they can be used as electronically
controlled switches, they are widely configured for amplifier use. In fact, the vast majority of electronic circuits
contain one or more amplifiers of some type or another.<br />
However, what exactly do we mean by the term amplifier? By definition an amplifier is a circuit that draws power from
a source other than the input signal and produces an output that is usually an enlarged reproduction of the input signal.<br />
<br />
<img align="left" alt="Amplifier Conduction Angles and Efficiency" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor1/1table1.gif" height="161" width="318" />
We say usually because not all amplifiers are used to magnify the input signal--buffer amplifiers (often called
unity-gain amplifiers) are not designed to magnify the input signal. When operated as a buffer, the transistor is
used to isolate one stage from the effects of one that follows. Since buffer amplifiers provide no increase in signal
level, a 10-millivolt (mV) signal applied to the input of a unity-gain amplifier produces an output signal at the same
10-mV level (a carbon copy of the input signal).<br />
There are may types of amplifiers, however, and all fall into one of two broad categories: voltage amplifiers or
current (often referred to as a power) amplifiers. The term voltage amplifier implies to a circuit in which a low
voltage is applied to the input to produce a higher voltage at the output. The term power amplifier is generally
reserved for those that supply an appreciable power (or current) increase to the load.<br />
Because a vast array of amplifier circuits in use in modern electronics, amplifier circuits are often subdivided by
application--AF, IF, RF, Instrumentation, op-amp, etc. Another way of categorizing amplifiers is by configuration:
common-emitter, common-collector, and common-base for example. The important parameters in such circuits are the
cutoff frequency and the input/output impedances. The cut-off frequency at which the gain of an amplifier falls below
0.707 times the maximum gain of the circuit. The input impedance is the output impedance of the transistor.<br />
<br />
<img alt="Common-collector Amplifiers" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor1/1fig4.gif" height="523" width="561" /><br />
<span style="font-size: small;"><b><u>Amplifier Configurations:</u></b></span><br />
An example of a common-base amplifier is shown in <span style="color: red;">Fig. 4A</span>. The optimum load impedance can
range from a few thousand ohm to 100,000 ohms, depending on the circuit's requirements. In this type of circuit, the
output signal (at the collector) is in phase with the input signal (applied at the emitter). THe current that flows
through the base resistance of the transistor is therefore in phase as well, so the circuit tends to be regenerative
and will oscillate if the current-amplification factor is greater than one.<br />
A common-emitter (also called a "grounded-emitter") amplifier is shown in <span style="color: red;">Fig. 4B</span>. Base
current in this amplifier configuration small and the input impedance is therefore fairly high (several thousand ohms
on the average). Collector resistance on the other hand, can be tens of thousands of ohms, depending on the signal's
source impedance. The common-emitter amplifier has a lower cutoff frequency than does the common-base type, but gives
the highest power gain of the three configurations. Note that the output signal is 180° out-of-phase with (or the
opposite of) the input (base-current) signal, so the feedback that flows through the small emitter resistance is
negative (degenerative), keeping the circuit stable. The common-emitter amplifier is one of the most often seen
configurations for the bipolar transistor.<br />
The common-collector amplifier (also referred to as an emitter follower), see <span style="color: red;">Fig. 4C</span>, has
a high input impedance and a low output impedance.<br />
<br />
The impedance is approximately: <img align="middle" alt="" border="0" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor1/imp1.gif" /><br />
<br />
The fact that the input resistance is directly related to the load resistance is a disadvantage of this type of amplifier
if the load is one whose resistance or impedance varies with frequency.<br />
<br />
The current transfer ratio of this type of circuit is: <img align="middle" alt="" border="0" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor1/imp2.gif" /><br />
<br />
and the cutoff frequency is the same as in the common-emitter amplifier circuit. The output and input currents of
this type of circuit are in phase.<br />
<br />
<img alt="A-B-C-AB Amplifier Classification" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor1/1fig5.gif" height="519" width="654" /><br />
<span style="font-size: small;"><b><u>Amplifier Classifications:</u></b></span><br />
Amplifiers may be otherwise classified by their specific operational characteristics, in particular, the bias voltages
between the emitter-base and base-collector junctions. The relationship between the bias voltage and the cutoff
voltage of an amplifier is what classifies an amplifier as being class A, B, C, or AB. Each class has a specific
characteristic that makes it most suitable for a particular application.<br />
In a class-A amplifier--which is the least efficient, but offers the least distortion--the transistor is biased so that
its quiescent operation point is in the middle of the power-supply extremes, i.e., the transistor is always turned
<i>on</i> and the resulting output varies around the bias voltage; see the output waveform in <span style="color: red;">Fig. 5A</span>.
Because of that, the input signal must be small enough so that its positive and negative swings do not drive the
amplifier near the non-linear cutoff and saturation regions.<br />
Since a high-value resistor is used to change the output voltage to a current <b>(I=V/R)</b> in a class-A configuration,
the output current is small. That is important since current flows at all times in such amplifiers, with or without
an input signal. Power is wasted and efficiency (the ratio of output to total power consumed) is low--only about
20-25%--in call-A amplifiers. Class-A amplifiers can be configured for single-ended or push-pull operation and are
used in AF (audio frequency), IF (intermediate frequency), and RF (radio frequency) applications.<br />
<br />
<img align="right" alt="Single-ended Class-A" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor1/1fig6.gif" height="312" width="260" />
Class-A operation is suitable for voltage amplifiers. In a voltage amplifier, the emphasis is on the magnitude of the
output voltage. <span style="color: red;">Figure 6</span> shows a single-ended class-A amplifier. Such an amplifier might
be used in a preamplifier stage, where input signals are typically small, and a faithful reproduction of the input
using a single transistor is needed. That configuration allows a small input current to control current drawn from a
power source, and thus produce a stronger replica of a weaker original signal.<br />
<br />
In Class-B operation, the transistor is biased at cutoff (see Fig. 5B), so that output current flows during only half of
the input cycle. It is used where high efficiency and low distortion are required--for instance, in power-output
configurations. When the Class-B amplifier is used for audio applications, two such amplifiers connected in the
push-pull configuration are required, so that current can flow alternately through the two amplifiers. In other words,
on amplifier is turned on, while the other is turned off.<br />
<br />
On the other hand, when the Class-B amplifier is used in RF applications, it can be configured for single-ended
operation. Since, in the absence of an input signal its current output is negligible, it is used where high efficiency
(60-70%) and low distortion are required, which is very important in high-power amplifiers.<br />
Class-AB amplifiers (see Fig. 5C) are biased somewhere between Class-A and Class-B operation, and have efficiencies
(25-35%) and distortion characteristics that lie between those of Class-A and Class-B amplifiers. Class-AB amplifiers
require a somewhat larger input signal than do Class-A amplifiers. The class-AB amplifier is used in push-pull
configurations for both audio-and radio-frequency applications.<br />
<br />
In Class-C operation--which has the highest efficiency (perhaps more than 90%), but offers the greatest
distortion--the transistor is biased beyond the cutoff region (see Fig. 5D). Because of that, output output current
flows during less than half (about a third) of the input cycle, making it unsuitable for amplifying signals of varying
amplitude, such as audio. That type of amplifier is normally used to amplify a signal of fixed amplitude; for
instance, it is often used in RF power output stages of a transmitter. Current in a Class-C amplifier flows in a
series of power pulses that excite an LC-tank circuit into oscillation. Because of that the output waveform is a
sinewave, that varies in amplitude if modulated. Class-C amplifiers can be configured for push-pull or single-ended
operation. Table 1 summarizes the conduction angles and efficiency ratings of the various classes of transistor
amplifier.<br />
<br />
<h3>
Continue with Transistor Tutorial <a href="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor2/xtor2.html"><b>Part 2</b></a></h3>
<h3>
<b> </b></h3>
<h3>
<b> </b></h3>
<h3 style="text-align: justify;">
<b> </b></h3>
<div style="text-align: justify;">
<span style="color: red; font-size: medium;"><i>"The bipolar junction transistor is still one of the cornerstone's of modern
solid-state electronics. Learn (or review) the basics of this important active device.</i></span><br />
<br />
The Bipolar Junction Transistor (BJT) triggered the revolution in modern solid-state electronics in the 1960's.
Although the discrete small-signal BJT has since yielded to the integrated circuit (IC) in economic importance, it
lives on in the form of discrete linear and switching power transistors as well as radio-frequency transistors into
the microwave region.<br />
The principles behind the operation of the BJT are important to the understanding of many of today's most popular linear
and digital integrated circuits. Moreover, the transistor families--TTL, Schottky TTL, and emitter-couple logic (ECL)
are BJT's.<br />
This article focuses small-signal BJT's and practical circuits that can be made with them. They function either as
linear amplifiers or digital switches.<br />
The term bipolar junction transistor (BJT) distinguishes it from the junction field-effect transistor or JFET.<br />
<br />
<img alt="Figure 1" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor2/2fig1.gif" height="197" width="256" />
<img alt="Figure 2" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor2/2fig2.gif" height="197" width="256" /><br />
<span style="font-size: small;"><b><u>BJT Basics:</u></b></span><br />
A BJT is a three-terminal (<i>base, emitter, and collector</i>) device. There are two types: NPN and PNP. Today both
are typically made by the double-diffusion process that involves the deposition of two additional layers of doped
silicon on a doped silicon wafer.<br />
<span style="color: red;">Figure 1-<i>a</i></span> shows the cross section of an NPN BJT. Its base and emitter terminals
are metal depositions on top of the silicon wafer, and its collector is the metalized lower surface of the wafer.
<span style="color: red;">Figure 2-<i>a</i></span> shows the cross section of a PNP BJT. It is similar to the NPN BJT,
except that the N- and P-type materials have changed places.<br />
<span style="color: red;">Figure 1-<i>b</i></span> and <span style="color: red;">2-<i>b</i></span> are the schematic symbols
for the NPN and PNP transistors, respectively. Notice that they are the same except for the direction of the
arrowhead within the symbol at the emitter terminal. This difference will be explained shortly.<br />
The term <i>bipolar</i> means that the BJT's operation depends on the movement of two different carriers: <i>electrons</i>
and <i>holes</i>. In NPN BJT's the electron is the <i>majority carrier</i> and the hole is the <i>minority</i>
carrier. This situation is reversed in the PNP BJT.<br />
By contrast, all filed-effect transistors (JFET's and MOSFET's) depend upon the movement of only one carrier, either
electrons or hoes, depending on whether they are N-channel or P-channel devices, so they are technically
<i>uni</i>polar devices. (For more on this, see <b>Electronics Now</b>, April and May 1993).<br />
The voltage on the collector of the NPN BJT must be positive with respect to its emitter if current I<sub>c</sub> is to
flow. That current will increase with a positive bias on the base. <span style="color: red;">Figure 3-<i>a</i></span> shows
how a small input current applied at the base (I<sub>b</sub>) of the NPN BJT can control I<sub>c</sub>.
The arrowhead indicates the direction of conventional current flow--collector to emitter. Note that it is in the same
direction as the arrowhead in the symbol for the NPN transistor. (Electrons flow in the direction opposing the
arrowhead.)<br />
<img align="left" alt="Figure 3" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor2/2fig3.gif" height="300" width="256" /><br />
Similarly, the PNP transistor requires a negative collector supply with respect to its emitter to operate, and a
negative base bias to increase conduction. <span style="color: red;">Fig. 3-<i>b</i></span> shows conventional current
flow in the PNP BJT from the emitter to the collector, as shown in the symbol for the NPN transistor, but opposite to
that shown in <span style="color: red;">Figure 3-<i>a</i></span>.<br />
Most of the common commodity NPN and PNP BJT's available from electronics distributors and retail stores have been
standardized and are made by many different suppliers around the world. Table 1 lists the basic characteristics of two
typical general-purpose, small-signal BJT's that are included in the projects discussed in this article: the 2N3904
NPN-type and the 2N3906 PNP-type. Both are packaged in small, three-pin plastic cylindrical TO-92 packages with flat
faces.<br />
<br />
Brief definitions for the parameters in Table 1 are:</div>
<br />
<li style="text-align: justify;"> <i>Power dissipation</i> is the maximum <i>mean</i> power that the BJT can dissipate without an external heatsink, at normal
room temperature, 25°C.<br />
</li>
<br />
<div style="text-align: justify;">
When the collector-to-emitter voltage exceeds a few hundred millivolts, the collector current value is almost
directly proportional to the base current value. It is only slightly affected by the actual collector voltage value.
Thus, the transistor can perform as a constant-current generator by feeding a fixed bias current into the base.<br />
The transistor can also perform as a linear amplifier by superimposing the input signal on a nominal input bias
current. (This will be discussed in more detail later.)<br />
<br />
<span style="font-size: small;"><b><u>Circuit Applications:</u></b></span><br />
Even a simple small-signal BJT has many applications related to its ability to amplify or switch. Some of the most
important and practical circuit designs are described her. With few exceptions, all of the circuits are based on the
2N3904 NPN transistor. (With certain minor component value changes, other NPN transistor can be substituted.)
The circuits can also be made with a PNP transistor such as the 2N3906, if the polarities are altered.<br />
<br />
<span style="font-size: small;"><b><u>Diodes and Switches:</u></b></span><br />
It was explained earlier that both the base-emitter and base-collector junctions of a silicon BJT can be considered
equivalent to a zener diode. As a result, either of these junctions can perform as a fast-acting rectifier diode or
zener diode, depending on the bias polarity.<br />
<span style="color: red;">Figure 6</span> shows two alternative ways to make an NPN BJT perform as a diode in a <i>clamping</i>
circuit that converts an AC-coupled rectangular input waveform into a DC square wave. The input AC waveform is
symmetrical above and below the zero-voltage reference. However, the output signal retains the input's form and
amplitude, but it is clamped to the zero-voltage reference.<br />
If you build this circuit, use the base-collector terminals as the diode as in <span style="color: red;">Fig. 6-<i>b</i></span>
because they provide a larger zener voltage value than the circuit shown in <span style="color: red;">Fig. 6-<i>a</i></span>.<br />
<span style="color: red;">Figure 7</span> shows how an NPN BJT can function as a zener diode in a circuit that converts an
<img align="left" alt="Ratings Table 1" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor2/2table1.gif" height="239" width="396" />
unregulated supply voltage into a fixed-value regulated output voltage. Typical values range from 5 to 10 volts,
depending on the characteristics of the selected transistor. The base emitter junction is the only one suitable for
this application.<br />
<span style="color: red;">Figure 8</span> shows a BJT functioning as a simple electronics switch or digital inverter. Here
the base is driven through resistor R<sub>b</sub> by a digital input step voltage that has a positive value. The load
resistor R<sub>l</sub> can be a simple resistor, tungsten lamp filament, or a relay coil. Connect the load between
the collector and the positive supply.<br />
When the input voltage is zero, the transistor switch is cut off. Thus no current flows through the load, and the
full supply voltage is available between the collector and emitter terminals. When the input voltage is high, the
transistor switch is driven fully <i>on</i>. Maximum current flows in the load, and only a few hundred millivolts is
developed between the collector and emitter terminals. Thus the output voltage signal is the inverted form of the
input signal.<br />
<br />
<img align="left" alt="Switch or Inverter" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor2/2fig8.gif" height="204" width="252" /><img align="right" alt="C-E linear amplifier" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor2/2fig9.gif" height="204" width="252" /><span style="font-size: small;"><b><u>Linear Amplifiers:</u></b></span><br />
A BJT can function as a linear current or voltage amplifier if a suitable bias current is fed into its base, and the
output signal is applied between a suitable pair of terminals. A transistor amplifier can be configured for any of
three operating modes: <i>common-emitter</i>(Fig. 9), <i>common-base</i>(Fig. 10), and <i>common-collector</i>(Fig. 11).
Each of these modes offers a unique set of characteristics.<br />
In the common-emitter circuit of <span style="color: red;">Fig. 9</span>, load resistor R<sub>l</sub> is connected between
the collector and the positive supply, and a bias current is fed into the base through R<sub>b</sub>. The value of
R<sub>b</sub> was selected so that the collector takes on a quiescent value of about half the supply voltage (to
provide maximum undistorted signal swings).<br />
<img align="left" alt="C-B linear amplifier" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor2/2fig10.gif" height="204" width="252" />
The input signal in the form of a sine wave is applied between the base and the emitter through C1. The circuit
inverts the phase of the input signal, which appears as an output between the collector and emitter. This circuit is
characterized by a medium-value input impedance and a high overall voltage gain.<br />
The input impedance of this amplifier is between 500 and 2000 ohms, and the load impedance equals R<sub>l</sub>.
Voltage gain is the change in collector voltage divided by the change in base voltage (from 100 to about 1000).
Current gain is the change in collector current divided by the change in base current of H<sub>fe</sub>.<br />
In the common-base linear amplifier circuit of <span style="color: red;">Figure 10</span>, the base is biased through
R<sub>b</sub> and AC-decoupled (or AC-grounded) through C<sub>b</sub>. The input signal is applied between the
emitter and base through C1, and the amplified but non-inverted output signal is taken from between the collector and
base. This amplifier offers very low input impedance, and output impedance equal to the resistor R<sub>l</sub>.
Voltage gain is from 100 to 1000, but current gain is near-unity.<br />
<br />
<img align="left" alt="C-C linear amplifier" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor2/2fig11.gif" height="181" width="251" /><img align="right" alt="Darlington DC emitter follower" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor2/2fig12.gif" height="204" width="252" />
In the common-collector linear amplifier circuit of <span style="color: red;">Fig. 11</span>, the collector is connected
directly to the positive voltage supply, placing it effectively at ground impedance level The input signal is applied
directly between the base and ground (collector), and the non-inverted output signal is taken between the emitter and
ground (collector).<br />
The input impedance of this amplifier is very high; it is equal to the product of h<sub>fe</sub> and the load
resistance R<sub>l</sub>. However, output impedance is very low. The circuit's overall voltage gain is near-unity,
and its output voltage is about 600 millivolts less than the input voltage. As a result, this circuit is know as
a <i>DC-voltage follower</i> or an <i>emitter follower</i>.
A circuit with very high input impedance can be obtained by replacing the single transistor of the amplifier of
<span style="color: red;">Fig. 11</span> with a pair of transistors connected in a <i>Darlington</i> configuration, as
shown in <span style="color: red;">Fig. 12</span>. Here, the emitter current of the input transistor feeds directly into
the base of the output transistor with an overall h<sub>fe</sub> value equal to the product of the values for the
individual BJT's.
<img align="left" alt="AC C-C amplifier" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor2/2fig13.gif" height="204" width="252" />
For example, if each BJT has an h<sub>fe</sub> of 100, the pair acts like single transistor with an h<sub>fe</sub> of
10,000. Darlington BJT's with two transistors on a single chip (considered to be discrete device) are readily
available for power amplification.<br />
The voltage-follower circuit of <span style="color: red;">Fig. 11</span> can be modified for an alternating current input
by biasing the transistor base with a value equal to half the supply voltage and feeding the input signal to the base.
<span style="color: red;">Figure 14</span> shows how this particular circuit is structured.<br />
The emitter-follower circuits of <span style="color: red;">Figs. 12</span> to 14 can <i>source</i> or feed relatively high
currents into an external load through the emitter of the transistor. However, those circuits cannot <i>sink</i> or
absorb high currents that are fed to the emitter from an external voltage source because the emitter is reverse-biased
under this condition. As a result, these circuits have only a <i>unilateral</i> output capability.<br />
In many applications, (such as audio amplifier output stages), a bilateral output characteristic is essential. A
bilateral amplifier has equal sink and source output capabilities. This is obtained with the <i>complementary</i>
emitter-follower circuit of <span style="color: red;">Fig. 14</span>. The series-connected NPN-PNP transistor pair is
biased to give a modest quiescent current through the network consisting of resistors R1 and R2 and diodes D1 and D2.
Transistor Q1 can provided large source currents, and Q2 can absorb large sink currents.<br />
<br />
<img alt="AC Emitter Follower" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor2/2fig14.gif" height="294" width="286" />
<img alt="Phase-splitter" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor2/2fig15.gif" height="294" width="286" />
<br />
<img alt="Long-tailed Pair Phase-splitter" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor2/2fig16.gif" height="293" width="557" /><br />
<span style="font-size: small;"><b><u>Phase Splitters:</u></b></span><br />
Transistor linear amplifiers can be used in active filters or oscillators by connecting suitable feedback networks
between their inputs and outputs. Phase splitting is another useful linear amplifier application. It provides a pair
of output signals from a single input signal: one is in phase with the input phase, and the other is inverted or
180° out of phase. <span style="color: red;">Fig. 16</span> and 17 show these alternative circuits.<br />
In the circuit shown in <span style="color: red;">Fig. 15</span>, the BJT is connected as a common-emitter amplifier with
nearly 100% negative feedback applied through emitter resistor R4. It has the same value as collector resistor R3.
This configuration provides a unity-gain inverted waveform at output 1 and a unity-gain non-inverted waveform at
output 2.<br />
The phase-splitter circuit shown in <span style="color: red;">Fig. 16</span> is known as a <i>long-tailed pair</i> because
the two BJT's share common-emitter feedback resistor R7. An increasing waveform applied at the base of transistor Q1
causes the voltage to increase across resistor R7, reducing the bias voltage on transistor Q2. This results in the
generation of an inverted waveform at the collector of Q1 (at output 1), and an in-phase waveform at the collector of
Q2, (at output 2).<br />
<br />
<img alt="Bistable Multivib." src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor2/2fig17.gif" height="294" width="286" />
<img alt="Monostable Multivib." src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor2/2fig18.gif" height="294" width="286" /><br />
<span style="font-size: small;"><b><u>Multivibrators:</u></b></span><br />
<span style="color: red;">Figures 17 to 20</span> show BJT's in the four different kinds of multivibrator circuit: <i>bistable,
astable, monostable, and Schmitt trigger</i>.<br />
The bistable multivibrator is a simple electronic circuit that has two stable states. It is more often known as the
<i>flip-flop</i>, but is also called a <i>binary multivibrator</i>, or an <i>Eccles-Jordan circuit</i>. The circuit
is switched from one state to the other by a pulse or other external signal. It maintains its state to the other by a
pulse or other external signal. It maintains its state indefinitely unless another input signal is received.<br />
<span style="color: red;">Figure 17</span> is a simple, manually-triggered, cross-coupled bistable multivibrator. The base
bias of each transistor is obtained from the collector of the other transistor. Thus one transistor automatically
turns <i>OFF</i> when the other turns <i>ON</i>, and this cycle can be continued in definitely as long as it is powered.<br />
The output of the multivibrator in <span style="color: red;">Fig. 17</span> can be driven low by turning off transistor Q2
with switch S2. The circuit remains "locked" or stable in this state until transistor Q1 is turned off with switch S1.
At that time, the output is locked into its high state, and the process is repeated. It can be seen that this action
makes it a simple digital memory circuit that holds its state until manually or electronically switched.<br />
<span style="color: red;">Figure 18</span> is the schematic for a <i>monostable multivibrator or one-shot</i> pulse
generator. It has only one state. The output of this circuit, a manually triggered version, is normally low, but it
switches high for a period determined by the values of capacitor C1 and resistor R2 if transistor Q1 is turned off
with switch S1. It then returns to tits original state.<br />
The pulse duration time of the monostable multivibrator can be determined from the equation: <b>T = 0.69 RC</b><br />
Where: T is in microseconds, R is in ohms, and C is in microfarads.<br />
Monostable multivibrators are used as pulse generators and weep generators for cathode-ray tubes.<br />
<img alt="Astable multivibrator." src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor2/2fig19.gif" height="294" width="286" />
<img alt="The Schmitt Trigger." src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor2/2fig20.gif" height="294" width="286" /><br />
<span style="color: red;">Figure 19</span> is the schematic for an <i>astable multivibrator</i> or free-running,
square-wave oscillator. The transistors are in a common-emitter configuration so that the output of one is fed
directly to the input of the other. Two resistance-capacitor networks, R3 and C1, and R2 and C2, determine the
oscillation frequency.<br />
The output of each transistor is 180° out of phase with the input. An oscillating pulse might begin at the base
of Q1. It is inverted at the collector of Q1 and is sent to the base of Q2. It is again inverted at the collector of
Q2 and therefore returns to the base of Q1 in its original phase. This produces positive feedback, resulting in
sustained oscillation.<br />
The astable multivibrator is frequently used as an audio oscillator, but is not usually used in radio-frequency circuits
because its output is rich in harmonics.<br />
<span style="color: red;">Figure 20</span> is a schematic for a <i>Schmitt Trigger</i>, a form of bistable multivibrator
circuit. It produces rectangular waves, regardless of the input waveform. The circuit is widely used to convert
sine waves to square waves where these is a requirement for a train of pulses with constant amplitude.<br />
The Schmitt trigger circuit remains off until the rising input waveform crosses the preset threshold trigger-voltage
level set by the value of resistors R1 and R2. When transistor Q1 is switched 'on', transistor Q2 is 'off' and, the
Schmitt trigger's output voltage rises abruptly.<br />
When the input signal falls back below its drop-out level, Q1 switches 'off' and Q2 switches 'on'. The output voltage
of the Schmitt trigger drops to zero almost instantly. This cycle of events will then be repeated in definitely, as
long as the input signal is applied.<br />
<br />
<a href="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/xtor3.html"><b></b></a></div>
<br />
<li style="text-align: justify;"> F<sub>T</sub> is the <i>gain-bandwidth product</i>, the frequency at which the common-emitter forward current
gain is unity.<br />
</li>
<li style="text-align: justify;"> V<sub>CBO</sub> is collect-base voltage (emitter open), the maximum voltage that can be impressed across collect
and emitter when the base is open.<br />
</li>
<li style="text-align: justify;"> V<sub>CEO</sub> is the collector-emitter voltage (base open), the maximum voltage that can be impressed across
collector and emitter when the base is open.<br />
<img align="right" alt="Static Equivalents" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor2/2fig4.gif" height="289" width="232" />
</li>
<li style="text-align: justify;"> I<sub>C(max)</sub> is the maximum <i>mean</i> current that should be allowed to flow through the collector
terminal of the BJT.<br />
</li>
<li style="text-align: justify;">h<sub>FE</sub> is the DC forward-current gain, the ratio of DC collector current to DC base current for a transistor
in a common-emitter configuration.<br />
<br />
The gain-bandwidth product, the frequency at which common emitter forward current gain is unity, applies in the
following way: if a transistor in a voltage feedback circuit has a voltage gain of X 100, its bandwidth will be one
hundredth of gain bandwidth value. However if the voltage gain is reduced to X 10, the bandwidth will increase to
that value divided by 10.<br />
<br />
<span style="font-size: small;"><b><u>Transistor Characteristics:</u></b></span><br />
A knowledge of the <i>static</i> and <i>dynamic</i> characteristics of BJT's will be useful in obtaining the optimum
performance from the device. <i>Static</i> characteristics are values obtained when the device is in a test circuit
and operated under DC conditions with the measurements made by an ohmmeter.<br />
<span style="color: red;">Figure 4-<i>a</i></span> shows the static equivalent circuit of an NPN BJT, and <span style="color: red;">Figure 3-<i>b</i></span>
shows the static equivalent of a PNP BJT. Each device can be considered as equivalent to a pair of reverse-biased
zener diodes in series between the collector and emitter terminals, with the base terminal connected to the common
point between to the two zeners.<br />
Examination of <span style="color: red;">Figs. 1-<i>a</i> and 2-<i>a</i></span> shows that each BJT is really two diodes:
the emitter and base form one PN diode with an emitter-base junction, and the base and collector form a second PN diode
with a base-collector junction. When these diodes are properly biased, they reach an avalanche or zener breakdown
point.<br />
In most small-signal BJT's, the base-to-emitter junction has a typical zener value of 5 to 10 volts, while the
base-to-collector junction has a typical zener value of 20 to 100 volts. Thus, if the base-to-emitter junction of the
BJT is forward biased, it exhibits the characteristics of a zener diode. The forward-biased junction in a silicon BJT
blocks virtually all current until the bias voltage rises to about 600 millivolts.<br />
<img align="left" alt="Typical Collector Characteristics" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor2/2fig5.gif" height="327" width="348" />
Beyond that value the current will increase rapidly. When forward biased by a fixed current, the forward voltage of
the junction has temperature coefficient of about -2 millivolts per degree C. When the transistor is configured as an
emitter open-circuited, the base-to-collector junction exhibits similar characteristics of those just
described--except for a greater zener value.<br />
If the transistor is configured with its base open-circuited, the collector-to-emitter path acts like a zener diode
in series with an ordinary diode.<br />
<br />
<span style="font-size: small;"><b><u>Dynamic Characteristics:</u></b></span><br />
The dynamic characteristics of a BJT can be better understood by examining the typical common-emitter <i>collector
characteristics</i> for a small-signal silicon NPN transistor shown in <span style="color: red;">Fig. 5</span>. Direct
current collector current I<sub>c</sub> is plotted on the <i>Y</i> axis, and DC collector-emitter voltage V<sub>ceo</sub>
is plotted along the <i>X</i> axis.<br />
<br />
<img align="left" alt="Clamping Diode Circuit" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor2/2fig6.gif" height="383" width="329" />
A family of curves for different values of DC base current I<sub>b</sub> is drawn of <span style="color: red;">Fig. 5</span>.
Base current is plotted because the BJT is a <i>current-operated</i> device. As mentioned earlier, the base-emitter
junction is forward biased for normal transistor operation. Base current flows and is a necessary variable for
establishing the BJT's operating point.<br />
<img align="right" alt="Zener Diode Function" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor2/2fig7.gif" height="207" width="194" />
Observe the following specific points on <span style="color: red;">Fig. 5</span>:<br />
</li>
<li style="text-align: justify;"> When base current (I<sub>b</sub> is zero, the transistor conducts barely measurable collector <i>leakage</i> current.<br />
</li>
<li style="text-align: justify;"><br /></li>
<br />
<h3 style="text-align: justify;">
<b> </b></h3>
</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
<h3>
<br />
Continue with Transistor Tutorial <a href="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/xtor3.html"><b>Part 3</b></a><b> </b></h3>
<h3>
<b><br /></b></h3>
<h3>
<b><br /></b></h3>
<h3 style="text-align: justify;">
<b><br /></b></h3>
<div style="text-align: justify;">
<span style="color: red; font-size: medium;"><i>"Learn about common-collector bipolar junction (BJT) transistor amplifiers
and apply this knowledge to the circuits that you design."</i></span><br />
<br />
<br />
<span style="font-size: x-small;">Rewritten by Tony van Roon (VA3AVR)</span><img align="right" alt="Basic NPN Composition" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/3xtor1.gif" height="542" width="265" /></div>
<hr style="margin-left: 0px; margin-right: 0px; text-align: left;" width="50%" />
<div style="text-align: justify;">
<br />
<br />
<span style="font-size: small;"><b><u>Common Collector Amplifier:</u></b></span><br />
BJT amplifiers are still widely used in modern electronic circuitry. This article focuses on practical variations of
the common-collector or emitter-follower amplifier based on discrete transistors and Darlington pairs. <span style="color: red;">Figure 1</span>
shows the basic common-collector amplifier and compares it with the common-base and common-emitter amplifiers. Table 1
sums up the performance characteristics of these three bipolar amplifiers.<br />
The fundamentals of bipolar transistors were presented in <b>Part 1</b> and the specifications of two widely available and
typical discrete devices, the NPN 2N3904 and the PNP 2N3906 were given. The 2N3904 is included in most of the
schematics in this article.<br />
The expression h<sub>fe</sub> in Table 1, known as a hybrid parameter, is the common-emitter DC forward-current gain.
It is equal to the collector current divided by the base current (h<sub>fe</sub> = I<sub>c</sub>/I<sub>b</sub>). The
value of this variable for the 2N3904 NPN transistor is typically between 100 and 300, but in this article it is
considered to 200.<br />
A lot of useful information can be gained simply by studying both Fig. 1 and Table 1. THe common-collector amplifier
(also widely know as the <i>emitter-follower</i> has its input applied between its base and collector and its output
is taken across its emitter and collector. The circuit is also referred to as the <i>grounded-collector</i> amplifier.
In practical configurations its load resistor is in series with its emitter terminal.<br />
The mathematical derivations of the results shown in Table 1 can be found in most basic texts. However, for the
purposes of this article, the important characteristics of the common-collector/emitter follower amplifier to keep in
mind are:</div>
<br />
<li style="text-align: justify;"> High input impedance
</li>
<br />
<div style="text-align: justify;">
Current gain approximately equal to h<sub>fe</sub><br />
<br />
By contrast, notice that while the common-emitter and common-base amplifiers provide high voltage gain, they offer only
low-to medium input impedance. The applications for these circuits are governed by these characteristics.<br />
<br />
<img align="left" alt="Common-Collector Digital Amplifier" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/3xtor2.gif" height="239" width="284" /><span style="font-size: small;"><b><u>Digital Amplifiers:</u></b></span><br />
<span style="color: red;">Figure 2</span> is the schematic for a simple NPN common-collector/emitter-follower digital
amplifier. The input signal for this circuit is a pulse that swings between zero volts and the positive supply
voltage. When the input of this circuit is at zero volts and the transistor is fully cut off, and the amplifier's
output is also zero volts--indication zero voltage phase shift.<br />
When an input voltage exceeding +600 millivolts (the minimum forward bias for turn-on) appears across the input
terminals, the transistor turns on and current I<sub><span style="font-size: x-small;">L</span></sub> flows in load resistor
R<sub><span style="font-size: x-small;">L</span></sub>, generating an output voltage across R<sub><span style="font-size: x-small;">L</span></sub>.
Inherent negative feedback causes the output voltage to assume a value that <i>follows</i> the input voltage.
<img align="right" alt="Effect of Cs Capacitor" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/3xtor3.gif" height="239" width="284" />
The input voltage is equal to the input voltage minus the voltage drop across the base-emitter junction
(=600 millivolt).<br />
<br />
In Fig. 2 schematic, the input (base) current is calculated as: <img align="middle" alt="" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/3xtorf1.gif" height="15" width="97" /><br />
<br />
Because the circuit can have a maximum voltage gain of one, it presents an input impedance calculated as:
<img align="middle" alt="" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/3xtorf2.gif" height="16" width="98" /><br />
Inserting the values shown in Fig. 2 yields:<img align="middle" alt="" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/3xtorf3.gif" height="15" width="263" /><br />
The circuit has an output impedance that approximately equals the value of the input signal source impedance (R<sub><span style="font-size: x-small;">S</span></sub>)
Because the circuit shown in Fig. 3 exhibits all of the common-collector amplifier characteristics previously discussed,
it behaves like a unity-gain <i>buffer</i> circuit. If high-frequency pulses are introduced
<img align="left" alt="Emitter-Follower relay driver" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/3xtor4.gif" height="239" width="284" />at its input, the
trailing edge of the output pulse will show the time constant decay curve shown in <span style="color: red;">Fig. 3</span>.
This response is caused by stray capacitance C<sub>S</sub> (representing with the circuit's load resistance.<br />
When the leading edge of the input pulse switches high, Q1 switches on and rapidly <i>sources</i> or feeds a charge
current to stray capacitance C<sub>S</sub>, thus producing and output pulse with a sharp leading edge. However, when
the trailing edge of the input goes low, Q1 switches off and effective capacitor C<sub>S</sub> is unable to discharge
or <i>sink</i> through the transistor.<br />
However, C<sub>S</sub> can discharge through lead resistor R<sub>L</sub>. That discharge will follow an exponential
decay curve with the time to discharge to the 37% level equal to the product of C<sub>L</sub> and R<sub>L</sub>.
<br />
<span style="font-size: small;"><b><u>Relay Drivers:</u></b></span><br />
The base digital or switching circuit of Fig. 2 can be put to work driving a wide variety of resistive loads such as
incandescent filament lamps, LED's, or resistors. If the circuit is to drive an inductive load such as a coil,
transformer, motor, or speaker, a diode much be included to limit an input-voltage surge that could destroy the
transistor when the switch is closed.<br />
The schematic in <span style="color: red;">Fig. 4</span> is a modification of Fig. 3 with the addition of diode D1 across
the load, in this case a relay coil, and switch S1 in the collector-base circuit. It can act in either the
<i>latching</i> or <i>non-latching</i> modes. The relay to be actuated either by the input pulse or switch S1.<br />
<img align="left" alt="Emitter-Follower relay driver" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/3xtor5.gif" height="239" width="284" />
Relay RY1's contacts close and are available for switching either when a pulse with an amplitude equal to the supply
voltage is introduced or S1 is closed. The relay contacts open when the input pulse falls to zero or S1 is opened.<br />
Protective diode D1 damps relay RY1's switch-off voltage surge from swinging below the zero volt supply level.
Optional diode D2 can also be included to prevent this voltage from rising about the positive power supply value. The
addition of normally open relay 2 (RY2) makes the circuit self-latching.<br />
<span style="color: red;">Figure 5</span> shows a same relay driver circuit organized for an PNP transistor, a 2N3906 BJT.
Again, the relay can be turned on either by closing S1 or by applying the input pulse as shown.<br />
Both the circuit in Figs. 4 and 5 increase the relay's sensitivity by a factor of about 200 (H<sub>fe</sub> value of
<img align="right" alt="Emitter-Follower relay driver" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/3xtor6.gif" height="239" width="284" />
Q1). Consider a relay requires an activating current of 100 mA and has a coil resistance of 120 ohms. The effective
input impedance of the circuit (Z<sub>in</sub>) will be: <img alt="" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/3xtorf4.gif" height="15" width="114" />
120 x 200 = 24,000 ohms. Only an input operating
current of <span style="font-size: x-small;">1/200</span> of 100 milliamperes or 0.5 milliamperes is required.<br />
Circuit sensitivity can be further increased by replacing transistor Q1 with the Darlington pair of Q1 and Q2, as
shown in <span style="color: red;">Fig. 6</span>. This circuit represents an input impedance of about 1 megohm and
requires an input operating current of about 12 microamperes (uA). Capacitor C1 protects the circuit from false
triggering by high-impedance transient voltages, such as those induced by lightning or electromagnetic interference.<br />
The benefits of the Darlingron pair are readily apparent in relay-driving circuits that require time delay, such as
those shown in <span style="color: red;">Figs. 7 and 8</span>. In those circuits, the voltage divider formed by resistor
R1 and capacitor C1 generates an waveform that rises or falls exponentially.<br />
That waveform is fed to the relay coil through the high-impedance Q1-Q2 voltage-following Darlington buffer. The
circuit forces the relay to change state at some specified delay time after the supply voltage is applied. With the
120K resistor R1 shown in both Figs. 7 and 8, operating delays will be about 0.1 second per microfarad of capacitor
value. For example, if C1 equals 100 microfarads (µF), the time delay will be 10 seconds.<br />
<br />
<img alt="Delayed Switch-on relay driver" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/3xtor7.gif" height="238" width="283" />
<img alt="Automatic Turn-off time-delay" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/3xtor8.gif" height="237" width="255" /><br />
In the <span style="color: red;">Fig. 7</span> circuit, consider that C1 is fully discharged so that the R1-C1 junction is
at zero volts and relay RY1 is off (contacts open) when the power supply is connected. Capacitor C1 then charges
exponentially through R1, and the increasing voltage is fed to the relay circuit through Darlington pair Q1 and Q2.
That causes relay RY1's contacts to close after a time delay determined by the product of R1 and C1.<br />
Consider that capacitor C1 in the <span style="color: red;">Fig. 8</span> circuit is also fully discharged when the power
supply is connected. The junction of R1 and C1 is initially at the supply voltage, and the relay contact close at
that moment. Capacitor C1 then charges exponentially through R1, and the decaying voltage at the R1-C1 junction
appears across the coil of relay RY1. The contacts of RY1 open after the delay determined by R1 and C1 times out.<br />
<br />
<img alt="Constant-Current generator" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/3xtor9.gif" height="252" width="251" />
<img alt="Ground-Referenced variable version" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/3xtor10.gif" height="297" width="233" /><br />
<span style="font-size: small;"><b><u>Constant-Current Generators:</u></b></span><br />
A BJT can serve as a constant-current generator if it is connected in the common-collector topology and the power
supply and collector terminals function as a constant-current path, as shown in <span style="color: red;">Fig. 9</span>.
The 1000-ohm resistor R2 is the emitter load. The series combination of resistor R1 and zener diode D1 applies a
fixed 5.6-volt reference to the base of Q1.<br />
The is a 600-millivolt (0.6V) base-to-emitter drop across Q1, so 5 volts is developed across emitter resistor R2.
As a result, a fixed current of 5 milliamperes flows through this resistor from Q1's emitter.<br />
Because of a BJT's characteristics, emitter and collector currents are nearly identical. This means that a
5-milliampere current also flows in any load that is connected between Q1's collector and the circuit's positive
supply. This will occur regardless of the load's resistance value--provided that the value is not so large that it
drives Q1 in saturation. Therefore, these two points are constant-current source terminals.<br />
Based on the previous discussion, it can be seen that constant-current magnitude is determined by the values of the
base reference voltage and emitter load resistor R2. Consequently, the value of the current can be changed by varying
either of these parameters.<br />
<br />
<img alt="Precision Constant-Current generator" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/3xtor11.gif" height="264" width="211" />
<img alt="Thermally Stabilized with Led reference" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/3xtor12.gif" height="284" width="212" />
<img alt="Simple Emitter-Follower" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/3xtor13.gif" height="264" width="236" />
<br />
The <span style="color: red;">Fig. 10</span> circuit takes this concept a step further. It can be seen, for example, that
the circuit of Fig. 9 was <i>inverted</i> to give a ground-referenced, constant-current output. Adjustment of trimmer
potentiometer R3 provides a current range of from 1 to about 10 milliamperes.<br />
The most important feature of the constant-current circuit is its high dynamic output impedance--typically hundreds of
kilo-ohms. The precise magnitude of constant current is usually unimportant in practical circuits. The circuits
shown in <span style="color: red;">Fig. 10 and 11</span> will work satisfactorily in many practical applications.<br />
If more precise current generation is required, the characteristics of the reference voltage of these circuits can be
improved to eliminate the effects of power source variations and temperature changes.<br />
A simple way to improve the circuits in Figs. 9 and 10 is shown in <span style="color: red;">Fig. 11</span>. Resistor R1
in both circuits can be replaced with a 5-milliampere constant current generator. (The symbol for a constant-current
generator is a pair of overlapping circles.) With a constant-current generator installed, the current through zener
diode D1 and the voltage across it is independent of variations in the supply voltage.<br />
True high precision can be obtained if the industry standard reference zener diode D1 is replaced with one having a
temperature coefficient of 2 millivolts/°C to match th base-to-emitter temperature coefficient of transistor Q1.
However, if a zener diode with those characteristics cannot be located, satisfactory results can be obtained by
substituting a forward-biased light-emitting diode, as shown in <span style="color: red;">Fig. 12</span>.<br />
The voltage drop across LED1 is about 2 volts, so only about 1.4 volts appears across emitter resistor R1. If the
value of R1 is reduced from 1000 to 270 ohms, the constant-current output level can be maintained at 5 milliamperes.<br />
<br />
<img align="left" alt="High Stability emitter-follower" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/3xtor14.gif" height="253" width="257" /><span style="font-size: small;"><b><u>Analog Amplifiers:</u></b></span><br />
The common-collector/emitter-follower amplifier can amplify AC-couple analog signals linearly if the transistor's base
is biased to a quiescent value of about half the supply voltage. This permits maximum signal swings without distortion
due to clipping. As shown in <span style="color: red;">Figs. 13 and 14</span>, the analog signals are AC-coupled to the
base with capacitor C1, and the output signal is taken from the emitter through capacitor C2.<br />
<span style="color: red;">Figure 13</span> shows the simplest analog common-collector/emitter-follower circuit. Transistor
Q1 is biased by resistor R1 connected between the voltage source and the base. The value of resistor R1 must be equal
to the input resistance R<sub>in</sub> of the emitter-follower stage to obtain half-supply biasing. Input resistance
R<sub>in</sub> (and thus the nominal R1 value) equals the 4.7K value of R2 multiplied by the h<sub>FE</sub> value of
the Q1 transistor.<br />
In this circuit: <img align="middle" alt="" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/3xtorf5.gif" height="12" width="191" /><br />
A slightly more elaborate biasing method is shown in <span style="color: red;">Fig. 14</span>. However, its biasing level
is independent of variations in transistor Q1's h<sub>FE</sub> value. Resistors R1 and R2 function as a voltage
divider that applies a quiescent half-supply voltage to Q1's base. Ideally, the value of R1 should equal the value of
R2 in parallel with R<sub>in</sub>. However, the circuit works quite well if resistor R1 has a low value with respect
to R<sub>in</sub>, and resistor R2 is slightly larger than R1.<br />
In the circuits shown in <span style="color: red;">Figs. 13 and 14</span>, the input impedance looking directly into the
base of transistor Q1 equals h<sub>FE</sub> x Z<sub>load</sub>, where Z<sub>load</sub> is equal to the combined
parallel impedance of R2 and any external load Z<sub>x</sub> that is connected to the output.<br />
In these circuits, the base impedance value is about 1 megohm when Z<sub>x</sub> is infinite. In practical circuits,
the input impedance of the base and the bias network. The circuit shown in Fig.13 has an input impedance of about 500
kilohm, and the circuit shown in <span style="color: red;">Fig. 14</span> has an input impedance of about 50 kilohm.<br />
Both the Fig. 13 and 14 circuits offer a voltage gain that is slightly less than unity; the true gain is given by:
<img align="middle" alt="" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/3xtorf6.gif" height="14" width="155" /><br />
Where Z<sub>b</sub> = 25/I<sub>E</sub> ohms and I<sub>E</sub> is the emitter current in milliamperes. With an
operating current of 1 milliampere, these circuits provide voltage gains of 0.995 when the Z<sub>load</sub> = 4.7
kilohm, or 0.975 when the load is 1.0 kilohm. The significance of these gain figures will be discussed shortly.<br />
<br />
<img alt="Bootstrapped Emitter-Follower" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/3xtor15.gif" height="253" width="246" />
<img alt="Bootstrapped Darlington emitter-follower" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/3xtor16.gif" height="267" width="259" />
<br />
<span style="font-size: small;"><b><u>Bootstrapping:</u></b></span><br />
The relatively low input impedance of the circuit in <span style="color: red;">Fig. 14</span> circuit can be increased
significantly by <i>bootstrapping</i> as illustrated in <span style="color: red;">Fig. 15</span>. The 47-kilohm resistor
R3 is located between the R1-R2 junction and the base of transistor Q1, and the input signal is fed to Q1's base
through capacitor C1.<br />
Notice, however, that Q1's output signal is fed back to the R1-R2 junction through C2, so that almost identical signal
voltages appear at both ends of R3. Consequently, very little signal current flows in R3. The input signal "sees"
far greater impedance that the true resistance value.<br />
To make this point clearer, consider that the emitter-follower circuit in <span style="color: red;">Fig. 15</span> has a
precise voltage gain of unity. In this condition, identical signal voltages would appear at the two ends of R3, so
no signal current would flow in this resistor, making it "appear" equal to R<sub>in</sub>, or 1 megohm.<br />
Practical emitter-follower circuits provide a voltage gain that is slightly less than unity. The precise gain that
determines the resistor <i>amplification factor</i>, or A<sub>R</sub> of the circuit is:
A<sub>R</sub> = 1/(1 - A<sub>V</sub>).<br />
For example, if circuit gain is 0.995 (as in Fig. 13), then A<sub>R</sub> is 200 and the R3 impedance is almost 10
megohms. By contrast, if A<sub>V</sub> = 0.975, A<sub>R</sub> is only 40 and the R3 impedance is almost 2 megohms.
This impedance is effectively in parallel with R<sub>in</sub> so, in the first example, the complete
<span style="color: red;">Fig. 15</span> circuit exhibits an input impedance of about 900 kilohm.<br />
<br />
The input impedance of the circuit in <span style="color: red;">Fig. 16</span> circuit can be further increased by
substituting a 520 Darlington pair for Q1 and increasing the value of R3, as shown in <span style="color: red;">Fig. 17</span>.
<img align="left" alt="Bootstrapped complementary feedback pair" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/3xtor17.gif" height="267" width="259" />
This modification gives a measured input impedance of about 3.3 megohms.<br />
<br />
Alternatively, even greater input impedance can be obtained with a bootstrapped <i>"complementary-feedback pair"</i>
circuit as shown in <span style="color: red;">Fig. 18</span>; it offers an input impedance of about 10 megohms.<br />
In this instance, Q1 and Q2 are both connected as common-emitter amplifiers but they operate with nearly 100% negative
feedback.<br />
As a result, they provide an overall voltage gain that is almost exactly one. This transistor pair behaves like a
near-perfect Darlington emitter-follower.<br />
<br />
<span style="font-size: small;"><b><u>Emitter-followers:</u></b></span><br />
Recall from the previous articles on bipolar transistors, a standard NPN emitter-follower can <i>source</i> current
but cannot <i>sink</i>. By contrast, an PNP emitter-follower can <i>sink</i> current but cannot <i>source</i> it.
This means that these circuits can only handle unidirectional output currents.<br />
<br />
A <i>bidirectional</i> emitter-follower (that can source or sink currents with equal ease) has many applications.
This response can be obtained with a complementary emitter-follower topology--NPN and PNP emitter followers are
effectively connected in series. <span style="color: red;">Figures 18 to 20</span> illustrate some basic bidirectional
emitter-follower circuits.<br />
<img alt="Complementary emitter-follower enhancements" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/3xtor18.gif" height="342" width="251" />
<img alt="With single supply and AC-coupled load" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/3xtor19.gif" height="344" width="251" />
<br />
The circuit in <span style="color: red;">Fig. 18</span> circuit has a dual or "split" power supply, and its output is
direct-coupled to a grounded load. The series connected NPN and PNP transistors are biased at a quiescent "zero
volts" value through the voltage divider formed with resistors R1 and R2 and diodes D1 and D2. Each transistor is
forward biased slightly with silicon diodes D1 and D2. Those diodes have characteristics that are similar to those
of the transistor base-emitter junctions.<br />
<img align="right" alt="Darlington emitter-follower with amplified diode" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor3/3xtor20.gif" height="400" width="279" /><br />
Capacitor C2 assures that identical input signals are applied to each transistor base, and emitter resistors R3 and
R4 protect the transistor against excessive output currents.<br />
<br />
Transistor Q1 in <span style="color: red;">Fig. 18</span> sources current into the load when the input goes positive, and
transistor Q2 sinks load current when the input goes negative. Notice that input capacitor C1 is non-polarized.<br />
<span style="color: red;">Figure 19</span> shows an alternative to the circuit of Fig. 18 designed for operation from a
single-ended power supply and an AC-coupled output load. In this circuit, input capacitor C1 is polarized.<br />
<br />
Notice that output transistors Q1 and Q2 in Figs. 18 and 19 are slightly forward biased by silicon diodes D1 and D2 to
eliminate crossover distortion problems. One diode is provided for each transistor.<br />
<br />
If these circuits are modified by substituting Darlington pairs, four biasing diodes will be required. In those
variations, a single transistor "amplifier diode" stage replaces the four diodes, as shown in <span style="color: red;">Fig. 20</span>.<br />
The collector-to-emitter voltage of Q5 in Fig. 20 equals the base-to-emitter voltage drop across Q5 (about 600
millivolts, more or less) multiplied by (R3 + R4)/R4. Thus, if trimmer potentiometer R3 is set to zero ohms, about
600 millivolts are developed across Q5, which then behaves as a silicon diode. However, if R3 is set to its maximum
value of 47 kilohm, about 3.6 volts is developed across Q5, which then behaves like six series connected silicon
diodes. Trimmer R3 can set the voltage drop across Q5 precisely as well as adjust the quiescent current values of the
Q2-Q3 stage.</div>
<br />
<h3>
Continue with Transistor Tutorial
<a href="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor4/xtor4.html"><b>Part 4: "Power Amplifiers"</b></a></h3>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<div style="text-align: justify;">
<span style="color: red; font-size: medium;"><i>"Learn about audio power amplifiers and apply this knowledge to your circuits
designs and experiments."</i></span><br />
<br />
<br />
<br />
<img align="left" alt="Class A power amplifier" border="0" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor4/4xtor1.gif" height="546" width="304" /><br />
<br />
<br />
An audio power amplifier can boost weak signals from a tuner, CD player, or tape deck to fill a room with sound. This
article focuses on the operating principles and circuitry of low-frequency power amplifiers based on the bipolar junction
transistor (BJT). Other articles in this series have discussed multivibrators, oscillators, audio preamplifiers, and
tone-control circuits, all based on the BJT.<br />
<br />
<span style="font-size: small;"><b><u>Power Amplifier Basics:</u></b></span><br />
A transistorized audio power amplifier converts the medium-level, medium-impedance AC signal into a high-level,
amplified signal that can drive a low-impedance audio transducer such as a speaker. A properly designed power
amplifier will do this with minimal signal distortion.<br />
Audio can be amplified with one or more power transistors in either of three configurations: Class A, Class B, and
Class AB. <span style="color: red;">Figure 1-<i>a</i></span> shows a single BJT Class A amplifier in a common-emitter
configuration with a speaker as its collector load. A Class A amplifier can be identified by the way its input base
is biased.<br />
<span style="color: red;">Fig. 1-<i>a</i></span> shows that BJT Q1's collector current has a <i>quiescent</i> value that
is about halfway between the zero bias and cutoff positions. (The quiescent value is that value of transistor bias
at which the negative- and positive-going AC input signals are zero.) This bias permits the positive and negative
swings of the output collector AC current to reach their highest values without distortion. If the AC and DC
impedances of the speaker load are equal, the collector voltage will assume a quiescent value that is about half the
supply voltage.<br />
<br />
<img align="left" alt="Class-B power amplifier" border="0" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor4/4xtor2.gif" height="455" width="287" />
The Class A circuit amplifies audio output with minimum distortion, but transistor Q1 consumes current
continuously--even in the quiescent state--giving it low efficiency. Amplifier <i>efficiency</i> is defined as the
ratio of AC power input to the load divided by the DC power consumed by the circuit.<br />
At maximum output power, the efficiency of a typical Class A amplifier is only 40%, about 10% less than its
theoretical 50% maximum. However, its efficiency falls to about 4% at one-tenth of its maximum output power level.<br />
A typical Class B amplifier is shown in <span style="color: red;">Fig. 2-<i>a</i></span>. It has a pair of BJTs, Q1 and
Q2, operating 180° out-of-phase driving a common output load, in this example another speaker. In this topology,
the BJTs operated as common-emitter amplifiers drive the speaker through push-pull transformer T2. A phase-splitting
transformer T1, provides the input drives for Q1 and Q2 180° out-of-phase.<br />
The outstanding characteristic of any Class B amplifier is that both transistors are biased off under quiescent
conditions because they are operated without base bias. As a result, the amplifier draws almost no quiescent current.
This gives it an efficiency that approaches 79% under all operating conditions. In <span style="color: red;">Fig. 2-<i>b</i></span>,
neither Q1 nor Q2 conducts until the input drive signal exceeds the base emitter zero-crossing voltage of the
transistor. This occurs at about 600 millivolts for a typical power transistor.<br />
The major disadvantage of the Class B amplifier is that its output signal is seriously distorted. THis can be seen
from its dynamic transfer curve, also shown in Fig. 2-b.<br />
<img align="right" alt="Class-AB power amplifier" border="0" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor4/4xtor3.gif" height="451" width="302" /><br />
<span style="font-size: small;"><b><u>Class AB Fundamentals:</u></b></span><br />
Audio distortion caused by the crossover between two out-of-phase transistors is annoying. To overcome this defect,
the Class B amplifier is modified into the third category called Class AB for most high-fidelity audio equipment.
Fortunately, Class B distortion can usually be eliminated by slight forward bias to the base of each transistor, as
shown in <span style="color: red;">Fig. 3-<i>a</i></span>. This modification sharply reduces the quiescent current of a
Class B amplifier and converts it into a Class AB amplifier.<br />
Many early transistorized power amplifiers were Class AB, as shown in Fig. 3-<i>a</i>, but that circuit is rarely seen
today. That circuit requires one transformer for input phase-splitting and another for driving the speaker, both
costly electronics components.<br />
In addition, electrical characteristics of both Q1 and Q2 must be closely matched. The amplification of each
transistor will be unequal if they are not, and it will be impossible to minimize output distortion.
<span style="color: red;">Figure 3<i>a</i></span> shows a dynamic transfer characteristic for a Class AB power amplifier.<br />
The Class AB amplifier shown in <span style="color: red;">Fig. 4</span> avoids both transformers and the need to match
transistors. A complementary pair of transistors (Q1 and NPN and Q2 a PNP) is connected as an emitter follower.
Powered by a split (dual) supply, the circuit's two emitter followers are biased through R1 and R2 so that their
outputs are at zero volts; no current flows in the speaker under quiescent conditions.<br />
<br />
<img align="left" alt="Class AB with emitter-follower" border="0" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor4/4xtor4.gif" height="335" width="292" />
Nevertheless, a slight forward bias can be applied with trimmer potentiometer R3 so that Q1 and Q2 pass modest
quiescent currents to prevent crossover distortion. Identical input signals are applied through C1 and C2 to the base
of the emitter followers, which avoid a split-phase drive.<br />
When an input signal is applied to the Fig. 4 circuit, the positive swing drives PNP Q2 off while driving NPN Q1 on.
Transistor Q1 acts as current source with a very low output (emitter) impedance if feeds a faithful unity-gain copy
of the input voltage signal to the speaker. The transistor characteristics have little or no effect on this response.<br />
Similarly, negative swings of the input signal drive Q1 off and Q2 on. Because Q2 is a PNP BJT, it becomes a current
sink with minimal input (emitter) impedance. It also produces a faithful unity-gain copy of the voltage signal to
the speaker, again with Q2's characteristics having little or no effect on the circuit's response.<br />
As a result, the Fig. 4 circuit does not require that Q1 be matched to Q2, and neither input nor output transformers
are required.
<img align="right" alt="Alternative Class AB" border="0" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor4/4xtor5.gif" height="588" width="292" />
Modification of this circuit, as shown in <span style="color: red;">Figs. 5-<i>a</i></span> and <i>b</i>, work from
single ended power supplies. In Fig. 5-<i>a</i>, one side of the speaker is connected to the amplifier through
high-value blocking capacitor C3 and, and the other end is connected to ground; in <span style="color: red;">Fig. 5-<i>b</i></span>,
one side is connected to C3 and the other side is connected to the positive supply. All three circuits are popular in
modern high-fidelity audio power amplifiers based on integrated circuitry.<br />
<br />
<span style="font-size: small;"><b><u>Class AB Variations:</u></b></span><br />
The circuit in <span style="color: red;">Figs. 4-<i>a</i></span> is a unity-voltage gain amplifier so one obvious improvement
is to add a voltage-amplifying driver stage, as shown in <span style="color: red;">Figs. 6</span>. Transistor Q1,
configured as a common-emitter amplifier, drives two emitter followers, Q2 and Q3, through its collector load resistor R1.<br />
Note that Q1's base bias is derived from the circuit's output through resistors R2 and R3. This configuration
provides DC feedback to stabilize the circuit's operating points and AC feedback to minimize signal distortion.<br />
The Fig. 6 circuit illustrates how a form of auto-bias can be applied to Q2 and Q3 through the silicon diodes D1 and
D2. If the simple voltage-divider biasing method in Fig. 4 is used in the Fig. 6 circuit, its quiescent current will
increase as ambient temperature rises and decrease as it fall. (This is caused by the thermal characteristics of a
transistor's base-emitter junction.)<br />
The biasing in Fig. 6 is derived from the forward voltage drop of series diodes D1 and D2 whose thermal characteristics
are closely matched to those of the base-emitter junctions of Q2 and Q3. Consequently, this circuit offers excellent
thermal compensation.<br />
Practical amplifiers include a pre-set trimmer potentiometer in series with D1 and D2. This component makes it
possible to adjust biased voltage over a limited range. Low-value resistors R4 and R5 in series with the emitters of
Q2 and Q3 provide some negative DC feedback.<br />
<img align="left" alt="Power Amplifier with driver and auto-bias" border="0" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor4/4xtor6.gif" height="355" width="252" />
The impedance of the Fig. 4 circuit equals the product of the speaker load impedance and the current gain of either Q1
or Q2. The circuit can be improved by replacing transistors Q1 and Q2 with Darlingron pairs which will significantly
increase the circuit's input impedance and increase the amplifier's collector load capacity.<br />
<span style="color: red;">Figures 7 to 9</span> show three different ways of modifying the Fig. 6 circuit by replacing
individual transistors with Darlington pairs. For example, in Fig. 7, transistors Q2 and Q3 form a Darlingron NPN
pair, and Q4 and Q5 form a darlington PNP pair. There are four base-emitter junctions between the bases of Q2 and Q4,
and the output circuit is biased with a string of four silicon diodes, D1 and D4, in series to compensate for the
Darlingron pairs.<br />
<span style="color: red;">Figure 8</span>, Q2 and Q3 are a Darlington NPN pair, but Q4 and Q5 are a complementary pair of
common-emitter amplifiers. They operate with 100% negative feedback, and provide unity-voltage gain and very high
input impedance. This<i>quasi-complementary</i> output stage is probably the most popular Class AB power amplifier
topology today. Notice the three silicon biasing diodes, D1, D2, and D3.<br />
Finally, in <span style="color: red;">Figure 9</span>, both pairs Q2 and Q3 and Q4 and Q5 are complementary pair of
unity-gain, common-emitter amplifiers with 100% negative feedback. Because the pairs produce outputs that are mirror
images of each other, the circuit has a complementary output stage. Notice that this circuit has only two silicon
biasing diodes, D1 and D2.<br />
<br />
<span style="font-size: small;"><b><u>Amplified Diodes:</u></b></span><br />
The circuits in <span style="color: red;">Figs. 6 to 9</span> include strings of two to four silicon biasing diodes.
Each of those strings can be replaced by single transistor and two resistors configured as an <i>amplified diode</i>,
as shown in <span style="color: red;">Figs. 10</span>.<br />
The output voltage of the circuit, V<span style="font-size: x-small;"><sub>out</sub></span> can be calculated from the formula:
V<span style="font-size: x-small;"><sub>out</sub></span> = V<span style="font-size: x-small;"><sub>BE</sub></span> x R1 + R2/R2<br />
If resistor R1 is replaced by a short circuit, the circuit's output will be equal to the base-emitter junction "diode"
voltage of Q1 (V<span style="font-size: x-small;"><sub>BE</sub></span>). The circuit will then have the thermal characteristics of a
discrete diode.<br />
<img alt="Power Amplifier with Darlington Stages" border="0" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor4/4xtor7.gif" height="355" width="266" />
<img alt="Power Amplifier with partial stages" border="0" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor4/4xtor8.gif" height="356" width="265" />
<br />
If resistor R1 equals R2, the circuit will act like two series-connected diodes, and if R1 equals three times R2, the
circuit will act like four series-connected diodes, and so on. Therefore, the circuit in Figs. 10 can be made to
simulate any desired whole or fractional number of series-connected diodes, depending on how the R1/R2 ratios are
adjusted.<br />
<span style="color: red;">Figure 11</span> shows how the circuit in Fig. 10 can be modified to act as a fully adjustable
"amplifier diode", with an output variable from 1 to 5.7 times the base-emitter junction voltage
(V<span style="font-size: x-small;"><sub>BE</sub></span>)<br />
<br />
<img alt="Fixed Gain Amplified diode circuit" border="0" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor4/4xtor10.gif" height="212" width="205" />
<img alt="Adjustable Amplified diode circuit" border="0" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor4/4xtor11.gif" height="215" width="233" />
<br />
<span style="font-size: small;"><b><u>Bootstrapping:</u></b></span><br />
The main purpose of the Q1 driver stage in <span style="color: red;">Fig. 6</span>, the base complementary amplifier, is
to give the amplifier significant voltage gain. At any given value of Q1 collector current, this voltage gain is
directly proportional to the effective Q1 collector load value. It follows that the value of resistor R1 should be
as large as possible to maximize voltage gain. However, there are several reasons why this does not work.<br />
First, the <i>effective</i> or AC value of R1 equals the actual R1 value shunted by the input impedance of the Q2-Q3
power amplifier stage. Therefore, if R1 has a higher value, the power amplifier input impedance must be even greater.
That can usually be done by replacing Q2 and Q3 with high-gain transistor pairs, as was done in Figs. 7 to 9.<br />
<img align="left" alt="Power Amplifier with bootstrap" border="0" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor4/4xtor12.gif" height="364" width="288" />
The second reason is that Q1 in Fig. 6 must be biased so that its collector assumes a quiescent half-supply voltage
value to provide maximum output signal swings; this condition is set by the Q1's collector current and resistor R1's
value.<br />
The true value of R1 is predetermined by biasing requirements. To achieve high voltage gain, a way must be found to
make the AC impedance of R1 much greater than its DC value. This is accomplished with he <i>bootstrapping</i> technique
shown in Figs. 12 & 13.<br />
In <span style="color: red;">Fig. 12</span>, Q1's collector load consists of R1 and R2 in series. The circuit's output
signal, which also appears across SPKR1, is fed back to the R1-R2 junction through C2. This output signal is a near
unity-voltage-gain copy of the signal appearing on Q1's collector.<br />
If resistor R1 has a value of 1 kilohm, the Q2-Q3 stage provides a voltage gain of 0.9. As a result, an undefined
signal voltage appears at the low end of resistor R2, and 0.9 times that undefined voltage appears at the top of R2.
In other words, only one-tenth of the unknown signal voltage is developed across R2. Therefore, it passes one-tenth
of the signal current that would be expected from a 1-kilohm resistor.<br />
This means that the AC signal impedance value of R2 is ten times greater (10-kilohms) than its DC value, and the signal
voltage gain is increased correspondingly. In practical circuits, "bootstrapping" permits the effective voltage gain
and collector load impedance of Q1 to be increased by the factor of about twenty.<br />
<span style="color: red;">Fig. 13</span> is the schematic for an alternative version of Fig. 12 without one resistor and
one capacitor. In this circuit. SPKR1 is part of Q1's collector load, and it is bootstrapped through capacitor C2.<br />
As an alternative to bootstrapping, the load resistor can be replaced with a simple transistor constant-current
generator. This design is found in many integrated circuit audio power amplifiers.<br />
<br />
<img align="left" alt="Alternate power amp with bootstrap" border="0" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor4/4xtor13.gif" height="335" width="285" /><span style="font-size: small;"><b><u>Alternative Drivers:</u></b></span><br />
Returning once again to Fig. 6, notice that parallel DC and AC voltage form the R1-R2 divider network is fed back to
the Q1 driver stage. This is a simple and stable circuit, but its gain and input impedance are low. Moreover, it
will work only over a limited power supply voltage range.<br />
<img align="right" alt="Driver stage with decoupled paralled DC feedback" border="0" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor4/4xtor14.gif" height="239" width="272" /><span style="color: red;">Figure 14</span> is a variation of the Fig. 6 circuit intended to function as a driver stage.
Current feedback through
resistors R1 and R2 allows the circuit to work over a wide supply voltage range. The feedback resistors can be AC
decoupled (as shown) through C2 to increase the gain and input impedance, but at the expense of increased signal
distortion. Transistor Q1 can be replaced with a Darlington pair if very high input impedance is desired.<br />
<img align="left" alt="Driver stage with series DC feedback." border="0" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor4/4xtor15.gif" height="220" width="322" /><br />
Another alternative driver stage, <span style="color: red;">Fig. 15</span>, depends on series DC and AC feedback to give it
more gain and higher input impedance than can be obtained from the Fig. 6 circuit. In this circuit, PNP transistor
Q1 is directly coupled to NPN transistor Q2.<br />
Finally, <span style="color: red;">Fig. 16</span> is the schematic for a driver circuit specifically intended for use in
amplifiers with dual or split power supplies that have direct-coupled input and output stages referenced to ground.
The input stage of this driver stage is a long-tailed pair. Both the input and output will be centered on DC ground
if the values of resistors R1 and R4 are equal. This circuit is found in many integrated circuit power amplifiers.<br />
<img align="right" alt="Driver stage with a long-tailed pair output" border="0" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor4/4xtor16.gif" height="282" width="290" /><span style="font-size: small;"><b><u>An IC power amplifier:</u></b></span><br />
Improvements in the power-handling capabilities of monolithic integrated circuits have permitted power amplifier to be
integrated on a single silicon substrate or chip. The techniques for designing integrated circuit power amplifiers
are similar to those for discrete device circuits. It turns out that the similarities between discrete and IC power
amplifier designs are closer than for most other linear circuits.<br />
<span style="color: red;">Figure 17</span> is a simplified circuit diagram for the LM380, an IC power amplifier, drawn in
the manufacturer's data book style. The LM380 was developed by National Semiconductor Corporation for consumer
applications. It features an internally fixed gain of 50 (34 dB) and an output that automatically centers itself at
one-half of the supply voltage.<br />
An unusual input stage permits inputs to be referenced to the ground or AC coupled, as required. The output stage of
the LM380 is protected with both short-circuit current limiting and thermal-shutdown circuitry.<br />
The LM380 has two input terminals. Both Q1 and Q2 are connected as PNP emitter followers that drive the Q3 and Q4
differential amplifier transistor pairs. The PNP inputs reference the input to gro8und, thus permitting direct
coupling of the input transducer.<br />
<br />
<img alt="LM380 Internal Schematic Diagram" border="0" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor4/4xtor17.gif" height="292" width="431" /><br />
The output is biased to half the supply voltage by resistor ratio R1/R2 (resistor R1 is formed by two 25-kilohm
resistors and R2 has a value of 25-kilohms). Negative DC feedback, through resistor R2, balances the differential
stage with the output at half supply, because R1 = R2.<br />
The output of the differential amplifier stage is direct coupled into the base of Q12, which is a common-emitter,
voltage-gain amplifier with a constant current-source load provide by Q11. Internal compensation is provided by the
pole-splitting capacitor C'. Pole-splitting compensation permits wide power bandwidth (100 KHz at 2 watts, 8 ohms).<br />
The collector signal of Q12 is fed to output pin 8 of the IC through the combination of emitter-coupled Q7 and the
quasi-complementary pair emitter followers Q8 and Q9. The short-circuit current is typical 1.3 amperes.</div>
<br />
<h3>
Continue with Transistor Tutorial
<a href="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor5/xtor5.html"><b>Part 5: "Audio Amplifiers"</b></a></h3>
<h3>
<b> </b></h3>
<h3>
<b> </b></h3>
<div style="text-align: justify;">
<span style="color: red; font-size: medium;"><i>"Learn about the audio amplifiers in stereos, tuners, tape/cassette, and CD
players, and apply your knowledge to experiments or designs."</i></span><br />
Transistors are the key components in many different kinds of audio preamplifiers, amplifiers, and tone-control
circuits. Recent articles in this series have discussed the operation principles and applications for discrete
bipolar junction transistors (BJT). Earlier articles have covered such subjects as low-power amplifier circuits,
multivibrators, and oscillators.<br /><br /><img align="right" alt="Figure 1 block diagram" border="0" height="137" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor5/5xtorf1.gif" width="353" /><span style="color: blue; font-size: small;"><b><u>Audio Amplifier Basics:</u></b></span><br />
A modern stereo amplifier system has two closely matched high-fidelity audio amplifier channels. Typically each of
those channels offers switch-selectable inputs for such signal sources as a tuner, tape-player, CD-player, TV, MTS,
etc. Each also provides a single output signal to a high-power loudspeaker. To analyze one of those systems, it is
useful to divide the system into three functional circuit blocks, as shown in <span style="color: red;">Fig. 1</span>.<br /><img align="left" alt="High Impedance Preamplifier" border="0" height="253" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor5/5xtorf2.gif" width="262" />
The first of these blocks is the selector/preamplifier. It permits the system listener to select the desired input
signal source, and it automatically applies an appropriate amplification level and frequency correction to the signal
to condition it for the second circuit block, tone/volume control.<br /><br />
The tone/volume-control block permits the listener to adjust the frequency characteristics and the amplitude of the
audible output to suit his individual taste. This block might also contain additional filter circuits including one
specifically designed to screen out scratch and rumble.<br /><br />
The last section of the amplifier system is the power amplifier. It might be able to produce power levels from a few
hundred milliwatts to hundreds of watts. Audio power amplifiers are designed to cover the audio frequency range with
minimal distortion. Most quality products today include automatic overload and thermal-runaway protection.<br /><br />
The three sections of the audio amplifier system are all powered from a single built-in power supply. All three
sections include individual power supply decoupling networks to prevent unwanted signal interference. The first two
amplifier blocks will be discussed here.<br /><br /><img align="left" alt="Magnetic Microphone, 46dB gain" border="0" height="234" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor5/5xtorf3.gif" width="257" /><span style="color: blue; font-size: small;"><b><u>Simple Preamplifiers:</u></b></span><br />
The audio preamplifier circuit modifies the signal characteristics so that it will have a steady frequency response
and the nominal 100-millivolt output amplitude necessary for driving the tone/volume control section.<br />
If the input signal is derived from a radio tuner or a tape player, the signal characteristics are usually in a form
that can be fed directly to the tone/control section, bypassing the preamplifier. However, if the input is obtained
from a micro-phone or other audio input device, it will probably need preamplifier conditioning.<br />
Two basic kinds of transducers are found in micro-phones and audio pickups: magnetic or piezoelectric ceramic/crystal.
Magnetic transducers typically offer low output impedance and a low signal sensitivity of about 2 millivolts.
Their outputs must be fed to a high-impedance preamplifier stage with near-unity voltage gain.<br /><br /><img align="right" alt="Magnetic Microphone, 76dB gain" border="0" height="243" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor5/5xtorf4.gif" width="270" />
Most microphones have a near flat frequency response, so they can be matched to simple, flat-response preamplifier
stages. <span style="color: red;">Figure 2</span> shows a unity-gain preamplifier circuit that will work with most
high-impedance ceramic or crystal microphones. It is an emitter-follower (common-collector) amplifier with an input
network bootstrapped by C2 and R3. It has a typical input impedance of about 2 megohms. The combination of C5 and R5
decouples the amplifier from the DC power supply.<br />
Figures 3 and 4 show alternative preamplifier circuits that will match magnetic microphones. The single-stage circuit
of <span style="color: red;">Fig. 3</span> gives 46dB (x200) of voltage gain, and will work with most magnetic microphones.
The two-stage circuit of <span style="color: red;">Fig. 4</span>, however, gives 76dB of voltage gain, and it is intended
for preamplification of the output of very-low-sensitivity magnetic microphones.<br /><br /><img align="left" alt="RIAA curves" border="0" height="255" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor5/5xtorf56.gif" width="438" /><br /><br /><span style="color: blue; font-size: small;"><b><u>RIAA Preamplifier Circuits:</u></b></span><br />
The replay of a constant-amplitude 20Hz to 20KHz variable-frequency signal that has been recorded on a phonograph disc
with conventional stereo recording equipment will generate the nonlinear frequency response curve shown in <span style="color: red;">Fig. 5</span>.
Here, the dotted line shows the idealized shape of this curve, and the solid line shows an actual shape.<br />
Examination of the idealized (dotted) version of the curve in Fig. 5 will show that the response is flat between 500
and 2120 Hz. However, it rises at a rate of 6dB/octave (20 dB/decade above 2120 Hz), and falls at a 6dB/octave rate
between 500 Hz and 50 Hz. The response then flattens at frequencies below 50Hz.<br /><br />
There are good--but difficult to explain--reasons why the precise Fig. 5 recording curves are used. However, all you
really need to know is that they make it possible to produce disc recordings with excellent signal-to-noise ratios and
wide dynamic ranges. The curves were applied during record pressing.<br />
The important point to be made here is that when a disc is replayed, the output of the pickup device must be passed to
the power amplifier through a preamplifier whose frequency equalization curve is the mirror image (exact inverse) of
the one used to make the original recording. As a result, a linear overall record-to-replay response is obtained.<br /><span style="color: red;">Figure 6</span> shows the RIAA equalization curve. RIAA is an abbreviation for the
<b>R</b>ecording <b>I</b>ndustry <b>A</b>ssociation of <b>A</b>merica, the organization that standardized the precise
specification of the curve for the equalization of phonograph records. When long-playing phonograph (record-player)
records were the primary source of recorded music and audio entertainment, circuit designers had to include filter
networks that corrected the input from the record to conform to the RIAA equalization curve.<br /><img align="left" alt="RIAA curves" border="0" height="313" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor5/5xtorf7.gif" width="482" />
The relatively recent(1994) world-wide conversion to compact discs (CDs) as the primary source of recorded music and
entertainment has diminished the importance of the RIAA curve. Equalization is not required for linear signal sources
such as CDs.<br /><br />
Nevertheless, a preamplifier with an RIAA equalization network is still needed if you want to play any of the pressed
long-playing and 45 rpm records. This equalization can be obtained by wiring frequency-dependent, resistive capacitive
feedback networks into a preamplifier. This circuitry causes the gain to fall as the frequency rises. One network
will control the 50 to 500 Hz response, and the other will control the 2120 Hz to 20 kHz response.<br /><span style="color: red;">Figure 7</span> is the schematic for an amplifier with those networks that will work with any
magnetic phono cartridge. It gives a 1-volt output from a 6-millivolt input at 1KHz, and provides equalization that
is within 1 dB of the RIAA standard between 40 Hz and 12KHz.<br /><br /><br /><img align="left" alt="RIAA Equalization" border="0" height="243" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor5/5xtorf8.gif" width="270" /><img align="left" alt="Alternative RIAA" border="0" height="243" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor5/5xtorf9.gif" width="270" />
The preamplifier circuit is designed around transistors Q1 and Q2, with C2 and R5, and C3 and R6 forming the feedback
resistor capacitor equalization network. The output of the emitter-follower buffer stage, transistor Q3, can be
controlled by volume control potentiometer R10.<br />
The quality of reproduction of ceramic or crystal phono cartridges is generally lower than that of magnetic cartridges,
but they produce far higher amplitude output signals. Ceramic and crystal phone cartridges will work with simple
equalization preamplifiers--one reason why those cartridges were installed in so many low-cost record players.<br /><br /><span style="color: red;">Figure 8 and 9</span> show alternative phone cartridge preamplifier/equalization circuits that
can function with wither ceramic or crystal phono cartridges. Both circuits are designed around transistorized
emitter-follower output stages Q1 and Q2. The output of the circuit in <span style="color: red;">Fig. 8</span> can be
controlled by volume control potentiometer R4, and that of <span style="color: red;">Fig. 9</span> is controlled by R5.<br /><br />
The preamplifier/equalizer in Fig. 8 will work with any phone cartridge whose capacitance is between 1000 and 10,000pF.
Two-stage equalization is provided by the resistance-capacitance network made up of C1, C2, R2, and R3.
Preamplification/equalization for this circuit is typically within 1.6 dB of the RIAA standard between 40 Hz and 12KHz.<br />
The alternative preamplifier/equalizer shown in Fig. 9 will work only with phono cartridges whose capacitance value
are between 5000 and 10,000pF because this capacitance is part of the circuit's frequency response network. The
other part of the network is formed by C1 and R3. At 50 Hz, this circuit has a high input impedance of about 600
kilohms, which causes only slight cartridge loading. However, as frequency increases, input impedance decreases
sharply, increasing cartridge loading and effectively reducing circuit gain. The equalization curve approximates the
RIAA standard, and circuit performance is adequate for most practical applications.<br /><br /><img align="left" alt="Universal Preamp Circuit" border="0" height="321" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor5/5xtorf10.gif" width="485" /><span style="color: blue; font-size: small;"><b><u>A Universal Preamplifier:</u></b></span><br />
Most audio amplifier systems must have preamplifiers with many different characteristics. These include high-gain
linear response for magnetic microphones, low-gain linear response for tuners, and high-gain RIAA equalization for
magnetic phone cartridges.<br />
To meet this broad requirement, most amplifier designers include a single universal preamplifier circuit such as the
one shown in <span style="color: red;">Fig. 10</span>. Basically a high-gain linear amplifier, its characteristics can be
altered by switching alternative resistor filter networks into its feedback system.<br />
For example, when the selector switch is set to the <i>Mag phono</i> position, alternative input sources can be
selected by S1-a, and appropriate linear-response gain control feedback resistors R8, R9, and R10 are now selected by
S1-b. Those feedback resistor values are selected between 10 kilo ohms and 10 megohms to suit individual listener
tastes. Circuit gain will be proportional, to the feedback resistor value.<br /><img align="right" alt="Audio Amp Volume Control" border="0" height="169" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor5/5xtorf11.gif" width="287" /><br /><br /><span style="color: blue; font-size: small;"><b><u>Volume Control:</u></b></span><br />
The <i>Volume</i> control circuitry of an audio amplifier system is normally located between the output of the
preamplifier stage and the input of the tone-control circuit. It is usually only a potentiometer within the circuit,
as shown in Figs. 7, 8, and 9. However, the catch here is that rapid rotation of the potentiometer knob can apply DC
voltage to the next circuit for brief intervals. That voltage could upset circuit bias and cause severe signal
distortion.<br />
The block diagram in <span style="color: red;">Fig. 11</span> shows the ideal topology and location for a volume control.
It is fully DC-isolated from the output of the preamplifier by capacitor C1, and from the input of the tone-control
circuit by C2. As a result, variation of the wiper of control potentiometer R1 has no effect on the DC bias levels of
either circuit. Potentiometer R1 should have a logarithmic taper, that is, its output should be logarithmic function
rather than linear.<br /><br /><img alt="Bass Tone-control network" border="0" height="428" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor5/5xtorf12.gif" width="352" />
<img alt="Treble Tone-control network" border="0" height="416" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor5/5xtorf13.gif" width="360" /><br /><span style="color: blue; font-size: small;"><b><u>Passive Tone Control:</u></b></span><br />
A tone-control network permits the listener to change th system amplifier's frequency response to suit his own mood or
taste. He can, for example, boost or reduce the low-frequency (treble) sections of a musical selection to emphasize
the sounds of specific sections of the orchestra.<br />
Tone-control networks typically consists of simple resistive-capacitive filters through which the signals are passed.
Because these networks are passive, they cause some signal attenuation. Tone control networks can, if desired, be
wired into the the feedback loops of simple transistor amplifiers to give the system an overall signal gain. Those are
known as <i>active</i> tone control circuits.<br /><span style="color: red;">Fig. 12-a</span> shows a typical passive <i>bass</i> tone-control network, and
<span style="color: red;">Fig. 12-b</span> through <span style="color: red;">Fig. 12-d</span> show the equivalent of this
circuit when control potentiometer R3 is set to its maximum <i>boost</i>, maximum <i>cut</i>, and <i>flat</i>
positions, respectively. Capacitors C1 and C2 are effectively open circuited when the frequency is at its lowest bass
value. It can be seen from Fig. 12-b that the <i>boost</i> circuit is equivalent to a voltage divider formed by dividing
10 kilohms by 101 kilohms. This arrangement results in a low resistive value of about 100 ohms that only slightly
attenuates bass signals.<br />
The Fig. 12-c <i>cut</i> circuit, by contrast, has a voltage divider equal to 100 kilohms divided by a 1 kilohm which
gives a signal attenuation of about 40 dB. Finally, in Fig. 12-d when potentiometer R3 is set to the <i>flat</i>
position, it will have 90 kilohms of resistance above the wiper and 10 kilohms below it.<br />
This circuit resistance value is equal to 100 kilohms divided by 11 kilohms.<br /><br />
It gives a signal attenuation of about 20 dB at all frequencies. As a result, the circuit gives a maximum bass boost
of about 20 dB or <i>cut</i> relative to the <i>flat</i> signals.<br /><br /><span style="color: red;">Fig. 13</span> shows a typical passive <i>treble</i> tone-control network together with its
equivalent circuits under maximum <i>boost</i>, maximum <i>cut</i>, and <i>flat</i> operating conditions. This circuit
also provides about 20 dB of signal attenuation when potentiometer R3 is in the <i>flat</i> position, and it gives
maximum treble <i>boost</i> or <i>cut</i> values of about 20 dB relative to its <i>flat</i> performance.<br /><br /><img align="right" alt="Passive Bass/Treble Tone-control" border="0" height="276" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor5/5xtorf14.gif" width="277" />
Finally, <span style="color: red;">Fig. 14</span> shows how the Fig. 12-a and 13-a schematics can be combined to make a
complete bass and treble tone-control network The 10-kilohm resistor R5 has been added to minimize unwanted interaction
between the two connected circuit sections. The input to this network can be taken from the circuit's volume control,
and its output can be fed to the input of the power amplifier.<br /><br /><span style="color: blue; font-size: small;"><b><u>Active Tone Controls:</u></b></span><br />
A tone-control network can be included in the feedback path of a transistor amplifier so that the system will have an
overall signal gain (rather than attenuation) when its controls are in the <i>flat</i> position. These networks can be
simplifier versions of the basic circuit shown in Fig. 14. <span style="color: red;">Fig. 15</span> is the schematic for
an active tone-control circuit.<br /><br />
A comparison of Figs. 15 and 12 will reveal that the bass control section of Fig. 15 is a simplified version of
Fig. 12-a. It can be seen that the two capacitors C1 and C2 of Fig. 12-a have been replaced by the single 0.039uF
capacitor C2 of Fig. 15. Similarly, the <i>treble</i> version of Fig. 13-a, with resistors R1 and R2 eliminated.
Resistors R3 and R4 balance the performance of the two section of the Fig. 15 control circuit.<br /><br /><img alt="Active Bass/Treble Tone-control" border="0" height="296" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor5/5xtorf15.gif" width="407" /><br /><span style="color: blue; font-size: small;"><b><u>An Audio Mixer:</u></b></span><br />
A multichannel audio mixer is an attractive modification that can be added to the volume/tone-control section of an
audio amplifier. This mixer permits several different audio signals to be mixed together to form a single composite
output signal. This modification will be of value if, for example, you want to hear the front-door buzzer or the
sounds of a baby crying in a child's room while you listening to music.<br /><br /><span style="color: red;">Figure 16</span> is the schematic for a three-channel audio mixer that will provide an overall
gain of one between the output and each input channel. Each input channel includes a single 0.1 uF capacitor and a
100-kilohms resistor, to provide an output impedance of 100 kilohms. The number of input channels to this audio mixer
can be increased by adding more capacitors and resistors with the same values as C1 and R1.<br /><br />
The mixer should be located between the output of the tone-control circuitry and the input to the power amplifier.
One input should be taken from the output of the tone-control circuit, and the other inputs should either be grounded
or taken from the desired source.<br /><br /><img alt="Three Channel Audio Mixer" border="0" height="251" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor5/5xtorf16.gif" width="384" /></div>
<br /><h3>
</h3>
<h3>
</h3>
<h3>
Continue with Transistor Tutorial <a href="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor6/xtor6.html"><b>Part 6</b></a></h3>
<h3>
<b> </b></h3>
<h3 style="text-align: justify;">
<b> </b></h3>
<h3 style="text-align: justify;">
<b> </b></h3>
<div style="text-align: justify;">
<img alt="Transistors, Logo" height="400" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor6/6xtrlogo.gif" width="351" /><br /><br /><br /><span style="color: red; font-size: medium;"><i>"Build these circuits that can amplify, filter, generate white noise,
flash lamps, locate hidden metal--and perhaps even detect lies."</i></span><br /><br /><br /><span style="font-size: x-small;">Rewritten by Tony van Roon</span></div>
<hr style="margin-left: 0px; margin-right: 0px; text-align: left;" width="35%" />
<div style="text-align: justify;">
<br />
This last article on bipolar junction transistors (BJT) is a potpourri of circuits. Some are practical and some are
not so practical, but they can be great for experiments. With these circuits you can amplify signals, filter high
and low frequencies, generate white noise, and flash lamps. You can also boost DC voltage levels, locate hidden metal
objects, and detect rising water. One circuit will even demonstrate the fundamentals of lie detection!<br /><br /><span style="font-size: small;"><b><u>More Power Amplifiers:</u></b></span><br />
Today the easiest way to build a low- to medium-power audio amplifier is to pick an integrated circuit (IC) amplifier
from a manufacturer's data book and supplement it with additional components recommended in the applications notes in
the data book. However, if you just want to learn amplifier principles by experimentation or you have a simple
application in mind, you should build the amplifier with discrete transistors.<br /><span style="color: red;">Figure 1</span> is a schematic for a general-purpose, low-power, high-gain amplifier based on
discrete transistors. A Class-A amplifier, it can drive a load such as a speaker or headset with an impedance greater
than 65 ohms. The amplifier draws a quiescent current of about 20 milliamperes. However, this drain can be reduced by
increasing the value of R3.<br /><img alt="Audio Amplier with 2 transistors" height="347" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor6/6fig1.gif" width="318" />
<img alt="Audio Power Amplifier, 1 watt" height="407" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor6/6fig2.gif" width="324" /><br />
Transistors Q1 and Q2 are configured as common-emitter amplifiers; the output of Q1 is directly coupled to the input
of Q2. This circuit has an overall voltage gain of about 80 dB. Notice that resistor R3, the emitter load of Q2, is
decoupled by capacitor C3 so that the Q2 emitter follows the average collector voltage of Q1.<br />
The base bias for Q1 is derived from Q2's emitter through R2. With this configuration, the bias is stabilized by
negative DC feedback. Input potentiometer R4 serves as the circuit's volume control.<br /><span style="color: red;">Figure 2</span> is the schematic for a simple, three-transistor, Class-AB complementary amplifier
which can drive about 1 Watt into a 3-ohm speaker load. Transistor Q1, which is configured as a common-emitter
amplifier, drives a load that is the sum of speaker SPKR1. resistor R1 and potentiometer R5. Its output voltage is
<i>followed</i> and boosted in power by the complementary emitter-follower stage made up of Q2 and Q3.<br />
The output of the amplifier is fed through capacitor C2 to the junction of SPKR1 and R1 where it provides a
low-impedance drive for SPKR1. It simultaneously bootstraps the value of R1 so that the circuit has high-voltage gain.
The output is also fed back to Q1's base through R4 so that it produces a base bias through a negative feedback loop.<br />
Carefully adjust trimmer potentiometer R5 to minimize audible signal crossover distortion so that it is consistent with
lowest quiescent current consumption that can be measured. To obtain a reasonable value, set the quiescent current
from 10 to 15 milliamperes.<br /><span style="color: red;">Figure 3</span> shows a more complex audio power amplifier that can deliver about 10 watts into a
8-ohm load when powered from a 30-volt supply. This circuit includes four, high-gain, quasi-complementary output stage
(Q3 to Q6). Transistor Q1 functions as an adjustable <i>amplifier diode</i> output biasing device in this circuit.<br /><br /><img alt="Audio Power Amplifier with 6 transistors, 10 watt" height="434" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor6/6fig3.gif" width="527" /><br />
The main load resistor R2 of the Q2 common-emitter amplifier stage is bootstrapped by C2 and DC biased by R3. This
network should set the quiescent output voltage at about half the power supply value. If it does not, alter the value
of R3. The upper frequency response of the amplifier is restricted by C3, which menaces circuit stability. In
addition, capacitor C5 is wired in series with R8 across the output of the amplifier to increase circuit stability.
The amplifier should be set up initially as was described for the circuit in <span style="color: red;">Fig. 2</span>.<br /><br /><span style="font-size: small;"><b><u>Scratch/Rumble Filters:</u></b></span><br />
Today, with the widespread acceptance of compact discs (CDs/DVDs), records (LP) are long obsolete. However, because of
the everlasting popularity of the record (it seems), the last couple years manufacturers have been bringing back the
old record player in a new coat. Like myself, many people still own a large collection of these records, and when
played on quality record players, they can still provide many hours of listening pleasure.<br />
Back when the records were popular, unless the record player amplifiers were properly filtered, scratch and rumble noise
could interfere with reception. This interference was even more evident in the playing of the old 78 rpm records, you
know, the old hard and fragile bakelite kind. While scratch and rumble are no longer universal problems, the techniques
for eliminating them are still interesting.<br /><i>Scratch</i> noise is essentially sound at a frequency greater than 10KHz picked up from the record's surface, while
<i>rumble</i> is sound at a frequency typically less than 50 Hz caused by variations in turntable drive motor speed.
Each of these noises can be effectively eliminated or attenuated by passing the audio output from the record player
through a filter that rejects the annoying parts of the audio spectrum.<br /><img alt="High-pass filter" height="298" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor6/6fig4.gif" width="300" />
<img alt="Low-pass filter" height="298" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor6/6fig5.gif" width="300" /><br />
The rumble filter in <span style="color: red;">Fig. 4</span> is a high-pass filter that provides unity voltage gain for
all frequencies greater than 50Hz. however, it provides 12 dB per octave rejection to all frequencies below 50Hz.
For example, attenuation is 40dB at 5Hz. Transistor Q1 is configured as an emitter-follower biased at about half the
supply value from the low-impedance junction formed by R1 and R2 in parallel with capacitor C3.<br />
However, negative feedback applied through the filter network of R3, C2, C1, and R4 causes an <i>active</i> filter
response. The rolloff frequency of the circuit can be altered, if desired, by changing the values of capacitors C1
and C2--provided that they are kept equal. For example, if the values of C1 and C2 are reduced 50% from 0.220 to
0.110 microfarads, the rolloff frequency will be double to 100Hz.<br />
The scratch filter circuit in <span style="color: red;">Fig. 5</span> acts as a low-pass filter that provides unity voltage
gain to all frequencies below 10KHz, but it rejects all frequencies above 10 KHz at 12dB per octave. This circuit
resembles <span style="color: red;">Fig. 4</span> except that the positions of the resistors and capacitors are transposed
in the network consisting of C2, R4, C4, and R5.<br />
The rolloff frequency of that circuit can be altered, if desired, by changing the values of C2 and C4. For example,
if both are increase from 0.0022 microfarads to 0.0033microfards, the rolloff frequency is reduced from 10KHz to 7.5KHz.<br />
The circuits of <span style="color: red;">Fig. 4 and 5</span> can be combined to make a composite scratch and rumble filter.
The output of the high-pass filter is connected to the input of the low-pass filter. If desired, bypass switches can
be installed in the individual filter sections so that the filters can easily be switched in and out of circuit. This
change is illustrated schematically in <span style="color: red;">Fig. 6</span>.<br />
It's worth noting that if the circuits of <span style="color: red;">Fig. 4 and 5</span> are built on a single board, three
components can be saved by making the biasing network composed of resistors R1 and R2 and capacitor C3 common to both
filter circuits.<br /><br /><img align="right" alt="Composite Switchable Scratch and Rumble filter" height="177" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor6/6fig6.gif" width="483" /><span style="font-size: small;"><b><u>Noise Circuits:</u></b></span><br /><i>White Noise</i> is a steady hissing sound obtained by mixing a full spectrum of randomly generated audio frequencies,
each having equal sound power when averaged over time. White noise can be heard by tuning an FM radio receiver to that
part of the band where no nearby station can be heard. It is intentionally generated for testing audio- and
radio-frequency amplifiers. It can also be an effective sleep aid because it masks random background noises from
voices, passing vehicles, car horns, closing doors, and other sources.<br /><span style="color: red;">Figure 7-a</span> is the schematic for a simple but useful white noise generator base on the
inherent white-noise generation capability of a revers-biased zener diode. In this circuit, resistor R2 and zener
diode D1 form a negative-feedback loop between the collector and base of common-emitter amplifier Q1.<br /><img align="left" alt="White Noise generator" height="459" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor6/6fig7.gif" width="272" />
This loop stabilizes the DC working levels of the circuit, and capacitor C1 decouples the AC. As a result, D1
becomes a white-noise source in series with the case of Q1, which amplifiers that noise to a useful level of about
1 volt, peak-to-peak.<br />
The base-emitter junction of any silicone transistor can function as a noise-generating zener diode if its junction is
reverse-biased to tits breakdown level. This breakdown typically occurs in a 2N3904 small-signal BJT at about 6 volts.
<span style="color: red;">Figure 7-b</span> shows the schematic of a two-transistor, white-noise generator. In this
circuit Q1 acts as a zener diode.<br />
Audio noise can be annoying, especially if you are trying to listen to a very weak broadcast station. You might find
that the peaks of unwanted background noise completely swamp the broadcast signal, making it unintelligible. It is
possible to overcome this problem with the <i>noise-limiter</i> circuit shown in <span style="color: red;">Fig. 8</span>.<br />
In this circuit, both the signal and the noise are fed to amplifier Q1 through potentiometer R3. Transistor Q1
amplifies both waveforms equally, but diodes D1 and D2 automatically limit the peak-to-peak output swing of Q1 to
about 1.2 volts. If R3 is adjusted so that the signal output is amplified to this peak level, the noise peaks will
not exceed signal output. Therefore, the receiver signal will be far more intelligible.<br /><br /><span style="font-size: small;"><b><u>Astable Multivibrators:</u></b></span><br />
The <i>astable multivibrator</i> or <i> square-wave generator</i> circuit is versatile. <span style="color: red;">Figure 9</span>, for
example, shows how it can flash two light-emitting diodes (Led) about once per second. Its flash rate is controlled by
the time constant values of resistive-capacitive combinations of R4 and C1 and R3 and C2.<br />
The Leds are in series with the collectors of transistors Q1 and Q2, and they flash on and off symmetrically
out-of-phase with each other. The flash rate can be changed by altering the values of either R4 and C1 or R3 and C2.
You can also replace one of the Leds with a short circuit to make a one-Led flasher.<br /><br /><br /><img alt="Noise limiter circuit" height="303" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor6/6fig8.gif" width="439" /><br /><img alt="Two-Led Flasher" height="300" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor6/6fig9.gif" width="243" />
<img alt="Morse Code Practice Oscillator" height="297" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor6/6fig10.gif" width="241" /><br /><span style="color: red;">Figure 10</span> is a simple variation of the Fig. 9 astable multivibrator. This circuit
generates an asymmetrical waveform at about 800 Hz, which is fed to speaker SPKR1 and limiting resistor Rx in the
collector circuit of Q2. A monotone audio signal is generated when switch S1 is closed.<br />
This circuit becomes a simple sound generator if S1 is a simple on-off switch, or it can be a Morse-code practice
oscillator if a telegrapher's key is substituted for S1. The frequency of the generated tone can be changed by altering
the values of either or both capacitors C1 and C2.<br /><img align="left" alt="Audio-Radio signal injector" height="292" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor6/6fig11.gif" width="416" /><span style="color: red;">Figure 11</span> shows how an astable multivibrator can act as a signal injector-tracer for
testing radio receivers. When S1 is in the <i>inject</i> position 1, transistors Q1 and Q2 are configured as a 1KHz
astable multivibrator. With that setting, a sharp squarewave signal is sent to the <i>probe</i> terminal through R1
and C1.<br />
That waveform, which is rich in harmonics, will produce an audible output through a radio's loudspeaker if it is
injected into any audio- or radio-frequency stage of an amplitude modulated radio. By selecting a suitable injection
point, the injector can help in troubleshooting a defective radio.<br />
When S1 is switched to <i>Trace</i> position 2, the circuit is configured as a cascaded pair of common-emitter
amplifiers. The <i>Probe</i> input feeds the base of Q1 and Q2's output driving headphone Z1. Consequently, any
weak audio signal fed to the <i>Probe</i> will be amplified directly and heard in the headphone.<br />
Similarly, any amplitude-modulated radio-frequency signals that are fed to the Probe will be demodulated by the
non-linear response of transistor Q1, and the resulting audio signal will be amplified and heard in the earphone. If
the <i>Probe</i> is connected at suitable test points in a radio, the tracer can troubleshoot faults.<br /><br /><img alt="Broadcast Band Signal/Beat Oscillator" height="287" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor6/6fig12.gif" width="257" />
<img alt="Metal object locator" height="284" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor6/6fig13.gif" width="258" /><br /><span style="font-size: small;"><b><u>LC Oscillators:</u></b></span><br />
Many applications can be found for inductance-capacitance (L/C) oscillators in test equipment and practical circuits.
<span style="color: red;">Figure 12</span> is a <i>local oscillator Beat-Frequency Oscillator (BFO).</i> Transistor Q1 is
configured as a conventional Hartley Oscillator with modified 465 KHz Intermediate Frequency (IF) transformer as its
collector load.<br />
If the internal tuning capacitor of the transformer is removed, variable capacitor C1 becomes the tuning control of a
variable-frequency oscillator. The output frequency can be varied from well below 465 KHz to well above 1.7MHz.<br />
Any radio capable of receiving broadcast band frequencies will detect the oscillation frequency if it is placed near
the signal generator circuit. If the signal generator is tuned to the intermediate frequency of a radio, a beat note
can be heard. This will permit continuous-wave or sinus-sideband transmissions to be detected.<br /><span style="color: red;">Figure 13</span> is a modification of Fig. 12 without a transformer secondary. When the circuit
is functioning with a nearby radio receiver acting as a detector and amplifier, it becomes a simple metal object
locator. Oscillator coil L1 is made by winding 30 turns of wire tightly on a 3- to 4-inch diameter plastic core or
bobbin about 1 inch long. It becomes a <i>search head</i> or <i>sensing coil</i> when it it is connected to the
circuit with a 3-wire cable.<br /><img align="left" alt="DC-to-DC converter circuit, 9 to 300 volts" height="308" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor6/6fig14.gif" width="358" />
The searching head or sensor can be mounted at the end of a long wooden or plastic handle if you want to use the
circuit as a classic ground-sweeping metal detector. Similar circuits can detect buried treasure of military mines
that include at least some metal parts. However, the complete circuit can be housed in a handheld case if you want to
locate metal pipes or wiring that are hidden behind walls that are made of brick, wood, or plasterboard (gypsum/drywall).<br />
The operation of the object locator circuit in <span style="color: red;">Fig. 13</span> depends on the presence of a metal
object that will interfere with coil L1's electromagnetic field. The presence of the metal object can be detected by
a battery-portable broadcast band radio held close to the locator circuit. It senses the frequency shift and gives
out an audible screech.<br />
To detect a hidden metal object, first tune the radio to a local station, and then adjust C1 so that a low-frequency
<i>beat</i> or chirp is heard from the radio's speaker. This beat note will change significantly if the locator
circuit is placed near the hidden metal object.<br /><span style="color: red;">Figure 14</span> shows the Hartley oscillator used as a DC-to-DC converter. It is capable of
converting the output of a 9-volt battery to 300-volts DC. TransformerT1 is a 9-0-9 to 250-volt transformer. Its
primary forms the inductance (L) part of the oscillator.<br /><img align="right" alt="Water Activated Relay Circuit" height="286" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor6/6fig15.gif" width="263" />
The supply voltage is stepped up to a peak of about 350 volts at T1's secondary. This waveform is rectified by
half-wave rectifier diode D1, and it charges capacitor C4. With a permanent load, the output falls to about 300 volts
at a load current of a few milliamperes.<br /><i><b>Caution:</b></i> Without a permanent load across C4, the capacitor can deliver a powerful but non-lethal shock
to the unwary!<br /><br /><span style="font-size: small;"><b><u>Conductive Water Switch:</u></b></span><br />
A relay switch in a circuit that can be activated when a pair of probes come in contact with water can be very useful
around the home or on a boat. It might, for example, indicate flooding of a basement, or water in the bilges of a
boat. <span style="color: red;">Figure 15</span> is a conductive-water-operated relay. Transistors Q1 and Q2 are a
Darlington pair configured as a common-emitter, and relay coil RY1 is the collector load.<br />
The circuit relay is normally open (NO), but it is activated when the probes are placed across a resistance path that
has a value generally less than several megohms. Most potable tap water has a bulk resistances below this value, so
this circuit will work as a water-level relay switch. Relay RY1 can activate a pump or alarm (or both). However, the
presence of salt in theater (or sea water) has higher conductivity, and it can enhance the effectiveness of the
detection circuit.<br />
Because the conductivity of human shin has about the same resistance range as ordinary tap water, placing the probes in
contact with human skin can also serve to activate the relay.<br /><br /><img align="left" alt="Simple Lie Detector" height="334" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor6/6fig16.gif" width="255" /><span style="font-size: small;"><b><u>Lie Detector:</u></b></span><br /><span style="color: red;">Figure 16</span> is simple Wheatstone bridge "lie-detector". However, because of the possible
errors in the output of this circuit, its use should be confined to games or informal experiment. The circuit's
operation is based on the knowledge that the resistance of human skin changes as a result of changes in the emotional
state of the subject.<br />
The bridge of this detector circuit is formed by resistor R1 and R3 in a second arm. T4 in a third arm, and transistor
a probe in its base circuit) in the fourth arm.<br />
A milliammeter with its zero point at the cent of the scale is connected
across the bridge. It serves as a bridge-imbalance detector. Resistor
R2 in series with the second probe is attached to the junction between
Q1's collector and the low side of potentiometer R5. Large bare copper
bards or silver spoons can be used to make suitable probes.<br />
The probes should be taped or strapped directly to the skin on the
subject's hand or arm, separated by at least several inches. When the
subject is relaxed and his or her skin resistance reaches a stable
value, adjust potentiometer R5 to obtain a null on milliammeter M1. The
subject can then be questioned about the truth or falsity of
emotionally loaded or embarrassing subject--in fun of course.<br />
The subject's skin resistance will change in response to questions of
that kind if they are phrased correctly. The bridge should be
unbalanced if the subject reacts emotionally to the questions.
Experiments of this kind are often performed by students taking
college-level experimental psychology lab courses, but the equipment
that they use is usually more sophisticated and sensitive than this
circuit.<br />
Professional lie detectors typically factor in changes in the subject's
respiration and pulse rate measured by other sensors to supplement the
skin-resistance changes. The output of the machine is in the form of
pen traces on a moving pater strip. Nevertheless, you might be
surprised with the results you get experimenting with this simple
circuit.<br /><br /><span style="font-size: small;"><b><u>Suggested Reading:</u></b></span><br />
- "The Early History of the Transistor".<br />
- "A History of Engineering and Science in the Bell System:", Physical Sciences (1925-1980). S. Millman, Editor.<br />
- "Revolution in Miniature:", The History and Impact of Semiconductor electronics.<br />
- "Crystal Fire", by Michael Riordan and Lillian Hoddeson<br />
- "Transistorized!", Morgan Sparks interview. <br />
- "How we Built the Transistor" by William Shockley. New Scientist December 1972.<br />
- "The Improbable Years," Electronics (19 February 1968)<br />
- "They Had Eight Days to Learn About Transistors"<br /><br /><span style="font-size: small;"><b><u>Copyright and Credits:</u></b></span><br /><span style="color: red;">©</span> Original author Ray Marston. Published by Gernsback Publishing. (Hugo
Gernsback Publishing is (sadly) out of business since January 2000).<br />
Re-posting or taking graphics in any way or form from this website or of this project is expressly prohibited by
international copyright <span style="color: red;">© </span>laws. Permission by written permission only.</div>
</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
<br />
<br /><h3>
</h3>
<h3>
</h3>
<h3>
Continue with Transistor Tutorial <a href="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor7/xtor7.html"><b>Part 7</b></a></h3>
<h3>
<b> </b></h3>
<h3>
<b> </b></h3>
<br /><center>
<span style="font-family: Comic Sans MS;"><b>Transistors Tutorial</b></span></center>
<br />
<center>
<span style="color: blue; font-family: Comic Sans MS;"><b>Part 7:</b></span></center>
<br />
<center>
<span style="font-family: Comic Sans MS;"><b>"Oscillators"</b></span></center>
<br />
<br />
<br />
<div style="text-align: justify;">
<br /><br /><br /><span style="color: red; font-size: medium;"><i>"Learn about transistor oscillators and multivibrators that generate useful
sine and square waves."</i></span><br /><br /><br /><span style="font-size: x-small;">Rewritten and modified by Tony van Roon</span></div>
<hr style="margin-left: 0px; margin-right: 0px; text-align: left;" width="35%" />
<div style="text-align: justify;">
<br /><img align="left" alt="Oscillation Conditions" height="238" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor7/7xtorf1.gif" width="222" />
Oscillators based on the bipolar junction transistor (BJT) are the subjects of this article. Previous articles in this
series have included articles on the characteristics of the bipolar junction transistor, the common-collector amplifier,
common-emitter and common-base voltage amplifiers, etc.<br /><br /><span style="font-size: small;"><b><u>Oscillator Fundamentals:</u></b></span><br />
An oscillator is a circuit that is capable of a sustained AC output signal obtained by converting input energy.
Oscillators can be designed to generate a variety of signal waveforms, and they are convenient sources of sinusoidal
AC signals for testing, control, and frequency conversion. Oscillators can also generate square waves, ramps, or
pulses for switching, signalling, and control.<br /><img align="right" alt="Phase-shift Oscillator" height="251" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor7/7xtorf2.gif" width="213" /><br />
Simple oscillators produce sinewaves, but another form, the multivibrator, produces square or sawtooth waves. These
circuits were developed with vacuum-tubes, but have since been converted to transistor oscillators.
<span style="color: red;">Figure 1</span> is a simple block diagram showing an amplifier and a block representing the
many oscillator phase-shift methods. Regardless of its amplifier, an oscillator must meet the two <i>Barkhousen
conditions</i> for oscillation:<br /><b>1 -</b> The loop gain must be slightly greater than unity.<br /><b>2 -</b> The loop phase shift must be 0° or 360°.<br /><br />
To meet these conditions the oscillator circuit must include some form of amplifier, and a portion of its output must
be fed back regeneratively to the input. In other words, the feedback voltage must be positive so it is in phase with
the original excitation voltage at the input. Moreover, the feedback must be sufficient to overcome the losses in the
input circuit (gain equal to or greater than unity).<br /><br />
If the gain of the amplifier is less than unity, the circuit will not oscillate, and if it is significantly greater
than unity, the circuit will be over-driven and produce distorted (non-sinusoidal) waveforms.<br /><br />
As you will learn, the typical amplifier--vacuum tube, BJT, or field-effect transistor--imparts a 180° phase shift
in the input signal, and the resistive-capacitive (RC) feedback loop imparts the additional 180° so that the signal
is returned in phase. Energy coupled back to the input by inductive methods can, however, be returned with zero phase
shift with respect to the input.<br />
Specialized oscillators such as the Gunn diodes and Klystron tubes oscillate because of negative resistance effects,
but the basic oscillator principles apply here as well.<br /><br /><img align="left" alt="Wien Bridge" height="216" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor7/7xtorf3.gif" width="232" /><span style="font-size: small;"><b><u>RC Oscillators:</u></b></span><br /><span style="color: red;">Figure 2</span> is the schematic for a <i>phase-shift oscillator</i>, a basic resistive-capacitive
oscillator. Transistor Q1 is configured as a common-emitter amplifier, and its output (collector)signal is fed back to
its input (base) through a three-stage RC ladder network, which includes R5 and C1, R2 and C2, and R3 and C3.<br /><br />
Each of the three RC stages in this ladder introduces a 60° phase shift between its input and output terminals so
the sum of those three phase shifts provides the overall 180° required for oscillation. The phase shift per stage
depends on both the frequency of the input signal and the values of the resistors and capacitors in the network.<br /><br />
The values of the three RC ladder network capacitors C1, C2, and C3 are equal as are the values of the the three
resistors R5, R2, and R3. With the component values shown in Fig. 2, the 180° phase shift occurs at about 1/14 RC
or 700 Hz. Because the transistor shifts the phase of the incoming signal 180°, the circuit also oscillates at
about 700 Hz.<br /><br /><img align="right" alt="Wien Bridge Oscillator" height="275" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor7/7xtorf4.gif" width="330" />
At the oscillation frequency, the three-stage ladder network has an attenuation factor of about 29. The gain of the
transistor can be adjusted with trimmer potentiometer R6 in the emitter circuit to compensate for signal loss and
provide the near unity gain required for generating stable sinewaves. To ensure stable oscillation, R6 should be set
to obtain a slightly distorted sinewave output.<br /><br />
The amplitude of the output signal can be varied with trimmer potentiometer R4. Although this simple phase-shift
oscillator requires only a single transistor, it has several drawbacks: poor gain stability and limited tuning range.<br />
There are ways to overcome the drawbacks of the phase-shift oscillator, and one of them is to include a <i>Wien-bridge</i>
or network in the oscillator's feedback loop. The concept is illustrated in the Fig. 3 block diagram. A far more
versatile RC oscillator than the phase-shift oscillator, its operating frequency can be varied easily.<br /><br />
As shown within the dotted box in <span style="color: red;">Fig. 3</span>, a Wien Bridge consists of a series-connected resistor and capacitor, wired
to a parallel- connected resistor and capacitor. The component values are "balanced" so that R1 equals R2 and C1
equals C2.<br /><br />
The Wien Network is exceptionally sensitive to frequency. That shift is negative (to a maximum of -90°) at low
frequencies, and positive (to a maximum of +90°) at high frequencies. It is zero a center frequency of 1/6.28RC.
At the center frequency, network attenuation is a factor of 3.<br /><br />
As a result, the Wien network will oscillate if a non-inverting, amplifier with a gain of 3 is connected as shown
between the amplifier's output and input terminals. The output is taken between the output of the amplifier and
ground.<br /><br /><img align="left" alt="Wien Bridge Oscillator" height="256" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor7/7xtorf5.gif" width="245" />
A basic two-stage Wien-Bridge oscillator schematic is shown in <span style="color: red;">Fig. 4</span>. Both transistors
Q1 and Q2 are configured as low-gain common-emitter amplifiers. The voltage gain of Q2 is slightly greater than unity,
and it provides the 180° phase shift required for regenerative feedback. The 4.7K resistor R4, part of the Wien
bridge network, functions as the oscillator's collector load.<br /><br />
Transistor Q1 provides the high input impedance for the output of the Wien network. Trimmer potentiometer R5 will set
the oscillator's gain over a limited range. With the component values shown, the Wien bridge oscillator will
oscillate at about 1 KHz. Trimmer R5 should be adjusted so that the sinewave output signal is just slightly distorted
to achieve its maximum stability.<br />
Many different practical variable-frequency Wien-bridge oscillators can be built with operational amplifier integrated
circuits combined with an automatic gain-control feedback network. No inductors are needed in these circuits.<br /><br /><br /><br /><span style="font-size: small;"><b><u>LC Oscillators:</u></b></span><br />
Resistive-capacitive sine wave oscillators can generate signals from a few hertz up to several megahertz, but
inductive-capacitive (LC) oscillators can generate sinewave outputs from 20 or 30 KHz up to UHF frequencies.<br />
An LC oscillator includes an LC network that provides the frequency-selective feedback between the output of the
amplifier and its input terminals.<br />
Because of the inherently high <i>Q</i> or <i>frequency selectivity</i> of LC networks or resonant tank circuits, LC
oscillators produce more precise sinewave outputs--even when the loop gain of the circuit is far greater than unity.<br /><br /><img align="left" alt="Hartley Oscillator" height="301" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor7/7xtorf6.gif" width="197" /><img align="right" alt="Colpitts Oscillator" height="256" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor7/7xtorf7.gif" width="245" />
The <i>tuned-collector oscillator</i> shown in <span style="color: red;">Fig. 5</span> is the simplest of many different
LC oscillators. Transistor Q1 is configured as a common-emitter amplifier, with its base bias provided by the junction
of series resistors R1 and R2. Emitter resistor R3 is decoupled from high-frequency signals by capacitor C3.<br /><br />
The primary turns of transformer T1 (L1) in parallel with trimmer capacitor C1 form a tuned collector resonant tank
circuit. Collector-to-base feedback is provided by coil L2 in transformer T1. Coil L2, with a smaller number of turns
than L1, is inductively couple to L1 by transformer action.<br /><br />
The necessary zero phase shift around the feedback loop can be obtained by adjusting trimmer capacitor C1. If loop
gain exceeds unity at the tuned frequency, the circuit will oscillate. Loop gain is determined by the turns ratio of
L1 with respect to L2 in transformer T1.<br /><br />
The phase relationship between the energizing current of all LC tuned circuits and inducted voltage varies over the
range of -90° to +90°, and it is zero at a <i>center</i> frequency given by the formula:
<img align="middle" alt="Center Frequency Formula" height="16" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor7/7xtorcf.gif" width="90" />.<br />
Because the circuit in Fig. 5 provides a 0° overall phase shift, it oscillates at this center frequency. The
frequency can be varied by trimmer capacitor C1 from 1MHz to 2 MHz. The circuit can be enhanced to oscillate at
frequencies from less than 100 Hz to UHF (Ultra High Frequency) frequencies with a laminated iron-core transformer.
The same circuit will oscillate satisfactorily in the UHF regions with an air-core transformer.<br /><br /><img align="left" alt="Clapp Oscillator" height="256" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor7/7xtorf8.gif" width="231" /><img align="right" alt="Reinartz Oscillator" height="256" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor7/7xtorf9.gif" width="231" /><span style="font-size: small;"><b><u>Classic LC Oscillators:</u></b></span><br /><span style="color: red;">Figure 6</span> illustrates the <i>Hartley Oscillator</i>, which is a variation of the tuned-collector
oscillator that was shown in Fig. 5. This oscillator is recognizable by the tapped coil in its tuned resonant circuit.
Oscillation of the Hartley oscillator circuit depends on phase-splitting autotransformer action of the tapped coil in
the tuned resonant circuit.<br /><br />
The tap is located on load inductor L1 about 20% of the way down from its top so that about 1/5 of the turns are above
the tap and 4/5 are below. The positive power supply is connected to the tap to obtain the necessary
<i>autotransformer</i> action.<br /><br />
The signal voltage across the top of L1 is 180° out-of-phase with he signal voltage across its lower end, which
is connected to the collector of Q1. The signal from the top of the coil is coupled to the base (input) of Q1 through
isolating capacitor C2. The oscillator will oscillate at a center frequency determined by its LC product.
The <i>Colpitts Oscillator</i> shown in <span style="color: red;">Fig. 7</span> is another classic circuit. It is
identified by the voltage divider in its tuned resonant circuit. With the component values shown, this Colpitts
circuit will oscillate at about 37KHz.<br /><br />
Capacitor C1 is in parallel with the output capacitance of Q1, and C2 is in parallel with the input capacitance of Q1.
Consequently, changes in Q1's capacitance (due to temperature changes or aging) can shift the oscillator frequency.
This shift can be minimized for high frequency stability by selecting values of C1 and C2 that are relative to the
internal capacitances of Q1.<br /><br />
The <i>Clapp Oscillator</i>, a modification of the Colpitts oscillator, shown in <span style="color: red;">Fig. 8</span>,
offers higher frequency stability than the Colpitts oscillator.
This is achieved by adding capacitor C1 in series with the
coil in the tuned resonant tank circuit. It is selected to have a value that is small with respect to C2 and C3.<br />
As a result of the presence of this capacitor, the resonant frequency of the tank and oscillator will be determined
primarily by the values of L1 and C1.<br /><br />
Capacitor C3 essentially eliminates transistor capacitance variations as a factor in determining the Clapp oscillator's
resonant frequency. With the component values shown, the Clapp oscillator oscillates at about 80KHz.<br /><span style="color: red;">Figure 9</span> shows the classic <i>Reinartz Oscillator</i>. In this circuit, tuning coil L1
in the collector circuit and the tuning coil L2 in the emitter circuit are inductively coupled to tuning coil L3 in
the resonant tank circuit. Positive feedback is obtained by coupling the collector and emitter signals of the
transistor through windings L1 and L2, and inductively coupling both of these coils to L3. This Reinartz oscillator
oscillates at a frequency determined by L3 and trimmer capacitor C2. With the values and turns ratios given in
<span style="color: red;">Fig. 9</span>, the circuit will oscillate at a few hundred KHz.<br /><br /><img align="left" alt="Beat Frequency Oscillator" height="314" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor7/7xtorf10.gif" width="245" /><img align="right" alt="BFO with varactor tuning" height="321" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor7/7xtorf11.gif" width="243" /><span style="font-size: small;"><b><u>Modulation:</u></b></span><br />
The LC oscillator circuits shown in Figs. 5 to 9 can be modified to produce amplitude- or frequency-modulated (AM or
FM) rather than continuous wave (CW) output signals. <span style="color: red;">Figure 10</span> is the schematic for a
beat-frequency oscillator (BFO). It is based on the tuned-collector circuit of Fig. 5, but modified to become a
465-KHz amplitude-modulated (AM) BFO.
A standard 465-KHz IF transformer (T1), intended for transistor circuits, is the LC resonant tank circuit in this
oscillator. An audio-frequency AM signal fed to the emitter of Q1 through blocking capacitor C2 will modulate the
supply voltage of Q1 and thus amplitude-modulate the circuit's 465-KHz <i>carrier</i> signal.<br />
This BFO can provide 40% signal modulation. The value of emitter-decoupling capacitor C1 was selected to present a low
impedance to the 465-KHz carrier signal, while also presenting a high impedance to the low-frequency modulation signal.<br /><br /><br /><br /><img align="left" alt="Astable Multivibrator, 1KHz" height="471" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor7/7xtorf12.gif" width="242" /><span style="color: red;">Figure 11</span> shows how the BFO circuit in Fig. 10 can be modified to become a frequency
modulator. Tuning is adjusted by trimmer potentiometer R5. Silicon diode D1 functions as an inexpensive varactor
diode. A 1N4001 diode frequency modulates the 465-KHz BFO circuit. Here, C2 and diode "capacitor" D1 are in series.<br />
Consequently, the oscillator's <i>center frequency</i> cam be changed by altering the capacitance of D1 with trimmer
potentiometer R5, and frequency-modulated signals can be obtained by introducing an audio-frequency modulation signal
to D1 through C1 and R4. Capacitor C2 provides DC isolation between Q1 and D1.<br /><br /><span style="font-size: small;"><b><u>Astable Oscillators:</u></b></span><br />
Conventional oscillator circuits produce sinewaves, but repetitive square waves are important in electronics. One way
to generate them is with the astable multivibrator circuit shown in <span style="color: red;">Fig. 12<i>a</i></span>.<br />
This multivibrator is a self-oscillating regenerative switch whose on and off periods are controlled by the time constants
obtained as the products of R2 and C2, and R3 and C1. If these time constants are equal (because both values of R
and C are equal), the circuit becomes a square-wave generator that operates at a frequency of about 1/1.4 RC. The
waveforms taken at the collector and base of transistors Q1 and Q2 are shown in
<span style="color: red;">Fig. 12<i>b</i></span>.<br />
The frequency of the astable multivibrator in Fig. 12 can be decreased by increasing the values of C1 and C2 or R2 and
R3, or increased by decreasing them. The frequency can be varied with dual-gang variable resistors placed in series
with 10K limiting resistors in place of R2 and R3.<br />
The operating frequency can, if required, be synchronized to that of a higher-frequency signal by coupling part of the
external signal into the timing networks of the astable circuit. Outputs can be taken from either collector of the
circuit, and the two outputs are in opposite in phase. The multivibrator's operating frequency is essentially
independent of power supply voltage between + 1.5 and + 9 volts.<br />
The upper voltage limit is set by inherent transistor behavior: as the transistors change state at the end of each
half-cycle, the base-emitter junction of one transistor is reverse biased by a voltage that is about equal to the supply
voltage. Consequently, if the supply voltage exceeds the reverse base-emitter breakdown voltage of the transistor,
circuit timing will be affected.<br /><img align="left" alt="Astable Multivibrator, Freq correction" height="325" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor7/7xtorf13.gif" width="231" />
This characteristic can be overcome with the circuitry modifications shown in <span style="color: red;">Fig. 13</span>.
A silicon diode is connected in series with the base input terminal of each transistor to raise the effective
base-emitter reverse breakdown voltage of each transistor to a value greater than that of the diode.<br />
The protected astable multivibrator will operate with any supply voltage from +3 to +20 volts. Its frequency will vary
only about 2% when the supply voltage is varied from +6 to +18 volts. This variation can be further reduced to 0.5% by
adding another "compensation" diode in series with the collector of each transistor, as shown in Fig. 13.<br /><br /><span style="font-size: small;"><b><u>Multivibrator Variations:</u></b></span><br />
The basic astable multivibrator shown in Fig. 12 can be modified in different ways to improve its performance or
change the shape of its output waveform. Some modifications are shown in <span style="color: red;">Figs. 14 to 18</span>.<br />
A shortcoming of the multivibrator shown in Fig. 12 is that the leading edge of each of its output waveforms is
slightly rounded. The lower the values of timing resistors R2 and R3 with respect to collector load resistors R1 and
R4, the more pronounced will be this waveform rounding.<br />
Conversely, the larger the values of R2 and R3 with respect to R1 and R4, the sharper the waveform edge will be. The
maximum permissible values of R1 and R4 are, however, limited by the current gains of the transistors. These gains are
equal to h<sub>FE</sub> multiplied wither by the value of resistor R1 or R4.<br /><br /><img align="left" alt="Astable Multivibrator, long-period" height="293" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor7/7xtorf14.gif" width="273" /><img align="right" alt="Astable Multivibrator, waveform correction" height="256" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor7/7xtorf15.gif" width="283" />
One way to improve the circuit waveform, of course, would be to replace transistors Q1 and Q2 with Darlington
transistor pairs and then substitute timing resistance values that are as large as permissible. That is done in the
long-period astable multivibrator that is shown in Fig. 14.<br />
Resistors R2 and R3 can have any value between 10K and 12Meg, and the multivibrator will run from any supply voltage
between +3 and +18 volts. With R2 and R3 values shown in Fig. 14, the multivibrator's total period or cycle time is
about 1 second per microfarad when C1 and C2 have equal values. This multivibrator generates sharp-cornered square
waves.<br />
The square waves with the rounded leading edges produced by the multivibrator shown in Fig. 12 are caused by an
inherent characteristic of the transistor. As each transistor is switched off, its collector voltage is prevented
from switching abruptly to the positive supply value. This is due to the loading between that collector and the base
of the adjacent conducting transistor from timing capacitor cross-coupling.<br /><img align="left" alt="Astable Multivibrator, sure-start" height="286" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor7/7xtorf16.gif" width="240" /><img align="right" alt="Variable Mark/Space Generator" height="286" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor7/7xtorf17.gif" width="253" />
This characteristic can be altered, and sharp square waves can be obtained by effectively disconnecting the timing
capacitor from the collector of its transistor as it turns off. That improvement is shown in
<span style="color: red;">Fig. 15</span>, a schematic for a 1-KHz astable multivibrator. It includes diodes D1 and D2 that
disconnect the timing capacitors at the moment of switching.<br />
The important time constants of the multivibrator in Fig. 15 are also determined by C1 and R4, and C2 and R1. The
effective collector loads of Q1 and Q2 are equal to the parallel resistances of R1 and R2, and R5 and R6, respectively.<br />
Basic astable multivibrator operation depends on slight differences in their transistor characteristics. Those
differences cause one transistor to turn on faster than the other when power is first applied, thus triggering
oscillation.<br />
If the multivibrator's supply voltage is applied slowly by increasing it from zero, however, both transistors could turn
on simultaneously. If this happens, the oscillator will be a <i>nonstarter</i>.<br />
The possibility of nonstarting can be avoided with the "sure-start" astable multivibrator circuit shown in
<span style="color: red;">Fig. 16</span>. There, the timing resistors are connected to the transistor's collectors so that
only one transistor can conduct at a time, ensuring that oscillation will always begin.<br /><img align="left" alt="Variable Mark/Space Generator" height="373" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor7/7xtorf18.gif" width="271" />
All the astable multivibrator circuits shown so far are intended to produce symmetrical output waveforms, with a 1 to 1
ratio of square wave to space (1:1 mark/space ratio). Non-symmetrical waveforms can be obtained by installing one set
of RC astable time constant components that is larger than the other.<br /><br /><span style="color: red;">Figure 17</span> shows a 1.1KHz variable mark/space ratio generator. The ratio can be varied
over the range 1 to 10 with trimmer potentiometer R5. However, the leading edges of the output waveforms of this
circuit could be too round for some applications when mark/space control is set at its extreme position. Also, this
generator could be difficult to start if the supply voltage is applied slowly to the circuit.<br /><br />
Both of the drawbacks can be overcome with the modifications shown in the schematic of <span style="color: red;">Fig. 18</span>,
another 1.1KHz variable mark/space ratio generator. The circuit includes both sure-start and waveform-correction
diodes.<br /><br /><span style="font-size: small;"><b><u>Copyright and Credits:</u></b></span><br /><span style="color: red;">©</span> 1993 Original author Ray Marston. Electronics Now, December 1993. Published by
Gernsback Publishing. (Hugo Gernsback Publishing is (sadly) out of business since January 2000).<br />
All graphics, drawings, photos, <span style="color: red;">©</span> 2006 Tony van Roon.<br />
Re-posting or taking graphics in any way or form from this website or of this project is expressly prohibited by
international copyright laws. Permission by written consent only.</div>
<br /><br /><br /><h3>
<br />
Continue with Transistor Tutorial <a href="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor8/xtor8.html"><b>Part 8</b></a></h3>
<h3>
<b> </b></h3>
<h3>
<b> </b></h3>
<h3>
<b> </b></h3>
<div style="text-align: justify;">
<span style="font-family: Comic Sans MS;"><b>Transistors Tutorial</b></span><br /><span style="color: blue; font-family: Comic Sans MS;"><b>Part 8:</b></span><br /><span style="font-family: Comic Sans MS;"><b>"Amplifier Design"</b></span><br /><br /><br /><br /><span style="color: red; font-size: medium;"><i>"It's easy to design a simple transistor amplifier. Here is how."</i></span><br /><br /><br /><br /><br /><br /><br /><br /><br />
Rewritten & modified by Tony van Roon
</div>
<hr style="margin-left: 0px; margin-right: 0px;" width="43%" />
<div style="text-align: justify;">
We were having trouble finding an exact replacement transistor while repairing a piece of equipment. Figuring that an
exact replacement was going to be impossible to find, we began to discuss what to do. And someone pointed out that
there were only two kinds of bipolar transistors--NPN and PNP. Of course, values for various characteristics vary
widely, even for a specific transistor; but in many circuits, a garden-variety device will work (and did in our case).<br /><br />
Designing and repairing transistorized circuits is much simple than you might suspect. A well-designed circuit has
built-in tolerance, so it's probably not device sensitive. The most important characteristics to consider when
substituting devices or designing a circuit from scratch are operating frequency and power level.<br /><br />
What follows is the design procedure we went through to solve an audio-gain problem. Try it when you need a little
extra gain for that next audio project.<br /><br /><span style="font-size: small;"><b><u>An Audio Amp:</u></b></span><br />
This particular project involved injecting the audio from a TV receiver into a stereo system. (These days even the
cheapest TV has that feature, including MTS stereo inputs for digital accessories). Anyways, the audio-output portion
of the TV-audio receiver was abandoned because of its poor frequency response and high distortion. Instead, we wanted
to come right off the detector into a quality audio amplifier and speaker. So, after picking off the audio at a
convenient point in the set (in this case, from a potentiometer), we wanted to feed it to the auxiliary input of the
stereo amplifier.<br /><br />
The amplifier we used required an input of 1 volt RMS, but a quick check with an AC VTVM indicated that out picked-off
audio signal was only 0.1-volt RMS. Obviously, an amplifier with a gain of 10 was needed.<br /><br />
Scanning the literature on transistor amplifiers reveled that a common-emitter amplifier with a voltage-divider bias
circuit would solve our problem nicely. Such a circuit is shown in <span style="color: red;">Fig. 1</span>. Some of that
circuit's characteristics include: moderate input impedance, moderate voltage gain, inverted output, and input/output
impedance and gain that depend only slight on transistor beta.<br />
There are, of course, several rules that must be followed in using a common-emitter amplifier, including:</div>
<ul style="text-align: justify;">
<li> With a positive supply use an NPN transistor.
</li>
<li> With a negative supply use an PNP transistor.
</li>
<li> The supply voltage must not exceed the transistor's Vce rating.
</li>
<li> The power-dissipation rating of the transistor must not be exceeded.<br />
</li>
<li> The beta of the transistor should be 100 or higher.
</li>
</ul>
<div style="text-align: justify;">
<img align="left" alt="Figure 1" height="286" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor8/8xtorf1.gif" width="232" />
In our example the following facts are known:</div>
<ul style="text-align: justify;">
<li> Our amplifier had a single-ended 12-volt power supply.
</li>
<li> We need a voltage gain of 100.
</li>
<li> The input impedance of the amplifier should be about 15K, the same as the potentiometer from which the audio was
taken.
</li>
<li> The impedance of the stereo amplifier's auxiliary input is about 50K.
</li>
</ul>
<div style="text-align: justify;">
As is the case in most circuit designs, a few facts are known, and the rest must be calculated or picked using a a few
"rules of thumb". We will learn how to make the calculations next.<br /><br /><span style="font-size: small;"><b><u>Doing the Math:</u></b></span><br />
For maximum undistorted output swing, we will make the quiescent collector voltage 1/2 the supply voltage. See
<span style="color: red;">Fig. 2</span>. The drop across R<sub>c</sub> must therefore be 6 volts.<br />
The value of R<sub>c</sub>, the collector load resistance, is chosen considering output impedance, gain, and collector current.
If possible, the output impedance should be lower than the impedance of the circuit we are feeding by a factor of 10
or more. Doing so will avoid circuit loading. So let's make R<sub>c</sub> equal to 4700 ohms, which is about 50K/10.
Collector current I<sub>c</sub>, is equal to 0.5V<sub>cc</sub>/R<sub>c</sub>, or 6/4700 = 1.28 mA. That current is
certainly low enough that we will not exceed any collector-current ratings, so let's go on.<br /><img align="left" alt="Figure 2" height="286" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor8/8xtorf2.gif" width="232" />
To achieve maximum stability, the emitter resistor should be in the range of 40 to 1000 ohms. Voltage gain
(A<sub>v</sub>) = R<sub>c</sub>/R<sub>e</sub>, so R<sub>e</sub> = R<sub>c</sub>/A<sub>v</sub>. In our case
R<sub>e</sub> equals 4700/10, or 470 ohms. That falls within the range of acceptable values.<br />
The current through the emitter resistor consists of the collector current plus the base current. The base current
here is significantly smaller than the collector current, so it can be ignored for the next calculation.<br /><br />
The voltage drop across the emitter resistor = I<sub>c</sub> X R<sub>e</sub>, or 1.28 mA x 470 ohms = 0.602 volts.
The base voltage must exceed the emitter voltage by 0.6 volts for a silicon transistor and by 0.2 volts for a germanium
transistor. We'll use a silicon transistor (most if not all germanium types are obsolete) in our circuit, so the base
voltage must be 0.6 + 0.602 = 1.202 volts.<br />
The input impedance of the circuit equals R2 in parallel with the emitter resistor times beta; input impedance will
vary with the transistor's beta. FOr our example, assume we are using a transistor with a beta of 100. We want the
input impedance to be about 15000 ohms. Solving for R2, we find:<br /><pre> Z<sub>in</sub> = (R2 X R<sub>e</sub> X beta)/[R2 + (R<sub>e</sub> X beta)]
R2 = (Z<sub>in</sub> X R<sub>e</sub> X beta)[(R<sub>e</sub> X beta) - Z<sub>in</sub>]
R2 = (15000 x 470 x 100)/[470 x 100) - 15000]
R2 = 22,030 ohms.
</pre>
We can use a 22K resistor. In general, if input impedance is not critical, for maximum stability R2 can be 10 to 20
times R<sub>e</sub>.<br />
The drop across R2 must be 1.20 volts so the current through R2 is 1.20/22,000, or 0.054 mA. Therefore, R1 must drop
the rest of the supply voltage, which is 12 - 1.20 = 10.8 volts. The current flowing through R1 is a combination of
the voltage-divider current plus the base current.<br />
The base current is equal to the collector current divided by beta. It is found from:<br /><pre> I<sub>beta</sub> = 1.28/100 = 0.0128 mA</pre>
So the total current through R1 is 0.054mA + 0.0128mA = 0.067mA, and R1 = 10.8/0.067mA = 160,000 ohms (160K).<br /><br /><img align="left" alt="Figure 3" height="286" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor8/8xtorf3.gif" width="232" /><img align="right" alt="Figure 4" height="286" src="http://www.sentex.ca/%7Emec1995/tutorial/xtor/xtor8/8xtorf4.gif" width="232" />
Resistor R1 is the most critical resistor in the circuit. To ensure maximum voltage swing, it should bring the
quiescent collector voltage to one half the supply voltage. After building the circuit, the value of R1 may have to
be varied slightly to achieve that voltage swing.<br />
We now have a circuit we can test.<br /><br /><span style="font-size: small;"><b><u>Interfacing:</u></b></span><br />
Connecting the circuit to the outside world will require capacitor coupling. That serves to isolate the AC signal
from any DC bias voltages. <span style="color: red;">Figure 3</span> shows our complete circuit with input and output
coupling capacitors. The values of those capacitors were calculated using C = 1/(3.2 x ƒ x R), where C equals
the capacitor value in farads, ƒ equals the frequency at which response will be down 1dB, and R equals the
impedance on the load side of the capacitor.<br />
To calculate the value of C1, the amplifier's input impedance (15K) is used for R. To calculate the value of C2,
the input impedance of the next stage (50K) is used for R.<br /><br />
The value of C1 can now be calculated for a drop of 1dB at 20 Hz: C1 = 1/(3.2 x 20 x 15000) = .00000104 farad = 1.0 uF.
The value of C2 = 1/(3.2 x 20 x 50000) = .00000031 farad = 0.33uF.<br />
To increase the gain of the stage, you could bypass R<sub>e</sub> with a capacitor, as shown in <span style="color: red;">Fig. 4.</span>
Nothing comes for free, however. The price you pay for increase gain is lower input impedance, which will vary widely
with beta. If that variation is not a problem, a significant gain increase can be realized by adding the bypass
capacitor. Our original circuit has a gain of 10; if the emitter is bypassed the gain becomes
R<sub>c</sub>/003/I<sub>e</sub> = 4700/(0.03/0.00129) = 4700/23 = 200 (approx).<br />
The value of the bypass capacitor in farads is calculated from the formula C = 1/(6.2 x ƒ x R). Again ƒ is
the low-frequency limit in Hz, and R is the dynamic emitter resistance (0.031/I<sub>e</sub>). In our example, if we
stick to a 20-Hz lower limit we have C = 1/[6.2 x 20 x (0.03/0.00129)] = .000344 farads = 344 uF. A 350uF unit can be
used.<br /><br /><span style="font-size: small;"><b><u>Thoughts:</u></b></span><br />
A few thoughts on components before we finish: using 5% resistors allows closer adherence to the calculated values.
Because of their temperature stability and low leakage specifications, silicon rather than germanium transistors are
preferable for this type of circuit.<br />
Finally, you've no doubt noticed that we have yet to specify a specific transistor. That's because for this type of
application it really doesn't matter! Almost any small signal device will do fine.<br /><br /><span style="font-size: small;"><b><u>Copyright and Credits:</u></b></span><br />
Copyright <span style="color: red;">©</span> of the original article by author Jack Cunkelman, published in
Radio Electronics Magazine, August 1987.<br />
Published by Gernsback Publishing. (Hugo Gernsback Publishing is (sadly) out of business since January 2000).<br />
Re-posting or taking graphics in any way or form from this website or of this project is expressly prohibited by
international copyright <span style="color: red;">© </span>laws. Permission by written request only.</div>
</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
<br />
<h3>
<b> </b></h3>
<h3>
<b> </b></h3>
<h3>
<b> </b></h3>
<h3>
<b> </b></h3>
<h3>
<b> </b></h3>
</div>
<div style="text-align: justify;">
</div>
<hr style="margin-left: 0px; margin-right: 0px;" />
</div>
Anonymoushttp://www.blogger.com/profile/13526216155838659104noreply@blogger.com0tag:blogger.com,1999:blog-2190029239849113272.post-21607881122260237222014-03-10T00:14:00.000-07:002014-03-10T00:19:14.411-07:00Atmel AVR Microcontroller <div dir="ltr" style="text-align: left;" trbidi="on">
<div class="centeredContent back" id="productMainImage">
<a href="http://d1gsvnjtkwr6dd.cloudfront.net/large/IC-ATMEGA168A-PU_LRG.jpg" rel="productimages" title="ATMEGA168A-PU Atmel 8 Bit 16K AVR Microcontroller"><br /></a></div>
<br class="clearBoth" />
<div class="flexslider" id="productAdditionalImages">
<div class="flex-viewport" style="overflow: hidden; position: relative;">
<a href="http://d1gsvnjtkwr6dd.cloudfront.net/large/IC-ATMEGA168A-PU_01_LRG.jpg" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img src="http://d1gsvnjtkwr6dd.cloudfront.net/medium/IC-ATMEGA168A-PU_01_MED.jpg" height="200" width="200" /></a><br />
<ul class="slides" style="-moz-transform: translate3d(0px, 0pt, 0pt); -moz-transition-duration: 0s; width: 600%;"><a href="http://d1gsvnjtkwr6dd.cloudfront.net/large/IC-ATMEGA168A-PU_LRG.jpg" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img class="current" src="http://d1gsvnjtkwr6dd.cloudfront.net/medium/IC-ATMEGA168A-PU_MED.jpg" height="400" width="400" /></a>
<li style="display: block; float: left; width: 70px;"></li>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://d1gsvnjtkwr6dd.cloudfront.net/large/IC-ATMEGA168A-PU_02_LRG.jpg" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img src="http://d1gsvnjtkwr6dd.cloudfront.net/medium/IC-ATMEGA168A-PU_02_MED.jpg" height="400" width="400" /></a></div>
<li style="display: block; float: left; width: 70px;"> </li>
</ul>
<br />
<br />
<br />
<br />
<br />
<br />
<ul class="slides" style="-moz-transform: translate3d(0px, 0pt, 0pt); -moz-transition-duration: 0s; width: 600%;">
<li style="display: block; float: left; width: 70px;"></li>
</ul>
</div>
<ol class="flex-control-nav flex-control-paging">
<li><a class="flex-active" href="https://www.blogger.com/blogger.g?blogID=2190029239849113272">1</a></li>
<li><a href="https://www.blogger.com/blogger.g?blogID=2190029239849113272">2</a></li>
</ol>
<ul class="flex-direction-nav">
<li><a class="flex-prev" href="http://www.protostack.com/#">Previous</a></li>
<li><a class="flex-next" href="http://www.protostack.com/#">Next</a></li>
</ul>
</div>
<div id="productDetails">
<h1 class="productGeneral" id="productName">
ATMEGA168A-PU Atmel 8 Bit 16K AVR Microcontroller</h1>
<ul class="floatingBox back" id="productDetailsList">
<li>Model: IC-ATMEGA168A-PU</li>
<li>Shipping Weight: 6g</li>
<li>65 Units in Stock</li>
<li>Manufactured by: ATMEL</li>
<li class="pdf"><a href="http://www.atmel.com/Images/Atmel-8271-8-bit-AVR-Microcontroller-ATmega48A-48PA-88A-88PA-168A-168PA-328-328P_datasheet.pdf" target="_blank">ATmega168A Datasheet</a></li>
</ul>
<br class="clearBoth" /></div>
<br />
The Atmel ATmega168A is a 16K 8-bit microcontroller based on the AVR
architecture and replaces the now obsolete ATmega168. Many instructions
are executed in a single clock cycle providing a throughput of almost 20
MIPS at 20MHz. The ATMEGA168A-PU comes in an PDIP 28 pin package and is
suitable for use on our <a href="http://www.protostack.com/product_by_model.php?model=PB-MC-AVR28">28 pin AVR Development Board</a>.<br />
<b>Features include:</b>
<br />
<ul>
<li>High Performance, Low Power Design</li>
<li>8-Bit Microcontroller Atmel® AVR® advanced RISC architecture</li>
<ul>
<li>131 Instructions most of which are executed in a single clock cycle</li>
<li>Up to 20 MIPS throughput at 20 MHz</li>
<li>32 x 8 working registers</li>
<li>2 cycle multiplier</li>
</ul>
<li>Memory Includes</li>
<ul>
<li>16KB of of programmable FLASH</li>
<li>512 Bytes of EEPROM</li>
<li>1KB SRAM</li>
<li>10,000 Write and Erase Cycles for Flash and 100,000 for EEPROM</li>
<li>Data retention for 20 years at 85°C and 100 years at 25°C</li>
<li>Optional boot loader with lock bits</li>
<ul>
<li>In System Programming (ISP) by via boot loader</li>
<li>True Read-While-Write operation</li>
</ul>
<li>Programming lock available for software security</li>
</ul>
<li>Features Include</li>
<ul>
<li>2 x 8-bit Timers/Counters each with independent prescaler and compare modes</li>
<li>A single 16-bit Timer/Counter with an idependent prescaler, compare and capture modes</li>
<li>Real time counter with independent oscillator</li>
<li>10 bit, 6 channel analog to digital Converter</li>
<li>6 pulse width modulation channels</li>
<li>Internal temperature sensor</li>
<li>Serial USART (Programmable)</li>
<li>Master/Slave SPI Serial Interface - (Philips I2C compatible)</li>
<li>Programmable watchdog timer with independent internal oscillator</li>
<li>Internal analog comparator</li>
<li>Interrupt and wake up on pin change</li>
</ul>
<li>Additional Features Features</li>
<ul>
<li>Internal calibrated oscillator</li>
<li>Power on reset and programmable brown out detection</li>
<li>External and internal interrupts</li>
<li>6 sleep modes including idle, ADC noise reduction, power save, power down, standby, and extended standby</li>
</ul>
<li>I/O and Package</li>
<ul>
<li>23 programmable I/O lines</li>
<li>28 pin PDIP package</li>
</ul>
<li>Operating voltage:</li>
<ul>
<li>1.8 - 5.5V</li>
</ul>
<li>Operating temperature range:</li>
<ul>
<li>40°C to 85°C</li>
</ul>
<li>Speed Grades:</li>
<ul>
<li>0-10 MHz at 2.7-5.5V</li>
<li>0-20 MHz at 4.5-5.5V</li>
</ul>
<li>Low power consumption mode at 1.8V, 1 MHz and 25°C:</li>
<ul>
<li>Active Mode: 0.3 mA</li>
<li>Power-down Mode: 0.1 μA</li>
<li>Power-save Mode: 0.8 μA (Including 32 kHz RTC)</li>
</ul>
</ul>
<table><tbody>
<tr><td>Flash:</td><td>16 KBytes</td></tr>
<tr><td>EEPROM:</td><td>512 Bytes</td></tr>
<tr><td>SRAM:</td><td>1024 Bytes</td></tr>
<tr><td>Max I/O Pins:</td><td>23</td></tr>
<tr><td>Frequency Max:</td><td>20 MHz</td></tr>
<tr><td>VCC:</td><td>1.8-5.5</td></tr>
<tr><td>10-bit A/D Channels:</td><td>6</td></tr>
<tr><td>Analog Comparator:</td><td>Yes</td></tr>
<tr><td>16-bit Timers:</td><td>1</td></tr>
<tr><td>8-bit Timer:</td><td>2</td></tr>
<tr><td>Brown Out Detector:</td><td>Yes</td></tr>
<tr><td>Ext Interrupts:</td><td>2</td></tr>
<tr><td>Hardware Multiplier:</td><td>Yes</td></tr>
<tr><td>Interrupts:</td><td>26</td></tr>
<tr><td>ISP:</td><td>Yes</td></tr>
<tr><td>On Chip Oscillator:</td><td>Yes</td></tr>
<tr><td>PWM Channels:</td><td>6</td></tr>
<tr><td>RTC:</td><td>Yes</td></tr>
<tr><td>Self Program Memory:</td><td>Yes</td></tr>
<tr><td>SPI:</td><td>1</td></tr>
<tr><td>TWI:</td><td>Yes</td></tr>
<tr><td>UART:</td><td>1</td></tr>
<tr><td>Watchdog:</td><td>Yes</td></tr>
<tr><td>Pacakage:</td><td>Lead Free PDIP 28</td><td></td><td></td><td></td><td></td><td></td><td></td><td style="text-align: justify;"></td></tr>
</tbody></table>
</div>
Anonymoushttp://www.blogger.com/profile/13526216155838659104noreply@blogger.com0tag:blogger.com,1999:blog-2190029239849113272.post-66085400657848964352014-03-09T23:31:00.000-07:002014-03-09T23:31:31.750-07:00A Portable lie-detector<div dir="ltr" style="text-align: left;" trbidi="on">
<b style="color: black;"><span style="line-height: 18.200000762939453px;"><span style="font-size: large;">A Portable lie-detector</span></span></b><br />
<br />
<br />
<br />
<br />
<br />
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-ch1y1_ov1XRq8XJzwiNVa6bkNjd6hTLB5_QCqz7Ipp0jufBiRq7Ty0lOsbkFv8i7-6De8psYGMoUAHAtq22pkrfkqOnpujmp2LlyL1ZRznI0HWzHs_FxIrfYN1I-D5Ny2kHTyTvdqHI/s1600/F7L3G3IFRML737Z.LARGE.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-ch1y1_ov1XRq8XJzwiNVa6bkNjd6hTLB5_QCqz7Ipp0jufBiRq7Ty0lOsbkFv8i7-6De8psYGMoUAHAtq22pkrfkqOnpujmp2LlyL1ZRznI0HWzHs_FxIrfYN1I-D5Ny2kHTyTvdqHI/s320/F7L3G3IFRML737Z.LARGE.jpg" width="320" /></a></div>
<div>
<span style="font-size: 14px; font-weight: normal; line-height: 18.200000762939453px;"><br /></span></div>
<h2 class="step-title" style="color: #333333; font-size: 18px; margin: 12px 0px; padding: 0px 0px 0px 25px; text-rendering: optimizelegibility;">
<span style="font-size: 14px; font-weight: normal; line-height: 18.200000762939453px;">This is a portable lie-detector built in a tin box . maybe you could have some fun using this thing.</span></h2>
<h2 style="text-align: left;">
<span style="font-size: 14px; font-weight: normal; line-height: 18.200000762939453px;">Note : this detector is less sensitive then a real one. this could be miss some (many) </span><span style="font-size: 14px; font-weight: normal; line-height: 18.200000762939453px;">of the lies.</span></h2>
<h2 class="step-title" style="color: #333333; font-size: 18px; margin: 12px 0px; padding: 0px 0px 0px 25px; text-rendering: optimizelegibility;">
<div class="step-container" style="font-size: 12px; margin-bottom: 40px;">
<h2 class="step-title" style="font-family: inherit; font-size: 18px; font-weight: normal; margin: 12px 0px; padding: 0px 0px 0px 25px; text-rendering: optimizelegibility;">
Things you'll need.</h2>
<div class="txt step-body" style="font-size: 14px; line-height: 1.3em; padding-left: 25px;">
<div class="instructions" style="font-weight: normal;">
You will need some things below for this project.<br />
<br />
1. circuit board<br />
2. 10K resister<br />
3. 47K resister<br />
4. 470 resister<br />
5. 1M resister x2<br />
6. 47K VR<br />
7. knob for VR<br />
8. 2N3904 transistor x3<br />
9. 0.1 ? mylar cap<br />
10. slide switch.<br />
11. 9V bettery snap<br />
12. LED (one red, one green)<br />
13. solding tools.<br />
14. drill<br />
15. basic tools,<br />
16. velcro (magic strip)<br />
17. aluminum foil<br />
....and most of all, a tin box </div>
<div class="instructions" style="font-weight: normal;">
</div>
<div class="" style="clear: both; text-align: center;">
<span style="font-size: 18px; line-height: 1.3em; text-align: left;">Make a finger pad</span></div>
<div class="" style="clear: both; text-align: center;">
<span style="font-weight: normal; line-height: 1.3em; text-align: left;">make a finger pads by sticking a aluminum foil to the velcro (strip)</span></div>
<div class="" style="clear: both; text-align: center;">
<span style="font-weight: normal; line-height: 1.3em; text-align: left;">And don' forget to stick a wire between the velcro and the foil!</span></div>
</div>
</div>
</h2>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNNeEK4khvAeBvvGhOmcTHi4KUCoD0AFKC3Tv6kVcBZTeD3KG7gkBxA4pcQ2-SZ5SKpphafK38vEAiSB6ZqKm3nn8mCYXQsmCR0ZUBIi3UBYZnWyLiA85yVupbEwmolj3K1qKs9BLa_Wo/s1600/FW7XNQSFRML73C1.LARGE.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNNeEK4khvAeBvvGhOmcTHi4KUCoD0AFKC3Tv6kVcBZTeD3KG7gkBxA4pcQ2-SZ5SKpphafK38vEAiSB6ZqKm3nn8mCYXQsmCR0ZUBIi3UBYZnWyLiA85yVupbEwmolj3K1qKs9BLa_Wo/s320/FW7XNQSFRML73C1.LARGE.jpg" width="320" /></a></div>
<h2 class="step-title" style="color: #333333; font-size: 18px; margin: 12px 0px; padding: 0px 0px 0px 25px; text-rendering: optimizelegibility;">
</h2>
<h2 class="step-title" style="color: #333333; font-size: 18px; margin: 12px 0px; padding: 0px 0px 0px 25px; text-rendering: optimizelegibility;">
</h2>
<h2 class="step-title" style="color: #333333; font-size: 18px; margin: 12px 0px; padding: 0px 0px 0px 25px; text-rendering: optimizelegibility;">
Soldering the circuit</h2>
<div class="txt step-body" style="color: #333333; font-size: 14px; font-weight: normal; line-height: 1.3em; padding-left: 25px;">
<div class="summary">
Solder the circuit as a diagram below. And before soldering the circuit, cut the circuit board to<br />
<br />
suitable size to fit in the tin</div>
</div>
<div class="ible-files" id="files" style="color: #333333; font-size: 12px; font-weight: normal; margin-top: 20px; padding-left: 25px;">
<a href="http://www.blogger.com/blogger.g?blogID=8332696345875982570" name="files" style="color: #ff5200; cursor: pointer;"></a></div>
<div class="inline-ads" style="color: #333333; font-size: 12px; font-weight: normal; padding-left: 25px;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcrW_nHG2-zQBZkNsk6CAtI8t0N1jxzJH0kdRHUl2ytST-3EKShku2BlzjNrUtgbl8w8u_KjuoK8xQ3CvFKo1iHjSez95EAbQRj5BCWE7kXHnsC1IL22nv-kDPxsf7d-0N9KRzQDfUKfg/s1600/F4EWPH0FRML73D7.LARGE.gif" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="179" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcrW_nHG2-zQBZkNsk6CAtI8t0N1jxzJH0kdRHUl2ytST-3EKShku2BlzjNrUtgbl8w8u_KjuoK8xQ3CvFKo1iHjSez95EAbQRj5BCWE7kXHnsC1IL22nv-kDPxsf7d-0N9KRzQDfUKfg/s320/F4EWPH0FRML73D7.LARGE.gif" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxdZoHq3GAqQPN9TM1xFie4qxVj51VF5OaANKuZmL-Sz8xS2KNOXBUD_edppo5MdFckbpU3Xf7RxCONKyjx35_NPFe9qHBrTFBOqKzPiYH4FqphBeT0_6xFQAJqHGeABax9eVCZ36swdo/s1600/FG9YZU5FRML73D6.LARGE.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxdZoHq3GAqQPN9TM1xFie4qxVj51VF5OaANKuZmL-Sz8xS2KNOXBUD_edppo5MdFckbpU3Xf7RxCONKyjx35_NPFe9qHBrTFBOqKzPiYH4FqphBeT0_6xFQAJqHGeABax9eVCZ36swdo/s320/FG9YZU5FRML73D6.LARGE.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjW6EDGkp3kOHfPOTlFwfv9VBC4fF7GozCscrHdupqlU05v2BKxQlPqRmNPO1PgbxPx24FMaymjkT31JKbOvb1M2QEEz8L_S923FFezPKrb3tevz-MRSw7296uU526pxhH3BFFCMnQb-H8/s1600/FRYF68CFRML73D5.LARGE.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjW6EDGkp3kOHfPOTlFwfv9VBC4fF7GozCscrHdupqlU05v2BKxQlPqRmNPO1PgbxPx24FMaymjkT31JKbOvb1M2QEEz8L_S923FFezPKrb3tevz-MRSw7296uU526pxhH3BFFCMnQb-H8/s320/FRYF68CFRML73D5.LARGE.jpg" width="320" /></a></div>
<h2 class="step-title" style="color: #333333; font-size: 18px; margin: 12px 0px; padding: 0px 0px 0px 25px; text-rendering: optimizelegibility;">
</h2>
<h2 class="step-title" style="color: #333333; font-size: 18px; margin: 12px 0px; padding: 0px 0px 0px 25px; text-rendering: optimizelegibility;">
Drilling the Tin case</h2>
<div class="txt step-body" style="color: #333333; font-size: 14px; font-weight: normal; line-height: 1.3em; padding-left: 25px;">
<div class="summary">
Drill the tin for a VR.<br />
<br />
and DO NOT use a sharp-end drill bit. it will tear the tin into half</div>
</div>
<div style="color: #333333; font-size: 18px;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHg9iu35jlRMqqkIyXwJ4yyxXChMmCKDSWiVgBgpBJWD2ODA3HnamJH-sV8hem3j0fC62FaTP9DcwKAJZggN5rRgFdv85wxv71AnhROhhR2wy7Y1Q7Hy8PKqqJL2VsbJRkxwYV5PCHoOE/s1600/FXT873KFRML73GV.LARGE.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHg9iu35jlRMqqkIyXwJ4yyxXChMmCKDSWiVgBgpBJWD2ODA3HnamJH-sV8hem3j0fC62FaTP9DcwKAJZggN5rRgFdv85wxv71AnhROhhR2wy7Y1Q7Hy8PKqqJL2VsbJRkxwYV5PCHoOE/s320/FXT873KFRML73GV.LARGE.jpg" width="320" /></a></div>
<h2 class="step-title" style="color: #333333; font-size: 18px; margin: 12px 0px; padding: 0px 0px 0px 25px; text-rendering: optimizelegibility;">
</h2>
<h2 class="step-title" style="color: #333333; font-size: 18px; margin: 12px 0px; padding: 0px 0px 0px 25px; text-rendering: optimizelegibility;">
Put the floor sheet</h2>
<div class="txt step-body" style="color: #333333; font-size: 14px; font-weight: normal; line-height: 1.3em; padding-left: 25px;">
<div class="summary">
Put the floor sheet in a floor of the tin to avoid it from 'short circuiting'.<br />
<br />
and secure it with a glue.<br />
<br />
in my case, I used a piece of box, and secure with a hot melt</div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSCHH99ivK4cJqfZ9GxGsXmSylaf_GtDB6pjVS1PNsPWZpMmQv9gTKmgFZ3fKbKvsJarkVXuyH5_hCS8xPEtckUubTn4OE7cZe26y8SOTY8qVnrCNn8i08_lkWmyYWBWo46U6TqcvT9_Y/s1600/FKWLNXVFRML73HX.LARGE.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSCHH99ivK4cJqfZ9GxGsXmSylaf_GtDB6pjVS1PNsPWZpMmQv9gTKmgFZ3fKbKvsJarkVXuyH5_hCS8xPEtckUubTn4OE7cZe26y8SOTY8qVnrCNn8i08_lkWmyYWBWo46U6TqcvT9_Y/s320/FKWLNXVFRML73HX.LARGE.jpg" width="320" /></a></div>
<h2 class="step-title" style="background-color: white; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 18px; margin: 12px 0px; padding: 0px 0px 0px 25px; text-rendering: optimizelegibility;">
</h2>
<h2 class="step-title" style="background-color: white; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 18px; margin: 12px 0px; padding: 0px 0px 0px 25px; text-rendering: optimizelegibility;">
Put everything in order</h2>
<div class="txt step-body" style="background-color: white; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.3em; padding-left: 25px;">
<div class="summary">
Put everything in the tin and secure all of them with a glue, hot melt, etc </div>
<div class="summary">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyxKRMW3ZAI9-RMYj_fhNk2Dz-Ch0TC61AlBheuCsgvPej8I0Q70urWR1JhtiGmuYvH-AZLbxJcQtRF3TAFqOfIsO8dpV8CCmma_EmV6zuxxZVOLjH6KvTrFFLIjZtgdXizQC3dhzmTOI/s1600/pro.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyxKRMW3ZAI9-RMYj_fhNk2Dz-Ch0TC61AlBheuCsgvPej8I0Q70urWR1JhtiGmuYvH-AZLbxJcQtRF3TAFqOfIsO8dpV8CCmma_EmV6zuxxZVOLjH6KvTrFFLIjZtgdXizQC3dhzmTOI/s320/pro.jpg" width="320" /></a></div>
<h2 class="step-title" style="font-size: 18px; line-height: normal; margin: 12px 0px; padding: 0px 0px 0px 25px; text-rendering: optimizelegibility;">
</h2>
<h2 class="step-title" style="font-size: 18px; line-height: normal; margin: 12px 0px; padding: 0px 0px 0px 25px; text-rendering: optimizelegibility;">
Done</h2>
<div class="txt step-body" style="line-height: 1.3em; padding-left: 25px;">
<div class="summary">
Now your lie detector is ready to go. first, put the finger pad to the finger of the 'suspect'<br />
then, slowly, turn the VR until the 'true' LED is light, and the 'false' LED is dark.<br />
then, ask a question to the suspect , when the false LED gets lighted, the suspect is lying<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcZs6-I10dua3KO0Zwor7QpVEWK7NIFxV1vv4qbK8eSQduPk2J_WKZCqaE2t2prpWzigSkuCYZK7AEIl4zlTc42qTozpoy-emzGgPgwq1u_7tCibYwHsznfnRo3O1wqZvwQu8l2WjEo08/s1600/FYGOVF5FRML73K4.LARGE.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcZs6-I10dua3KO0Zwor7QpVEWK7NIFxV1vv4qbK8eSQduPk2J_WKZCqaE2t2prpWzigSkuCYZK7AEIl4zlTc42qTozpoy-emzGgPgwq1u_7tCibYwHsznfnRo3O1wqZvwQu8l2WjEo08/s320/FYGOVF5FRML73K4.LARGE.jpg" width="320" /></a></div>
THANKS A LOT :)</div>
<div class="summary">
</div>
<div class="summary">
</div>
<div class="summary">
</div>
<div class="summary">
</div>
<div class="summary">
</div>
<div class="summary">
</div>
<div class="summary">
<a href="http://www.electronicsirfan.blogspot.com/" target="_blank"> </a></div>
<div class="summary">
<a href="http://www.electronicsirfan.blogspot.com/" target="_blank">Electronics lab Created by Muhammad irfan </a></div>
</div>
</div>
</div>
<br />
<div style="text-align: left;">
<br /></div>
<div class="step-title" style="margin: 12px 0px; padding: 0px 0px 0px 25px; text-align: left; text-rendering: optimizelegibility;">
<span style="line-height: 18.2px;"><span style="color: red; font-size: large;"> <span style="color: black;"></span> </span></span></div>
<div class="step-title" style="margin: 12px 0px; padding: 0px 0px 0px 25px; text-align: left; text-rendering: optimizelegibility;">
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/13526216155838659104noreply@blogger.com0tag:blogger.com,1999:blog-2190029239849113272.post-34217685623452646852014-01-30T23:58:00.002-08:002014-01-31T00:18:06.371-08:00Easy Way to install Proteus 7.6 SP4 <div dir="ltr" style="text-align: left;" trbidi="on">
<h3 style="text-align: center;">
Easy Way to install Proteus 7.6 SP4 </h3>
<div>
<span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;">[1] if you have a previous version of Proteus, you must first uninstall it.</span><br />
<span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;">[2] Download Proteus7.6 from</span><span style="font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;"><span style="background-color: #1c1c1c; color: lime;"> </span><a href="http://www.mediafire.com/download/q0ywmihyngw/Proteus+7.6SP4.rar#1" target="_blank"><span style="background-color: black; color: lime;">Here</span></a><span style="background-color: #1c1c1c; color: #dae1f0;">. </span></span><span id="summary832051875685304620" style="background-color: #1c1c1c; color: #dae1f0; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 22.17599868774414px;"></span><br />
<a href="https://www.blogger.com/blogger.g?blogID=2190029239849113272" name="more" style="background-color: #1c1c1c; color: #dae1f0; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 22.17599868774414px;"></a><span id="summary832051875685304620" style="background-color: #1c1c1c; color: #dae1f0; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 22.17599868774414px;"></span><br style="background-color: #1c1c1c; color: #dae1f0; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 22.17599868774414px;" />
<span id="summary832051875685304620" style="background-color: #1c1c1c; color: #dae1f0; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 22.17599868774414px;"></span><br style="background-color: #1c1c1c; color: #dae1f0; font-family: Verdana, Geneva, sans-serif; font-size: 16px; line-height: 22.17599868774414px;" />
<span style="background-color: #1c1c1c; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;"><span style="color: #dae1f0;">[3] Download the license file and the Crack from </span><a href="http://www.mediafire.com/?mnqnmiynjmy" style="text-decoration: none;"><span style="color: lime;">Here</span></a><span style="color: #dae1f0;">.</span><br /><br /><span style="color: #dae1f0;">[4] after downloading, open the Proteus 7.6SP4 Folder and select the setup.exe file as shown:</span></span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiY4S2fbNbxKb_gvGLEcsgFtDac6d-tSiN_IVWcRs_t4fhYNXvXl_RrmZOpYfoAGZwv-Smjb2y5TE0zsCr7HmbrTlgCecYCaJAXymlYEf9EcTUZmVlpUXBTY2W4GaDSZ9cWuuA0mwTcSPh8/s1600/2.JPG" style="color: #dd7700; text-decoration: none;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiY4S2fbNbxKb_gvGLEcsgFtDac6d-tSiN_IVWcRs_t4fhYNXvXl_RrmZOpYfoAGZwv-Smjb2y5TE0zsCr7HmbrTlgCecYCaJAXymlYEf9EcTUZmVlpUXBTY2W4GaDSZ9cWuuA0mwTcSPh8/s400/2.JPG" id="BLOGGER_PHOTO_ID_5471780321507397922" style="border: none; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; position: relative; text-align: center; width: 400px;" /></a></span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSCWNT6-KrhC_meNcOEyIypPJTNGxdUbsohoccPj8XFImbHeU1PxvvNah2wutlV8w_9dr1WN9T2lYTcbXyiFTa5Aqf7XBTVPkgPX8tN4s9cR1r1yrybBrkCpiwrBnRAC1kFj7T82hYagR7/s1600/1.JPG" style="color: #dd7700; text-decoration: none;"><br /></a>[5] Press Next<br /><br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjP-RIxCRhE4MwlenBhH5Gfu6Qda0llFfxgavQ_mGGh4TUl23Y9o7FQuKUWQ7O4JwJo3j6tgAUv5K7-IkfUYcI11vUX9dMr0XXEvr4OfLKTEicxPu0m4wGK5Y6V1BneUVFeBPqF9N04M0n2/s1600/3.JPG" style="color: #dd7700; text-decoration: none;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjP-RIxCRhE4MwlenBhH5Gfu6Qda0llFfxgavQ_mGGh4TUl23Y9o7FQuKUWQ7O4JwJo3j6tgAUv5K7-IkfUYcI11vUX9dMr0XXEvr4OfLKTEicxPu0m4wGK5Y6V1BneUVFeBPqF9N04M0n2/s400/3.JPG" id="BLOGGER_PHOTO_ID_5471780639832142754" style="border: none; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; position: relative; text-align: center; width: 400px;" /></a></span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;"><br />[6] select Yes:<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKxhWoiVx0NE5DtzTEsZ4MsuRRZS8qGQ9ZwvdfiNrWs8clOmxsq_6IMQ7xGKvnjTiq5KicgxrfZ1BvwbOnOpuLXv657YhkbmhWAnhkFNuzppKVR9MSbNfrmHQxif-j_qUgTcYpmEYUWdBe/s1600/4.JPG" style="color: #dd7700; text-decoration: none;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKxhWoiVx0NE5DtzTEsZ4MsuRRZS8qGQ9ZwvdfiNrWs8clOmxsq_6IMQ7xGKvnjTiq5KicgxrfZ1BvwbOnOpuLXv657YhkbmhWAnhkFNuzppKVR9MSbNfrmHQxif-j_qUgTcYpmEYUWdBe/s400/4.JPG" id="BLOGGER_PHOTO_ID_5471780918054918530" style="border: none; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; position: relative; text-align: center; width: 400px;" /></a></span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;">[7] Select the first option. then click Next :<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvK3P2jBxC7W0YsTzZFRy4NB_xJdPP-M_ML9HyoW_H1qr7JmjwrNGkOtAEh04Yf76CIbe9y4-qB3YtG8dxbNoKzTodIHUDBxI78DSrpiXBqQwxEiA5774vH0yVjWNNJGoCcq8d6kma3mi_/s1600/5.JPG" style="color: #dd7700; text-decoration: none;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvK3P2jBxC7W0YsTzZFRy4NB_xJdPP-M_ML9HyoW_H1qr7JmjwrNGkOtAEh04Yf76CIbe9y4-qB3YtG8dxbNoKzTodIHUDBxI78DSrpiXBqQwxEiA5774vH0yVjWNNJGoCcq8d6kma3mi_/s400/5.JPG" id="BLOGGER_PHOTO_ID_5471781257556441874" style="border: none; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; position: relative; text-align: center; width: 400px;" /></a></span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;">[8] if you didn't install it before, you will notice that there is no license file exist. if you installed it before you will automatically find the license. but ensure that it is valid and not expired. And if it is invalid, you must do the step in the notes bellow. So, press Next :<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJzDBbcB1ze20Z-LCHLS9C_kMgFl-j2UNmLyvEJudz80TF8ymtFUyeY3TLGQMixzI_BIPvZMs2jds_M21hFCVYy_4K1XLZAcFyTCuO9aUUxxrPQRSFCRbwgSZhpGvHACA3w6P8-xlpaQQZ/s1600/6.JPG" style="color: #dd7700; text-decoration: none;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJzDBbcB1ze20Z-LCHLS9C_kMgFl-j2UNmLyvEJudz80TF8ymtFUyeY3TLGQMixzI_BIPvZMs2jds_M21hFCVYy_4K1XLZAcFyTCuO9aUUxxrPQRSFCRbwgSZhpGvHACA3w6P8-xlpaQQZ/s400/6.JPG" id="BLOGGER_PHOTO_ID_5471782495428526674" style="border: none; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; position: relative; text-align: center; width: 400px;" /></a></span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;">[9] From the dialog appeared select browse for key file :<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTCaguztsWkeAqiomXAg1hhmNBpxhqNEO4OyfW-ndYgvAJKSCmMluyXZLzDEqDJB90hNYxa7Ty07JcivfJgWf1aqGo6ITmI6UwlKSdjWC-w4G9UFfTXoTQDbNz4PV25EbwlVdbr0I3uk_W/s1600/7.JPG" style="color: #dd7700; text-decoration: none;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTCaguztsWkeAqiomXAg1hhmNBpxhqNEO4OyfW-ndYgvAJKSCmMluyXZLzDEqDJB90hNYxa7Ty07JcivfJgWf1aqGo6ITmI6UwlKSdjWC-w4G9UFfTXoTQDbNz4PV25EbwlVdbr0I3uk_W/s400/7.JPG" id="BLOGGER_PHOTO_ID_5471782876873956514" style="border: none; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; position: relative; text-align: center; width: 400px;" /></a></span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;">[10] you will find the license file in the crack folder that you've downloaded at step[3] select the license file "Sonsivri" then select open:<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRATugXpqJ4GKTB0oDLsaozokpb-yVvDLIaG8vMJpRLCk1y73JoCzL2y9z5Oo_oXD8i4A-aaLjwWLaCn2dAAwec7J-zZOeKKyishqaQ9KT31YxJzg1pXZE5bT_bNuml3Bczmtb0aCFqoF0/s1600/8.JPG" style="color: #dd7700; text-decoration: none;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRATugXpqJ4GKTB0oDLsaozokpb-yVvDLIaG8vMJpRLCk1y73JoCzL2y9z5Oo_oXD8i4A-aaLjwWLaCn2dAAwec7J-zZOeKKyishqaQ9KT31YxJzg1pXZE5bT_bNuml3Bczmtb0aCFqoF0/s400/8.JPG" id="BLOGGER_PHOTO_ID_5471783375615755554" style="border: none; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; position: relative; text-align: center; width: 400px;" /></a></span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;"><br />[11] Select install :<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCajFPrOzDjn_X5utLU4BhrPsK9A3f4BHJvQGsJwBBx-XhDR9ILvedN49-4vWCpmuZD9kMdhI-F06UOvUxJ-YAxc16q9lDjqJa-SXV4a8MNRXEiaG_hJua6qh3tx4eA9XTHzi9-_Exk7NM/s1600/9.JPG" style="color: #dd7700; text-decoration: none;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCajFPrOzDjn_X5utLU4BhrPsK9A3f4BHJvQGsJwBBx-XhDR9ILvedN49-4vWCpmuZD9kMdhI-F06UOvUxJ-YAxc16q9lDjqJa-SXV4a8MNRXEiaG_hJua6qh3tx4eA9XTHzi9-_Exk7NM/s400/9.JPG" id="BLOGGER_PHOTO_ID_5471783879447768466" style="border: none; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; position: relative; text-align: center; width: 400px;" /></a></span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;"><br />[12] a confirmation dialog will appear. select Yes :<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfHNTYdo6ExsFWf6EqY12OYS7R6vmACbAfKJSORtuNOgf_94Vy5rFjqrfe5zkPBXiYaE2NFHpdAOKGBY3-JTnUl0GJaSAZWXSpVY_ZIR1go0ylTCnhZ5dAiNuSk-OTE4aVU-Y_Glkj88Mr/s1600/10.JPG" style="color: #dd7700; text-decoration: none;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfHNTYdo6ExsFWf6EqY12OYS7R6vmACbAfKJSORtuNOgf_94Vy5rFjqrfe5zkPBXiYaE2NFHpdAOKGBY3-JTnUl0GJaSAZWXSpVY_ZIR1go0ylTCnhZ5dAiNuSk-OTE4aVU-Y_Glkj88Mr/s400/10.JPG" id="BLOGGER_PHOTO_ID_5471784294185785906" style="border: none; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; position: relative; text-align: center; width: 400px;" /></a></span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;"><br />[13] you will see the items moved to the right side. So, select Close :<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirdDYl07ATWJBx8xOBaJ_Wlwe5VHlZTbVxEUgC82yhwpg_uBvi0b-Z-LgJr8uaroc-cYHoPn0B5lXB82RGUdkzdWyV-X1nxEko-oMIVJjaZQsPe37cZqMvTL2fn4zJT1n6ZIuajsHBzqYl/s1600/11.JPG" style="color: #dd7700; text-decoration: none;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirdDYl07ATWJBx8xOBaJ_Wlwe5VHlZTbVxEUgC82yhwpg_uBvi0b-Z-LgJr8uaroc-cYHoPn0B5lXB82RGUdkzdWyV-X1nxEko-oMIVJjaZQsPe37cZqMvTL2fn4zJT1n6ZIuajsHBzqYl/s400/11.JPG" id="BLOGGER_PHOTO_ID_5471784723759430098" style="border: none; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; position: relative; text-align: center; width: 400px;" /></a></span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;">[14] after ensuring that the Expiry date is 1/1/2030, select Next :<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYlSYxRdRmvi8ZYTgiC4GMST8UnI3a-r4_8xvOIacYMpiMXyDGWkffZ8mGmjegMDfTAL9BVUa_GYN-LKWRhoGag__AhdDV2zLQV-gXSBGDxh3_cCXEojQJDCyL_H6_uUa26VjG_NyMIb1J/s1600/12.JPG" style="color: #dd7700; text-decoration: none;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYlSYxRdRmvi8ZYTgiC4GMST8UnI3a-r4_8xvOIacYMpiMXyDGWkffZ8mGmjegMDfTAL9BVUa_GYN-LKWRhoGag__AhdDV2zLQV-gXSBGDxh3_cCXEojQJDCyL_H6_uUa26VjG_NyMIb1J/s400/12.JPG" id="BLOGGER_PHOTO_ID_5471785182527971426" style="border: none; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; position: relative; text-align: center; width: 400px;" /></a></span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;"><br />[15] Select Next :<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCiy0ixhkzdVLB1256tr6MG0_wCRAOBOgfUWZSnKgBSoUu47_jxYoMQGsGQtG6OPbVgUi2EddDiIrMt1YRY02vw8xccjV7JHeqQzxn7GkuQgg-Dg2DHtjyOZgk_eI7jzip3EG1j1iLfQpB/s1600/13.JPG" style="color: #dd7700; text-decoration: none;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCiy0ixhkzdVLB1256tr6MG0_wCRAOBOgfUWZSnKgBSoUu47_jxYoMQGsGQtG6OPbVgUi2EddDiIrMt1YRY02vw8xccjV7JHeqQzxn7GkuQgg-Dg2DHtjyOZgk_eI7jzip3EG1j1iLfQpB/s400/13.JPG" id="BLOGGER_PHOTO_ID_5471786253073815410" style="border: none; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; position: relative; text-align: center; width: 400px;" /></a></span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;">[16] Then, Next:<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4x0w68PBOe4h7LmGvBzGXzDBAOlbHsi4MHl7BoQ4VLJHl0RNrf1FveOjnohlbdoKyxbWOBeexaQ0_3gkU2zTIoGjsPRjz1z7eSVq7B4-DeJ-TDCILv0-Tf1wrug3ZXWUTTMwhi-MjEeno/s1600/14.JPG" style="color: #dd7700; text-decoration: none;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4x0w68PBOe4h7LmGvBzGXzDBAOlbHsi4MHl7BoQ4VLJHl0RNrf1FveOjnohlbdoKyxbWOBeexaQ0_3gkU2zTIoGjsPRjz1z7eSVq7B4-DeJ-TDCILv0-Tf1wrug3ZXWUTTMwhi-MjEeno/s400/14.JPG" id="BLOGGER_PHOTO_ID_5471786960167687714" style="border: none; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; position: relative; text-align: center; width: 400px;" /></a></span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;"><br />[17] Then, Next:<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoPJZYhqjvCjaxEUZGP7eIZwdUwxYxCbuIP6rGf4LtRNMlQbgx1EPgSWQwB81vjzJ9WOwl_gZ6qYHnmPpiYvUbtB7IexUvRXnSU0BzQiNEEx-8Su2ETUR6GZr-606X7X0dNZFG-El-371K/s1600/15.JPG" style="color: #dd7700; text-decoration: none;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoPJZYhqjvCjaxEUZGP7eIZwdUwxYxCbuIP6rGf4LtRNMlQbgx1EPgSWQwB81vjzJ9WOwl_gZ6qYHnmPpiYvUbtB7IexUvRXnSU0BzQiNEEx-8Su2ETUR6GZr-606X7X0dNZFG-El-371K/s400/15.JPG" id="BLOGGER_PHOTO_ID_5471786960808553602" style="border: none; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; position: relative; text-align: center; width: 400px;" /></a></span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;"><br />[18] Now you are installing the program. So, be patient for a while :<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcuggnEc0Bkabk-zIYg6cq2Ah9Eh5T83yXrH8ah-wFgOdJ4C6SnBZyLlXjJwUyehtUszZziVynDwQ3xHm-_POCazO2-HWW-lMP4Lq8aga7xzfH0aGIfFDRj5thsCb6_AtByM6mg60RunjV/s1600/16.JPG" style="color: #dd7700; text-decoration: none;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcuggnEc0Bkabk-zIYg6cq2Ah9Eh5T83yXrH8ah-wFgOdJ4C6SnBZyLlXjJwUyehtUszZziVynDwQ3xHm-_POCazO2-HWW-lMP4Lq8aga7xzfH0aGIfFDRj5thsCb6_AtByM6mg60RunjV/s400/16.JPG" id="BLOGGER_PHOTO_ID_5471786965661634706" style="border: none; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; position: relative; text-align: center; width: 400px;" /></a></span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;">[19] after finishing installation, Select Finish :<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEpbOjwlaYEcxa31crcWb7rkKEOfRi4XF4es_m8idMMFMbySDs4Vjuv3MfPsWmGdfDct37sj3zn3NYf9ajqsWHoJmpYPnDNF_qoinjdJiVSGHWVG4JbU32yqIYCOP1-khayCIDmaS4XxQh/s1600/17.JPG" style="color: #dd7700; text-decoration: none;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEpbOjwlaYEcxa31crcWb7rkKEOfRi4XF4es_m8idMMFMbySDs4Vjuv3MfPsWmGdfDct37sj3zn3NYf9ajqsWHoJmpYPnDNF_qoinjdJiVSGHWVG4JbU32yqIYCOP1-khayCIDmaS4XxQh/s400/17.JPG" id="BLOGGER_PHOTO_ID_5471787510500896402" style="border: none; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; position: relative; text-align: center; width: 400px;" /></a></span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;"> <span style="font-weight: bold;"><br />Now we will show how to install the Crack :</span><br />[1] go to the crack folder you've downloaded at step [3] and copy the patch file:<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj06rR-bUJ1xO1Sz3giX103gw50QDKLVacqt4fG1lyJ_jeJKptWKTE2Lc9AaUhObMztG6y4veIfq6VaP_zaIlCYLxlSO61bXfBEY4HCGKLwk6T63uqv_GZ0AdspVQiVv136Dy503zKITqfu/s1600/19.JPG" style="color: #dd7700; text-decoration: none;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj06rR-bUJ1xO1Sz3giX103gw50QDKLVacqt4fG1lyJ_jeJKptWKTE2Lc9AaUhObMztG6y4veIfq6VaP_zaIlCYLxlSO61bXfBEY4HCGKLwk6T63uqv_GZ0AdspVQiVv136Dy503zKITqfu/s400/19.JPG" id="BLOGGER_PHOTO_ID_5471788095381642450" style="border: none; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; position: relative; text-align: center; width: 400px;" /></a></span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;">[2] Paste the file into the Program installation folder in program files:</span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; font-style: italic; line-height: 22.17599868774414px;">"C:\Program Files\Labcenter Electronics\Proteus 7 Professional"</span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4nZuPJMSTwOSVzpm8wTBLUMhbVKN6yF5tdbCtt_ND98sMOtqJCX4ddrU0WHxxvSSa4trVuDmzazaod-xjk8n4688u6NOurOhY56ORJ2y3yKbqECeUrsN6JkxnBmyU00d2fMxVeVpGX_2o/s1600/20.JPG" style="color: #dd7700; text-decoration: none;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4nZuPJMSTwOSVzpm8wTBLUMhbVKN6yF5tdbCtt_ND98sMOtqJCX4ddrU0WHxxvSSa4trVuDmzazaod-xjk8n4688u6NOurOhY56ORJ2y3yKbqECeUrsN6JkxnBmyU00d2fMxVeVpGX_2o/s400/20.JPG" id="BLOGGER_PHOTO_ID_5471788727084435250" style="border: none; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; position: relative; text-align: center; width: 400px;" /></a></span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;">[3] Run the Patch file and press Patch :<br />Note: for </span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: Verdana, Geneva, sans-serif; font-size: 16px; font-style: italic; line-height: 22.17599868774414px;">windows Vista</span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;"> and </span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: Verdana, Geneva, sans-serif; font-size: 16px; font-style: italic; line-height: 22.17599868774414px;">windows 7</span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;"> you must run it as an administrator by right click on the file and select "run as an administrator"</span><br />
<h3 style="text-align: left;">
<ul style="text-align: left;">
<li><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; line-height: 22.17599868774414px;">Also if you have any antivirus software so disable this first and then open the Patch file </span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; line-height: 22.17599868774414px;"> .</span></li>
</ul>
</h3>
<span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;"><br /></span>
<span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;"><br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7iRc-CCL48kABVO947ng7clySzjMp9ASHO58LOtnjwUIiu0SQv_stWqYgyMbLvC95Q7R_zDWAD_Ll8X_4UIjQO7maO-9lH0GCac3968ftrIyrnajILQkp12oJGkYh0qMrFTIPMS-ELxvn/s1600/21.JPG" style="color: #dd7700; text-decoration: none;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7iRc-CCL48kABVO947ng7clySzjMp9ASHO58LOtnjwUIiu0SQv_stWqYgyMbLvC95Q7R_zDWAD_Ll8X_4UIjQO7maO-9lH0GCac3968ftrIyrnajILQkp12oJGkYh0qMrFTIPMS-ELxvn/s400/21.JPG" id="BLOGGER_PHOTO_ID_5471789544826046978" style="border: none; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; position: relative; text-align: center; width: 400px;" /></a></span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;">[4] a message will appear asking for a missing file "ISIS.EXE". So, go to:</span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; font-style: italic; line-height: 22.17599868774414px;">"C:\Program Files\Labcenter Electronics\Proteus 7 Professional\BIN"</span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;"><br />and point to the file:<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFm_1pvF9kKYVy5XU-4mUmyXTFnwTIoom0dlBDv9-4i_obIOinYT613M4doBcp9_-k4tcZ2_h9VOVr7oRxODE8t5ZDN4UZS6VB9Ssy3imupje8mPxCULvq3G4W0S9RpspqHCIwvwDhfhsP/s1600/23.JPG" style="color: #dd7700; text-decoration: none;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFm_1pvF9kKYVy5XU-4mUmyXTFnwTIoom0dlBDv9-4i_obIOinYT613M4doBcp9_-k4tcZ2_h9VOVr7oRxODE8t5ZDN4UZS6VB9Ssy3imupje8mPxCULvq3G4W0S9RpspqHCIwvwDhfhsP/s400/23.JPG" id="BLOGGER_PHOTO_ID_5471790228394783010" style="border: none; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; position: relative; text-align: center; width: 400px;" /></a></span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;">[5] another message asking for a missing file "82XX.DLL" so, go to</span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; font-style: italic; line-height: 22.17599868774414px;">"C:\Program Files\Labcenter Electronics\Proteus 7 Professional\MODELS"</span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;"><br />and point to the file:<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgNyTN12XcaU-KeiDSq6qHkVy9owIqnWKCe1a3bXr2omJvg4n_XGOrI3QK6X37pkxUdm9bxu4cXnxr2QwFj1M0FUjW862cRL-HHi4U5my2olBkaT0QQ00HKv_UbM46sKFTLBfZgSfHNoGW/s1600/25.JPG" style="color: #dd7700; text-decoration: none;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgNyTN12XcaU-KeiDSq6qHkVy9owIqnWKCe1a3bXr2omJvg4n_XGOrI3QK6X37pkxUdm9bxu4cXnxr2QwFj1M0FUjW862cRL-HHi4U5my2olBkaT0QQ00HKv_UbM46sKFTLBfZgSfHNoGW/s400/25.JPG" id="BLOGGER_PHOTO_ID_5471790839609034562" style="border: none; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; position: relative; text-align: center; width: 400px;" /></a></span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;">[6] after patching done click Exit:<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDi8u1ZsMHKMaLyh9iURb1oZvuVFTPcFMyKzB44T68tM6cMUGqROgaG96cv_eJfWlJiQb5yrI1fgsvcRFmKcKxSl7UnD4g2vt6YKeRHAcnWpXPXSi-IVReG8s4xRsEWTOqhmZ2Hn3gIJ7g/s1600/26.JPG" style="color: #dd7700; text-decoration: none;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDi8u1ZsMHKMaLyh9iURb1oZvuVFTPcFMyKzB44T68tM6cMUGqROgaG96cv_eJfWlJiQb5yrI1fgsvcRFmKcKxSl7UnD4g2vt6YKeRHAcnWpXPXSi-IVReG8s4xRsEWTOqhmZ2Hn3gIJ7g/s400/26.JPG" id="BLOGGER_PHOTO_ID_5471791209194637234" style="border: none; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; position: relative; text-align: center; width: 400px;" /></a></span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;">[7] Now you have finished installing the program. to run it go to</span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; font-style: italic; line-height: 22.17599868774414px;">" Start Menu>>All Programs>>Proteus 7 Professional>> ISIS7 Professional "</span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZz142NGQY4kzzny0UBdNaKcgOVqvSyYDPl56xo9ZXQWZ8Bs6uMoG6HWxIMHfRK_m_Bo08NWjk3TvlI4S_bjNp0nD5dkaWVgB_5qExQ_pdYSFsIIjCFOhyphenhyphenurZ1u6-1imfNH9w11lpcVd-A/s1600/27.JPG" style="color: #dd7700; text-decoration: none;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZz142NGQY4kzzny0UBdNaKcgOVqvSyYDPl56xo9ZXQWZ8Bs6uMoG6HWxIMHfRK_m_Bo08NWjk3TvlI4S_bjNp0nD5dkaWVgB_5qExQ_pdYSFsIIjCFOhyphenhyphenurZ1u6-1imfNH9w11lpcVd-A/s400/27.JPG" id="BLOGGER_PHOTO_ID_5471791910081877810" style="border: none; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; position: relative; text-align: center; width: 400px;" /></a></span><span style="background-color: #1c1c1c; color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px;"><br /></span><br />
<div style="background-color: #1c1c1c; text-align: center;">
<span style="color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; font-weight: bold; line-height: 22.17599868774414px;">___________</span><br />
<div style="color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px; text-align: justify;">
<span style="font-weight: bold;">Notes:</span><br />
if you installed it before with an <span style="font-style: italic;">invalid</span> License file you can do this step after finishing installing the program and crack :<br />
go to <span style="font-style: italic;">" Start Menu>>All Programs>>Proteus 7 Professional>> Licence Manager"<br />and do the steps from [9] to [13].</span></div>
<div style="color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px; text-align: justify;">
<span style="font-style: italic;"><br /></span></div>
<div style="color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px; text-align: justify;">
<span style="font-style: italic;"><br /></span></div>
<div style="text-align: justify;">
<span style="color: #dae1f0; font-family: trebuchet ms;"><span style="line-height: 22.17599868774414px;"><i>Thanks u for learning ......</i></span></span></div>
<div style="color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px; text-align: justify;">
<span style="font-style: italic;"><br /></span></div>
<div style="color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px; text-align: justify;">
<span style="font-style: italic;"><br /></span></div>
<div style="color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px; text-align: justify;">
<span style="font-style: italic;"><br /></span></div>
<div style="color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px; text-align: justify;">
<span style="font-style: italic;"><br /></span></div>
<div style="color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px; text-align: justify;">
<span style="font-style: italic;"><br /></span></div>
<div style="color: #dae1f0; font-family: 'trebuchet ms'; font-size: 16px; line-height: 22.17599868774414px; text-align: justify;">
<span style="font-style: italic;">Electronics Lab Created By Muhammad Irfan </span></div>
</div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/13526216155838659104noreply@blogger.com3tag:blogger.com,1999:blog-2190029239849113272.post-39206560903722494062014-01-20T05:06:00.001-08:002014-02-07T07:29:30.404-08:00Electronics Softwares Store<div dir="ltr" style="text-align: left;" trbidi="on">
Best Free Electronics Useful Software Collection ......<br />
<br />
<br />
<ol style="text-align: left;">
<li><h3 style="text-align: left;">
<a href="http://www.4shared.com/file/M3OsQR55ce/keil_u_version.html" target="_blank">Kiel u version</a></h3>
</li>
<li><h3 style="text-align: left;">
<a href="http://www.4shared.com/file/trz9Nqejba/setup76.html" target="_blank">Proteus_7.6 </a> Crack file download from <a href="http://www.4shared.com/file/UWNK99TEce/Grassington_North_Yorkshire.html" target="_blank"> Here </a></h3>
</li>
<li><h3 style="text-align: left;">
<a href="https://skydrive.live.com/redir?resid=53FCCB081C08310E!108&authkey=!AKWiQdMMnlS6roU&ithint=file%2c.rar" target="_blank">Pinacle</a></h3>
</li>
</ol>
<h3>
Protel99se (Licenced)</h3>
<h3 style="text-align: left;">
NEW SERIAL PORT SOTFWARES .....<br /><ol style="text-align: left;">
<li><a href="https://skydrive.live.com/redir?resid=53FCCB081C08310E%21168" target="_blank">virtual serial port driver</a></li>
<li><a href="https://skydrive.live.com/redir?resid=53FCCB081C08310E%21173" target="_blank">hyper-terminal</a></li>
<li><a href="https://skydrive.live.com/redir?resid=53FCCB081C08310E%21167" target="_blank">free-virtual-serial-ports</a></li>
<li><a href="https://skydrive.live.com/redir?resid=53FCCB081C08310E%21169" target="_blank">free-serial-port-monitor</a></li>
<li><a href="https://skydrive.live.com/redir?resid=53FCCB081C08310E%21174" target="_blank">advanced serial port monitor 4</a></li>
<li><a href="https://skydrive.live.com/redir?resid=53FCCB081C08310E%21164" target="_blank">Serial port programmer software</a></li>
</ol>
</h3>
<h3>
</h3>
<h3>
How to download ...</h3>
<h3>
Step1 : Click on any link ,so this page wil be open ....</h3>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7INkaoOvFjpbmbB5jEraR1LhnVF1NyCYelohuvq7kq33ZwtNf0fU_5YbGlKO2pEK1gn1l6Of7a87ukZPB5V5_87IQZTDZsQYmz7uPVYFdLjLudleD1Tzjv8Y2XHD-fisirG4AjmlYkweC/s1600/down+1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7INkaoOvFjpbmbB5jEraR1LhnVF1NyCYelohuvq7kq33ZwtNf0fU_5YbGlKO2pEK1gn1l6Of7a87ukZPB5V5_87IQZTDZsQYmz7uPVYFdLjLudleD1Tzjv8Y2XHD-fisirG4AjmlYkweC/s1600/down+1.png" height="250" width="400" /></a></div>
<br /><h3>
Step2: Now When you click on given link this window will be open ...</h3>
<br /><br /><div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjiocllXDbY0aPudHfrNyXUmUsmnaGolkc1amiOeBhNoJpJ-kwZscH1riIXZwdHYCKbxdmlD_cFOq3uScbTQW8lowqln0FgHXoOVvdLBFIn0DNP2ytqKhNdAW_eqwoL53Tfk9c_7XL25CU/s1600/driv2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjiocllXDbY0aPudHfrNyXUmUsmnaGolkc1amiOeBhNoJpJ-kwZscH1riIXZwdHYCKbxdmlD_cFOq3uScbTQW8lowqln0FgHXoOVvdLBFIn0DNP2ytqKhNdAW_eqwoL53Tfk9c_7XL25CU/s1600/driv2.png" height="250" width="400" /></a></div>
<h3>
</h3>
<div>
<br /></div>
<div>
<br /></div>
<div>
Electronics Lab created by Muhammad Irfan</div>
<ol style="text-align: left;">
</ol>
</div>
Anonymoushttp://www.blogger.com/profile/13526216155838659104noreply@blogger.com0tag:blogger.com,1999:blog-2190029239849113272.post-35046766879558741242014-01-15T23:31:00.003-08:002014-01-16T00:26:18.744-08:00Common Book shop<div dir="ltr" style="text-align: left;" trbidi="on">
In This post you can easy Download some important books<br />
<br />
<br />
<br />
<ol style="text-align: left;"></ol>
<ol style="text-align: left;">
<li><ul>
<li><h3>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg679F_Wh4g_8omurDl3ap9VjwQbHJp1W4aZi9dF_-BoX2VWMmo3UByyBToae4a8Nfaol1jN81S8dkwaHx8xhzns-TpujBYlw54_zmRsN2NcfMt4p3xZZKuDntDvWeAjRGRnNGJ5118fiSj/s1600/300x300_c842439d1457675c09d9482976586b28.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg679F_Wh4g_8omurDl3ap9VjwQbHJp1W4aZi9dF_-BoX2VWMmo3UByyBToae4a8Nfaol1jN81S8dkwaHx8xhzns-TpujBYlw54_zmRsN2NcfMt4p3xZZKuDntDvWeAjRGRnNGJ5118fiSj/s1600/300x300_c842439d1457675c09d9482976586b28.jpg" height="200" width="200" /></a><a href="https://drive.google.com/file/d/0B9KWOwumbHAnVVoza0ZQM2VSZG8/edit?usp=sharing" target="_blank">Best English Learning Book Through Urdu (1st)</a></h3>
</li>
</ul>
<ul>
<li><h3>
<a href="https://drive.google.com/file/d/0B9KWOwumbHAnaHpZZkp4NVNTams/edit?usp=sharing" target="_blank">Best English Book</a><a href="https://drive.google.com/file/d/0B9KWOwumbHAnaHpZZkp4NVNTams/edit?usp=sharing" target="_blank">(2nd)</a></h3>
</li>
</ul>
</li>
</ol>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Electronics Lab Created By Muhammad Irfan</div>
Anonymoushttp://www.blogger.com/profile/13526216155838659104noreply@blogger.com0tag:blogger.com,1999:blog-2190029239849113272.post-90950323179210631552014-01-15T03:23:00.001-08:002014-01-16T03:33:27.304-08:00Electronics Books<h3 style="text-align: center;">
<span style="font-size: medium;">Electronics Books Free Download</span></h3>
<div style="text-align: center;">
<br /></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtG-b3GugQMHdWU_nhb6SS6l2-__y-qbKIetYPsrHJzZxNfyzeGrTDQPdaYdZ_9ts3lnLBqVWZ19tl9LFqZUx8xw6SkmJqowXtM7hjokoVKADAVAP4v2ak8xTIliOQ1CbfXrXM94FFTlU/s1600/stack_of_books-630x419.jpg" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtG-b3GugQMHdWU_nhb6SS6l2-__y-qbKIetYPsrHJzZxNfyzeGrTDQPdaYdZ_9ts3lnLBqVWZ19tl9LFqZUx8xw6SkmJqowXtM7hjokoVKADAVAP4v2ak8xTIliOQ1CbfXrXM94FFTlU/s320/stack_of_books-630x419.jpg" height="209" width="320" /></a><span style="font-size: medium;"> </span><br />
<div style="text-align: left;">
<br />
<ol>
</ol>
</div>
<div style="text-align: left;">
<br />
<ol>
</ol>
</div>
<div style="text-align: left;">
<br />
<ol>
</ol>
</div>
<div style="text-align: left;">
<br />
<ol>
</ol>
</div>
<div style="text-align: left;">
<br />
<ol>
</ol>
</div>
<div style="text-align: left;">
<br />
<ol>
</ol>
</div>
<div style="text-align: left;">
<div style="text-align: justify;">
Here you can easily Download any Electronics Book</div>
<ol>
<li><h3>
<a href="https://drive.google.com/file/d/0B1wmyoPmGY2EMzhzRVU1Tksta0U/edit?usp=sharing" target="_blank">8051 Programming Tutorial Book (1)</a></h3>
</li>
<li><h3>
<a href="https://drive.google.com/file/d/0B1wmyoPmGY2ERmlacFNJRjlNMVU/edit?usp=sharing" target="_blank">8051 Programming Tutorial Book (2)</a></h3>
</li>
<li><h3>
<a href="https://drive.google.com/file/d/0B1wmyoPmGY2EX29MTnpaQmt1cDg/edit?usp=sharing" target="_blank">Antenna Design</a> </h3>
</li>
<li><h3>
<a href="https://drive.google.com/file/d/0B1wmyoPmGY2Eb0x2VWY4bkhaX0E/edit?usp=sharing" target="_blank">Brushless DC (BLDC) Motor Fundamentals</a></h3>
</li>
<li><h3>
<a href="https://drive.google.com/file/d/0B1wmyoPmGY2ERmltSFpBUzhBS1E/edit?usp=sharing" target="_blank">business_model_canvas_poster</a></h3>
</li>
<li><h3>
<a href="https://drive.google.com/file/d/0B1wmyoPmGY2ERmltSFpBUzhBS1E/edit?usp=sharing" target="_blank">business_model_canvas_poster</a></h3>
</li>
<li><h3>
<a href="http://c++_by_dissection_%282002%29/" target="_blank">C++_By_Dissection_(2002) </a></h3>
</li>
<li><h3>
<a href="https://drive.google.com/file/d/0B1wmyoPmGY2ES1VuZVhMOExweVE/edit?usp=sharing" target="_blank">Data_Communications_and_Networking_-_Behrouz_A._Forouzan</a></h3>
</li>
<li><h3>
<a href="https://drive.google.com/file/d/0B1wmyoPmGY2EVHlldEF2RU5oSnM/edit?usp=sharing" target="_blank">ebooksclub.org__Confronting_Climate_Change__Shortcuts_</a></h3>
</li>
<li><h3>
<a href="https://drive.google.com/file/d/0B1wmyoPmGY2EYXVVbmt3Uk03NGc/edit?usp=sharing" target="_blank">Filters</a></h3>
</li>
<li><h3>
<a href="https://drive.google.com/file/d/0B1wmyoPmGY2EOEhQZWtMb0NOeDQ/edit?usp=sharing" target="_blank">Java How to Program 9th Edition</a></h3>
</li>
<li><h3>
<a href="https://drive.google.com/file/d/0B1wmyoPmGY2EWll5TUg0TWtVUlk/edit?usp=sharing" target="_blank">Linux C++ Programming HOWTO</a></h3>
</li>
<li><h3>
<a href="https://drive.google.com/file/d/0B1wmyoPmGY2ES1lTYUlJZGMzbVU/edit?usp=sharing" target="_blank">Robot Simulator</a></h3>
</li>
<li><h3>
<a href="https://drive.google.com/file/d/0B1wmyoPmGY2ENEdJbFE4d1EyOVE/edit?usp=sharing" target="_blank">Sams Teach Yourself C++ for Linux in 21 Days</a></h3>
</li>
<li><h3>
<a href="https://drive.google.com/file/d/0B1wmyoPmGY2EZXBHVDNHVW52OWc/edit?usp=sharing" target="_blank">Startup An Insider’s Guide to Launching and Running a Business </a></h3>
</li>
</ol>
<ol>
</ol>
</div>
<div style="text-align: center;">
</div>
Anonymoushttp://www.blogger.com/profile/13526216155838659104noreply@blogger.com0tag:blogger.com,1999:blog-2190029239849113272.post-15420736123643560262014-01-07T08:27:00.001-08:002014-01-07T08:27:47.739-08:00555 timer IC Inverter 12V to 220V<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">This article explains </span><b style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">What is inverter</b><span style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">? And how can you construct your own simple low cost </span><b style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">12V to 220V inverter circuit</b><span style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">. An inverter is nothing but a </span><b style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">DC to AC converter</b><span style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">. Inverters are very useful electronics products for compensating emergency power failure, as it performs DC to AC conversion.</span><br />
<div style="background-color: white; color: white; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">
CBZ4DUQZD2JF</div>
<span style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">AC can’t be stored for future use but DC can be stored for future use in a battery. The stored DC can be converted back to AC by using power inverters.</span><br />
<a href="https://www.blogger.com/blogger.g?blogID=2190029239849113272" name="more" style="background-color: white; color: #2776c6; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify; text-decoration: underline;"></a><span style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">Here is the simple </span><b style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">inverter circuit</b><span style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;"> diagram using </span><b style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">555 timer IC</b><span style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">. The </span><b style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">astable multivibrator</b><span style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;"> mode operation of 555 timer utilized here for AC oscillations and these oscillations are switched via transistor 2SC4029 to a transformer. The transformer step ups the voltage to 220V AC. Use a 12V battery and Battery charger circuit for this project. </span><b style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">Design of inverter circuit</b><span style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;"> is also given. </span><br />
<h2 style="background-color: white; color: #12127d; font-family: Arial, serif; font-size: 20px; line-height: 1.25; text-align: justify; text-decoration: underline;">
Circuit diagram of DC to AC inverter</h2>
<div class="separator" style="clear: both; text-align: center;">
<img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhS-RyjCxJJc9W9XvUJGyDo0hfq9OswwQgxW4fvNinDzBhaBKaSDqSVHm_IN2TQ5d-6zqvjEloSqnr0T6phFY703hFglqusvVojElfv0C9KV9V5Uk4vH8-pQJWby33aepDdwBiXLdY218-X/s400/555+timer+IC+based+12V+to+220V+Inverter+circuit+schematic+circuit+diagram.png" height="307" width="400" /><a href="http://www.electronicsirfan.blogspot.com/" target="_blank">Electronics Lab</a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h2 style="background-color: white; color: #12127d; font-family: Arial, serif; font-size: 20px; line-height: 1.25; text-align: justify; text-decoration: underline;">
Components required</h2>
<ol style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">
<li>Power supply (12V)</li>
<li>Resistors (3kΩ x 2; 1kΩ, 2W x 1)</li>
<li>Capacitor (10µF)</li>
<li>555 timer IC</li>
<li>Diode(1N4007)</li>
<li>Transistor (2SC4029)</li>
<li>9V to 220V Step up transformer</li>
</ol>
<h2 style="background-color: white; color: #12127d; font-family: Arial, serif; font-size: 20px; line-height: 1.25; text-align: justify; text-decoration: underline;">
Working of DC to AC inverter</h2>
<ul style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">
<li>This is a simple inverter circuit based on 555 timer IC. Here timer IC wired as an astable multivibrator mode.</li>
</ul>
<ul style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">
<li>We have already discussed about <a href="http://www.circuitsgallery.com/2012/02/astable-multivibrator-using-ne-555.html" style="color: #2776c6;" target="_blank">Astable multivibrator using 555</a>. Here the oscillation frequency is set to 50Hz, supply frequency in India.</li>
</ul>
<ul style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">
<li>The diode 1N4007 is used to get 50% duty cycle for the pulses from 555, it also reduces the design complexity.</li>
</ul>
<ul style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">
<li>The output pulse from the 555 astable multivibrator is fed to the base of power transistor 2N5192. The 2N5192 transistor works as a switch, so the 12V DC supply passed through the transformer at a rate of 50 times per second.</li>
</ul>
<ul style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">
<li>Transformer step up the 12V to 220V, thus we got 50Hz, 220VAC supply at the output of transformer secondary.</li>
</ul>
<ul style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">
<li>Use a 12V battery along with a <a href="http://www.circuitsgallery.com/2012/07/simple-battery-charger-circuit-and.html" style="color: #2776c6;" target="_blank">battery charger circuit</a> to power this DC to AC inverter.</li>
</ul>
<h2 style="background-color: white; color: #12127d; font-family: Arial, serif; font-size: 20px; line-height: 1.25; text-align: justify; text-decoration: underline;">
Design of Inverter circuit</h2>
<div class="separator" style="clear: both; text-align: center;">
<span style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">555 timer Astable designed about to oscillate at 50Hz, line frequency.</span></div>
<span style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">Frequency of astable multivibrator is given by,</span><br />
<div class="separator" style="background-color: white; clear: both; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px;">
<a href="http://3.bp.blogspot.com/-WCgZDNhg3qI/UEJ5-PYQGNI/AAAAAAAAAzk/HNYHrLlfctU/s1600/555+timer+IC+based+12V+to+220V+Inverter+circuit+schematic+circuit+diagram+design.png" style="color: #2776c6; margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-WCgZDNhg3qI/UEJ5-PYQGNI/AAAAAAAAAzk/HNYHrLlfctU/s1600/555+timer+IC+based+12V+to+220V+Inverter+circuit+schematic+circuit+diagram+design.png" style="background-image: none; background-position: initial initial; background-repeat: initial initial; border-width: 0px;" /></a><a href="http://2.bp.blogspot.com/-Av6Apda5d6w/UEJ563RTN0I/AAAAAAAAAzU/67YUtowJdtg/s1600/2SC4029+Pinout.png" imageanchor="1" style="color: #2776c6; margin-left: 1em; margin-right: 1em;"></a></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">Choose C=10µF, then</span></div>
<div style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px;">
<a href="http://3.bp.blogspot.com/-gOjZhwRVENs/UEJ58ulRuMI/AAAAAAAAAzc/4ERAv1xdL0Q/s1600/555+timer+IC+based+12V+to+220V+Inverter+circuit+schematic+circuit+diagram+design+2.png" style="color: #2776c6; margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-gOjZhwRVENs/UEJ58ulRuMI/AAAAAAAAAzc/4ERAv1xdL0Q/s1600/555+timer+IC+based+12V+to+220V+Inverter+circuit+schematic+circuit+diagram+design+2.png" style="background-image: none; background-position: initial initial; background-repeat: initial initial; border-width: 0px;" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">Use R1=R=3kΩ </span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="background-color: white; color: #333333; font-family: verdana; font-size: 15px; line-height: 28.5px; text-align: justify;">El</span></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h3 style="text-align: center;">
******Related Topic ******</h3>
<ul style="text-align: left;">
<li>
<a href="http://electronicsirfan.blogspot.com/2013/11/3v-to-9v-dc-converters.html">3V to 9V DC Converters</a>
</li>
<li>
<a href="http://electronicsirfan.blogspot.com/2013/11/15v-battery-to-5v-voltage-converter.html">1.5V Battery to 5V Voltage Converter</a>
</li>
<li>
<a href="http://electronicsirfan.blogspot.com/2013/11/simple-ups-best.html">Simple UPS</a>
</li>
<li>
<a href="http://electronicsirfan.blogspot.com/2013/11/mini-high-voltage-generator.html">Mini High-Voltage Generator </a>
</li>
<li>
<a href="http://electronicsirfan.blogspot.com/2013/11/555-timer-ic-inverter-circuit-schematic.html">555 timer IC Inverter circuit schematic 12V to 220V</a>
</li>
<li>
<a href="http://electronicsirfan.blogspot.com/2013/11/best-simple-inverter.html">Simple Inverter</a>
</li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/13526216155838659104noreply@blogger.com1tag:blogger.com,1999:blog-2190029239849113272.post-30453854825950262302014-01-07T08:19:00.000-08:002014-01-07T08:19:52.348-08:00Simple Inverter<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: small;">Have
you ever wanted to run a TV, stereo or other appliance while on the
road or camping? Well, this inverter should solve that problem. It takes
12 VDC and steps it up to 120 VAC. The wattage depends on which
tansistors you use for Q1 and Q2, as well as how "big" a transformer you
use for T1. The inverter can be constructed to supply anywhere from 1
to 1000 (1 KW) watts. </span><br />
<div class="separator" style="clear: both; font-family: "Trebuchet MS",sans-serif; text-align: left;">
</div>
<div class="MsoNormal">
<span style="font-size: small;">C1, C2 2 68 uf, 25 V Tantalum Capacitor </span></div>
<div class="MsoNormal">
<span style="font-size: small;">R1, R2 2 10 Ohm, 5 Watt Resistor </span></div>
<div class="MsoNormal">
<span style="font-size: small;">R3, R4 2 180 Ohm, 1 Watt Resistor </span></div>
<div class="MsoNormal">
<span style="font-size: small;">D1, D2 2 HEP 154 Silicon Diode </span></div>
<div class="MsoNormal">
<span style="font-size: small;">Q1, Q2 2 2N3055 NPN Transistor (see "Notes") </span></div>
<div class="MsoNormal">
<span style="font-size: small;">T1 1 24V, Center Tapped Transformer (see "Notes") </span></div>
<div class="MsoNormal">
<span style="font-size: small;">MISC 1 Wire, Case, Receptical (For Output) </span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<span style="font-size: small;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhml14IIUgYa_X0560am6-C8VvUiQfE5Rtc5_y3gv3LzV6COeFngloBVakHxTUH1ERtjLw2uRePjqH2HSpvx_0B-5ut3M0S2X57YhuC_QCwNyQgJUmROVXIL2RQRAGLp0AP5h3xLZaXz-9v/s1600/inverter.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhml14IIUgYa_X0560am6-C8VvUiQfE5Rtc5_y3gv3LzV6COeFngloBVakHxTUH1ERtjLw2uRePjqH2HSpvx_0B-5ut3M0S2X57YhuC_QCwNyQgJUmROVXIL2RQRAGLp0AP5h3xLZaXz-9v/s320/inverter.gif" height="261" width="320" /></a></div>
<div class="MsoNormal">
</div>
<span style="font-size: small;"><br />
</span><br />
<ol style="font-family: "Trebuchet MS",sans-serif;">
<li><span style="font-size: small;">Q1
and Q2, as well as T1, determine how much wattage the inverter can
supply. With Q1,Q2=2N3055 and T1= 15 A, the inverter can supply about
300 watts. Larger transformers and more powerful transistors can be
substituted for T1, Q1 and Q2 for more power.</span></li>
<li><span style="font-size: small;">The easiest and least expensive way
to get a large T1 is to re-wind an old microwave transformer. These
transformers are rated at about 1KW and are perfect. Go to a local TV
repair shop and dig through the dumpster until you get the largest
microwave you can find. The bigger the microwave the bigger transformer.
Remove the transformer, being careful not to touch the large high
voltage capacitor that might still be charged. If you want, you can test
the transformer, but they are usually still good. Now, remove the old
2000 V secondary, being careful not to damage the primary. Leave the
primary in tact. Now, wind on 12 turns of wire, twist a loop (center
tap), and wind on 12 more turns. The guage of the wire will depend on
how much current you plan to have the transformer supply. Enamel covered
magnet wire works great for this. Now secure the windings with tape.
Thats all there is to it. Remember to use high current transistors for
Q1 and Q2. The 2N3055's in the parts list can only handle 15 amps each.</span></li>
<li><span style="font-size: small;">Remember, when operating at high wattages, this circuit draws huge amounts of current. Don't let your battery go dead :-).</span></li>
<li><span style="font-size: small;">Since this project produces 120 VAC, you must include a fuse and build the project in a case.</span></li>
<li><span style="font-size: small;">You <b>must</b> use tantalum
capacitors for C1 and C2. Regular electrolytics will overheat and
explode. And yes, 68uF is the correct value. There are no substitutions.</span></li>
<li><span style="font-size: small;">This circuit can be tricky to get
going. Differences in transformers, transistors, parts substitutions or
anything else not on this page may cause it to not function.</span></li>
<li><span style="font-size: small;">If you want to make 220/240 VAC
instead of 120 VAC, you need a transformer with a 220/240 primary (used
as the secondary in this circuit as the transformer is backwards)
instead of the 120V unit specified here. The rest of the circuit stays
the same. But it takes twice the current at 12V to produce 240V as it
does 120V. </span><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--></li>
<li><a href="http://www.electronicsirfan.blogspot.com/" target="_blank"><span style="font-family: "Verdana","sans-serif"; font-size: 11.5pt; line-height: 115%;">Electronics Lab</span></a><span class="apple-converted-space"><span style="background: white; color: #333333; font-family: "Verdana","sans-serif"; font-size: 11.5pt; line-height: 115%;"> </span></span><span style="background: white; color: #333333; font-family: "Verdana","sans-serif"; font-size: 11.5pt; line-height: 115%;">Created By<span class="apple-converted-space"> </span></span><a href="https://plus.google.com/u/0/101596347605966492090" target="_blank"><span style="font-family: "Verdana","sans-serif"; font-size: 11.5pt; line-height: 115%;">Muhammad
Irfan</span><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--></a>
<div class="MsoNormal">
<a href="https://plus.google.com/u/0/101596347605966492090" target="_blank"></a></div>
<div class="MsoNormal">
<a href="http://www.electronicsirfan.blogspot.com/" target="_blank"><span style="font-family: "Verdana","sans-serif"; font-size: 11.5pt; line-height: 115%;">Electronics Lab</span></a><span class="apple-converted-space"><span style="background: white; color: #333333; font-family: "Verdana","sans-serif"; font-size: 11.5pt; line-height: 115%;"> </span></span><span style="background: white; color: #333333; font-family: "Verdana","sans-serif"; font-size: 11.5pt; line-height: 115%;">Created By<span class="apple-converted-space"> </span></span><a href="https://plus.google.com/u/0/101596347605966492090" target="_blank"><span style="font-family: "Verdana","sans-serif"; font-size: 11.5pt; line-height: 115%;">Muhammad
Irfan</span></a></div>
<div class="MsoNormal">
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<h3 style="text-align: center;">
******Related Topic ******</h3>
<ul style="text-align: left;">
<li>
<a href="http://electronicsirfan.blogspot.com/2013/11/3v-to-9v-dc-converters.html">3V to 9V DC Converters</a>
</li>
<li>
<a href="http://electronicsirfan.blogspot.com/2013/11/15v-battery-to-5v-voltage-converter.html">1.5V Battery to 5V Voltage Converter</a>
</li>
<li>
<a href="http://electronicsirfan.blogspot.com/2013/11/simple-ups-best.html">Simple UPS</a>
</li>
<li>
<a href="http://electronicsirfan.blogspot.com/2013/11/mini-high-voltage-generator.html">Mini High-Voltage Generator </a>
</li>
<li>
<a href="http://electronicsirfan.blogspot.com/2013/11/555-timer-ic-inverter-circuit-schematic.html">555 timer IC Inverter circuit schematic 12V to 220V</a>
</li>
<li>
<a href="http://electronicsirfan.blogspot.com/2013/11/best-simple-inverter.html">Simple Inverter</a>
</li>
</ul>
</div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 11.5pt; line-height: 115%;"> </span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBGOWcq5sTQMEmBepNJrarMARcO3GJIajtHt8fO3wlanKtalIsJuMVstRcK6FkDw__5P1ZFKCa6kfJ3kmSB2LHGuZvP2hhk4rfzod1hXG0bJD-Bj17HL8ASwTEueLs7W_vDPdypehW82b8/s1600/d2.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBGOWcq5sTQMEmBepNJrarMARcO3GJIajtHt8fO3wlanKtalIsJuMVstRcK6FkDw__5P1ZFKCa6kfJ3kmSB2LHGuZvP2hhk4rfzod1hXG0bJD-Bj17HL8ASwTEueLs7W_vDPdypehW82b8/s1600/d2.bmp" /></a></div>
<br /><br />
<br />
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--></li>
</ol>
</div>
Anonymoushttp://www.blogger.com/profile/13526216155838659104noreply@blogger.com0tag:blogger.com,1999:blog-2190029239849113272.post-58314171693575230122014-01-03T04:09:00.000-08:002014-01-07T07:34:44.132-08:00Difference between Microcontroller and Microprocessor<div dir="ltr" style="text-align: left;" trbidi="on">
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 140px; width: 654px;">
The microprocessor is a chip which has only the CPU and Control Unit inside it. But microprocessor does not<img alt="" src="http://www.techsavvy.net76.net/index_htm_files/0.gif" height="1px" width="327px" /> </h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 154px; width: 654px;">
has any built-in Memory,RAM,IO Ports,Timers,Serial Ports etc. So these parts need to be connected from<img alt="" src="http://www.techsavvy.net76.net/index_htm_files/0.gif" height="1px" width="327px" /> </h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 169px; width: 654px;">
outside with the microprocessor. Some examples of microprocessors are our PC processors , Processors used<img alt="" src="http://www.techsavvy.net76.net/index_htm_files/0.gif" height="1px" width="327px" /> </h1>
<h1 class="xr_tl Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; margin: 0px; text-align: left; top: 184px;">
in our mobiles,Gadgets etc. </h1>
<h1 class="xr_tl Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; margin: 0px; text-align: left; top: 184px;">
</h1>
<h1 class="xr_tl Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; margin: 0px; text-align: left; top: 184px;">
</h1>
<h1 class="xr_tl Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; margin: 0px; text-align: left; top: 184px;">
</h1>
<h1 class="xr_tl Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; margin: 0px; text-align: left; top: 184px;">
</h1>
<h1 class="xr_tl Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; margin: 0px; text-align: left; top: 184px;">
</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 222px; width: 654px;">
The microcontroller has some common features with microprocessor but it differs from it in many aspects. The<img alt="" src="http://www.techsavvy.net76.net/index_htm_files/0.gif" height="1px" width="327px" /> </h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 237px; width: 654px;">
microcontroller has built-in ROM,RAM,IO ports,Timers,Serial Ports etc. As the microcontroller has all those<img alt="" src="http://www.techsavvy.net76.net/index_htm_files/0.gif" height="1px" width="327px" /> </h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 251px; width: 654px;">
parts embedded in it so it requires less hardware to build a complete system,which is an advantage of<img alt="" src="http://www.techsavvy.net76.net/index_htm_files/0.gif" height="1px" width="327px" /> </h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 266px; width: 650px;">
microcontroller. Some commercially available microcontrollers are DS1804Z-<img alt="" src="http://www.techsavvy.net76.net/index_htm_files/0.gif" height="1px" width="325px" /> </h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 280px; width: 469px;">
010,MAX5391MATE+T,MAX5391NATE+T,TPL0401B-10DCKR , MCP41050-I/P .<img alt="" src="http://www.techsavvy.net76.net/index_htm_files/0.gif" height="1px" width="234px" /> </h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 319px; width: 654px;">
The microprocessor stores program and data in same memory but microcontroller stores program and data in<img alt="" src="http://www.techsavvy.net76.net/index_htm_files/0.gif" height="1px" width="327px" /> </h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 333px; width: 101px;">
different memory.</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 333px; width: 101px;">
</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 333px; width: 101px;">
</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 333px; width: 101px;">
</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 333px; width: 101px;">
</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 333px; width: 101px;">
</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 333px; width: 101px;">
</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 333px; width: 101px;">
<img alt="" src="http://www.techsavvy.net76.net/index_htm_files/0.gif" height="1px" width="51px" /> </h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 372px; width: 654px;">
Now you are thinking that if microcontroller has all the required hardwares in a single chip and they saves<img alt="" src="http://www.techsavvy.net76.net/index_htm_files/0.gif" height="1px" width="327px" /> </h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 386px; width: 654px;">
system space so why someone will use microprocessor. The microcontroller has few amount of built-in ROM<img alt="" src="http://www.techsavvy.net76.net/index_htm_files/0.gif" height="1px" width="327px" /> </h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 401px; width: 654px;">
and RAM . If you go for an expensive microcontorller then you will get hardly 1mb of ROM and RAM. But as you<img alt="" src="http://www.techsavvy.net76.net/index_htm_files/0.gif" height="1px" width="327px" /> </h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 415px; width: 654px;">
can connect external RAM and ROM with microprocessor so microprocessor based system can have huge<img alt="" src="http://www.techsavvy.net76.net/index_htm_files/0.gif" height="1px" width="327px" /> </h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 430px; width: 93px;">
RAM and ROM.</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 430px; width: 93px;">
</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 430px; width: 93px;">
</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 430px; width: 93px;">
</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 430px; width: 93px;">
</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 430px; width: 93px;">
</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 430px; width: 93px;">
</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 430px; width: 93px;">
<img alt="" src="http://www.techsavvy.net76.net/index_htm_files/0.gif" height="1px" width="46px" /> </h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 468px; width: 654px;">
The highest frequency microcontroller available in the market is 400 MHZ - 800 MHZ. So for high speed<img alt="" src="http://www.techsavvy.net76.net/index_htm_files/0.gif" height="1px" width="327px" /> </h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 483px; width: 578px;">
operations microcontollers are not suitable. But the microprocessor can run up to few GHZ range. </h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 483px; width: 578px;">
</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 483px; width: 578px;">
</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 483px; width: 578px;">
</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 483px; width: 578px;">
</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 483px; width: 578px;">
</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 483px; width: 578px;">
</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 483px; width: 578px;">
</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 483px; width: 578px;">
</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 483px; width: 578px;">
</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 483px; width: 578px;">
</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 483px; width: 578px;">
</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 483px; width: 578px;">
</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 483px; width: 578px;">
</h1>
<h1 class="xr_tj Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; left: 0px; margin: 0px; text-align: left; top: 483px; width: 578px;">
</h1>
<h1 class="xr_tl Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; margin: 0px; text-align: justify; top: 184px;">
</h1>
<h1 class="xr_tl Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; margin: 0px; text-align: justify; top: 184px;">
</h1>
<h1 class="xr_tl Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; margin: 0px; text-align: justify; top: 184px;">
</h1>
<h1 class="xr_tl Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; margin: 0px; text-align: justify; top: 184px;">
</h1>
<h1 class="xr_tl Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; margin: 0px; text-align: justify; top: 184px;">
</h1>
<h1 class="xr_tl Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; margin: 0px; text-align: justify; top: 184px;">
</h1>
<h1 class="xr_tl Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; margin: 0px; text-align: justify; top: 184px;">
</h1>
<div style="text-align: center;">
<a href="http://www.electronicsirfan.blogspot.com/" target="_blank">\\\\related topics\\\</a></div>
<ul>
<li><a href="http://electronicsirfan.blogspot.com/2013/12/8051-special-function-registers-and.html" target="_blank">8051 Special Function Registers and Ports</a>, </li>
<li> <a href="http://electronicsirfan.blogspot.com/2014/01/ultrasonic-range-finder-using-8051.html" target="_blank">Ultrasonic range finder using 8051</a>,</li>
<li><a href="http://electronicsirfan.blogspot.com/2013/12/8051-programming-tutorial.html" target="_blank">8051 Programming Tutorial</a>, </li>
<li><a href="http://electronicsirfan.blogspot.com/2013/12/8051-microcontroller8051.html" target="_blank">8051 Microcontroller/8051 Microcontroller Architecture,</a> </li>
<li> <a href="http://electronicsirfan.blogspot.com/2013/12/interfacing-of-buzzer-using.html">Interfacing Of a Buzzer Using Microcontroller 89C52/89S52,</a> </li>
<li> <a href="http://electronicsirfan.blogspot.com/2013/12/digital-clock-using-microcontroller_22.html">Digital Clock Using Microcontroller 89C52/89S52</a></li>
<li><div class="post-title entry-title">
<a href="http://electronicsirfan.blogspot.com/2013/12/digital-locking-system-using.html"> Digital Locking System Using Microcontroller 89C52/89S52 </a>
</div>
<div class="postmeta-primary">
<span class="meta_date"><br /></span></div>
</li>
</ul>
<h1 class="xr_tl Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; margin: 0px; text-align: justify; top: 184px;">
</h1>
<h1 class="xr_tl Heading_1" style="color: #666666; font-family: 'Arial'; font-size: 10pt; font-weight: normal; margin: 0px; text-align: justify; top: 184px;">
<a href="http://www.electronicsirfan.blogspot.com/" target="_blank">Electronics Lab</a> created By Muhammad Irfan </h1>
</div>
Anonymoushttp://www.blogger.com/profile/13526216155838659104noreply@blogger.com1tag:blogger.com,1999:blog-2190029239849113272.post-5564183476418727062014-01-03T03:48:00.000-08:002014-01-07T07:46:16.001-08:00Arduino Tre vs. Raspberry Pi Model B – 5 major differences<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: center;">
<b> Arduino Tre vs. Raspberry Pi Model B – 5 major differences</b></div>
<br />
<br />
<b>Comparing the <a href="http://www.intorobotics.com/short-overview-specifications-arduino-tre/" target="_blank" title="arduino tre">Arduino Tre</a> with the <a href="http://www.amazon.com/gp/product/B009SQQF9C/ref=as_li_ss_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=B009SQQF9C&linkCode=as2&tag=intorobo-20" target="_blank">Raspberry Pi</a>
is the subject of this article, and we have to specify that the
comparison is based on the preliminary specifications of the Arduino
Tre. In the following, you can discover up to five major differences
between the Tre and Pi.</b>
<br />
<br />
<br />
<br />
The most important difference between Tre and Pi are: <br />
<ul>
<li>Arduino Tre has three microcontrollers dedicated for real-time applications;</li>
<li>one USB 2.0 device port and 4 USB 2.0 host ports are available for Tre board, while the Pi has two USB 2.0 host ports;</li>
<li>Tre has an on-board LCD expansion interface, while the Pi requires an expansion shield for LCD screens;</li>
<li>the processor of the Tre has a clock speed of 1 GHz, while the Pi processor has a clock speed of 700 MHz;</li>
<li>both electronic boards support different programming languages;</li>
</ul>
<div class="wp-caption aligncenter" id="attachment_2634" style="width: 610px;">
<img alt="Arduino Tre vs. Raspberry Pi Model B" class="size-full wp-image-2634" src="http://www.intorobotics.com/wp-content/uploads/2013/11/rsz_1dhfs_devds_vgdj9vgdfvgdfvgd89_df9.jpg" height="261" width="600" /><br />
<div class="wp-caption-text">
Arduino Tre vs. Raspberry Pi Model B</div>
</div>
<table border="1" cellpadding="0" cellspacing="0" style="background-color: white; width: 100%px;">
<tbody>
<tr>
<td></td>
<td><b>Arduino Tre</b> </td>
<td><b>Raspberry Pi Model B</b> </td>
</tr>
<tr>
<td>Processor</td>
<td>1 GHz – Texas Instrument Sitara AM3359AZCZ100 (ARM Cortex-A8) </td>
<td>700 MHz – ARM1176JZ-F Applications Processor </td>
</tr>
<tr>
<td>Microcontroller </td>
<td>3x PRU 32-bit microcontrollers</td>
<td>– </td>
</tr>
<tr>
<td>Memory </td>
<td>512MB DDR3L</td>
<td>512MB SDRAM </td>
</tr>
<tr>
<td>Digital I/O Pins </td>
<td>14(5V logic) + 12 (3.3V logic)</td>
<td>26-pin from which 8 GPIO (3.3V logic) </td>
</tr>
<tr>
<td>Networking</td>
<td>Ethernet 10/100</td>
<td>Ethernet 10/100</td>
</tr>
<tr>
<td>USB ports</td>
<td>1 USB 2.0 device port, 4 USB 2.0 host ports</td>
<td>2 USB 2.0 host ports </td>
</tr>
<tr>
<td>Video Output</td>
<td>HDMI (1920×1080)</td>
<td>HDMI (1920×1200)</td>
</tr>
<tr>
<td>Audio Output</td>
<td>HDMI </td>
<td>HDMI</td>
</tr>
<tr>
<td>MicroSD card</td>
<td>Yes </td>
<td>Yes</td>
</tr>
<tr>
<td>Software</td>
<td>Linux </td>
<td>Linux</td>
</tr>
<tr>
<td>Programming languages</td>
<td>C, C++</td>
<td>Python, Java</td>
</tr>
<tr>
<td>Android support</td>
<td>?</td>
<td>Yes</td>
</tr>
<tr>
<td>Power</td>
<td>5V</td>
<td>5V</td>
</tr>
<tr>
<td>Dimensions</td>
<td>?</td>
<td>85.60mm x 56mm x 21mm</td>
</tr>
</tbody></table>
<span id="more-2629"></span><br />
<h2>
What is an Arduino Tre?</h2>
Arduino is above of all a community of engineers, hobbyists, or
students around open source hardware platforms that comes in different
versions. The first board was released in 2005 aiming to simplify the
process of prototyping DIY electronic devices. Since then, few Arduino
boards were released with significant improvements, but the biggest
improvement for an Arduino board will be in 2014 when the Arduino Tre is
planned to be released.<br />
Arduino Tre will be the most powerful Arduino board, a mini computer
with realistic features to run a full version of Linux. The Tre will be
the first electronic Arduino board manufactured in the U.S., and the
main reason is that the electronic device is the result of collaboration
with <a href="http://beagleboard.org/" target="_blank">BeagleBoard.org</a> foundation.<br />
The Arduino Tre is designed to encapsulate the experience and
benefits of both Arduino and BeagleBoard communities, and this makes the
technology more accessible to engineers, designers, students, or
hobbyists.<br />
Integrating a processor with 100 times more performance than any
other Arduino boards, the Arduino Tre is able to run desktop
applications, complex algorithms or to maintain high-speed
communications.<br />
<h2>
What is a Raspberry Pi?</h2>
The Raspberry Pi was sold over time in more than 2 million exemplars,
a remarkable number for a tiny electronic board with high performances
and a <a href="http://www.mcmelectronics.com/product/RASPBERRY-PI-RASPBRRY-MODB-512M-/83-14421" target="_blank">price of about US $35</a>.<br />
This minicomputer is a powerful and inexpensive device for engineers,
designers, students, or hobbyists involved in DIY projects or try to
learn programming and building wonderful robotic applications.<br />
Like Arduino boards, the Raspberry Pi was designed to be used
especially in education, and also is a platform based on Linux and
opened to write your own software to run on it.<br />
The device comes in two models called A and B. Between the two models
are small differences including here 512MB RAM for model B instead
256MB RAM of model A, 2 USB ports for model B instead only one USB port
for model A, and no Ethernet connectivity for model A.<br />
As a conclusion, the Raspberry Pi is a cheap, flexible and opened for
experimentation minicomputer that can be useful for a large area of DIY
projects.<br />
<h2>
Measures</h2>
The dimensions of the Arduino Tre are not listed, while the Raspberry
Pi Model B measures are 85.60mm x 56mm x 21mm, which define a little
electronic board. Based on the idea that the Arduino Tre is based on an
Arduino and BeagleBoard boards, we suppose that this will keep the same
measures.<br />
<h2>
Graphics</h2>
<b>Arduino Tre</b> – in this section the most important
feature is the HDMI support, which means that the board can be used in
several applications for digital or analog TV. The maximum resolution
supported by the Tre for video files is 1920×1080 pixels. Any data could
be displayed on an LCD screen due to the LCD expansion interface.<br />
<b>Raspberry Pi Model B</b> – the Pi model B has also HDMI
support, while for VGA support is required to use an adaptor. To display
images on an LCD screen it is also required to use an LCD expansion
shield for Raspberry Pi.<br />
<h2>
Audio</h2>
<b>Arduino Tre</b> – the board has HDMI support and stereo analog audio I/O.<br />
<b>Raspberry Pi Model B</b> – it has also HDMI supported and for output uses a standard 3.5mm jack.<br />
<h2>
Power</h2>
<b>Arduino Tre</b> – the board requires a 5V power jack to run.<br />
<b>Raspberry Pi Model B</b> – the Pi board requires the same voltage as Tre – 5V.<br />
<h2>
Hardware</h2>
<b>Arduino Tre</b> – the Tre is based on ARM Cortex-A8
processor by Texas Instrument Sitara with 1 GHz clock speed and 512MB
RAM DDR3. A plus compared with Raspberry Pi Model B is that the Tre
dedicated microcontrollers for real-time applications.<br />
<b>Raspberry Pi Model B</b> – the B model is based on a low power ARM1176JZ-F processor with a working frequency of 700 MHz and 512MB of SDRAM.<br />
<h2>
Software</h2>
<b>Arduino Tre</b> – it is expected to use the same Arduino
IDE written in Java and with support for C or C++ programming language.
The operating system that runs on Tre is a full version of Linux.<br />
<b>Raspberry Pi Model B</b> – it is recommended to run on
Pi the Linux Debian OS version, while for programming its support Python
or Java. Compared with Tre, the Pi can run a customized version of
Android, while for Tre we just can suppose that the device can run also
the Android OS.<br />
<h2>
Storage</h2>
<b>Arduino Tre</b> – it supports SD cards, but we don’t have any information about the maximum capacity of the memory card supported.<br />
<b>Raspberry Pi Model B</b> – this minicomputer support
memory card with up to 32GB memory space, while it is recommended to be
used a card with at least 4GB space for storage.<br />
<h2>
Networking, USB and Wireless</h2>
<b>Arduino Tre</b> – the electronic board includes 10/100 wired Ethernet, and an increased number of USB ports are available.<br />
<b>Raspberry Pi Model B</b> – the device has also support for 10/100 wired Ethernet, and dual USB connector.<br />
<br />
<br />
<br />
<h3 style="text-align: center;">
<a href="http://www.electronicsirfan.blogspot.com/" target="_blank">******Related Topics *****</a></h3>
<ul style="text-align: left;">
<li>
<a href="http://electronicsirfan.blogspot.com/2014/01/difference-between-microcontroller-and.html">Difference between Microcontroller and Microprocessor</a>
</li>
<li>
<a href="http://electronicsirfan.blogspot.com/2014/01/arduino-tre-vs-raspberry-pi-model-b-5.html">Arduino Tre vs. Raspberry Pi Model B – 5 major differences</a>
</li>
<li>
<a href="http://electronicsirfan.blogspot.com/2013/12/types-of-relays_13.html">Types of Relays</a>
</li>
<li>
<a href="http://electronicsirfan.blogspot.com/2013/12/electronics-basic-articles.html">Electronics Basic Articles</a>
</li>
</ul>
<div class="postmeta-primary">
<div class="postmeta-primary" style="text-align: left;">
<br /></div>
<div class="postmeta-primary">
<span class="meta_categories"></span><span class="meta_comments"></span>
</div>
<br /><span class="meta_categories"></span><span class="meta_comments"></span>
</div>
<br />
<br />
<br />
<a href="http://www.electronicsirfan.blogspot.com/" target="_blank"> Electronics Lab</a> Created By Muhammad Irfan</div>
Anonymoushttp://www.blogger.com/profile/13526216155838659104noreply@blogger.com0tag:blogger.com,1999:blog-2190029239849113272.post-30172753182226070742014-01-02T21:55:00.000-08:002014-01-07T07:33:36.232-08:00Ultrasonic range finder using 8051<div dir="ltr" style="text-align: left;" trbidi="on">
<h3 style="text-align: center;">
Ultrasonic range finder using 8051</h3>
<div>
<h3 style="background-color: white; color: #0f83c4; font-family: Arial,Helvetica,sans-serif; font-size: 20px; line-height: 22px; margin: 0px; padding: 10px 0px; text-align: justify;">
Ultrasonic range finder using 8051 .</h3>
<div style="background-color: white; color: #333333; font-family: Georgia,'Times New Roman',Times,serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
A simple ultrasonic range finder using 8051 microcontroller is presented in this article. This ultrasonic rangefinder can measure distances up to 2.5 meters at an accuracy of 1 centi meter. AT89s51 microcontroller and the ultrasonic transducer module HC-SR04 forms the basis of this circuit. The ultrasonic module sends a signal to the object, then picks up its echo and outputs a wave form whose time period is proportional to the distance. The microcontroller accepts this signal, performs necessary processing and displays the corresponding distance on the 3 digit seven segment display. This circuit finds a lot of application in projects like automotive parking sensors, obstacle warning systems, terrain monitoring robots, industrial distance measurements etc.</div>
<h4 style="background-color: white; color: #0f83c4; font-family: Arial,Helvetica,sans-serif; font-size: 18px; line-height: 22px; margin: 0px; padding: 10px 0px; text-align: justify;">
HC-SR04 ultrasonic module.</h4>
<div style="background-color: white; color: #333333; font-family: Georgia,'Times New Roman',Times,serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
HC-SR04 is an ultrasonic ranging module designed for embedded system projects like this. It has a resolution of 0.3cm and the ranging distance is from 2cm to 500cm. It operates from a 5V DC supply and the standby current is less than 2mA. The module transmits an ultrasonic signal, picks up its echo, measures the time elapsed between the two events and outputs a waveform whose high time is modulated by the measured time which is proportional to the distance. .The photograph of an HC-SR04 module is shown below.</div>
<div style="background-color: white; color: #333333; font-family: Georgia,'Times New Roman',Times,serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhldsb_BZ-iLN6kyqKy9I0PfOMQTMu_OUdRKj1GTm-t4dlXAYdY1Ws21YRWtqse02OfYxuCzO5QihmJH5Z-N8b-VmCRnb2R8iuMGE0COD5cHTfN8dR2Kt1XeCCrldVMHyUzD_V5vhyJQCWl/s1600/HC-SR04-ultrasonic-module+(1).png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhldsb_BZ-iLN6kyqKy9I0PfOMQTMu_OUdRKj1GTm-t4dlXAYdY1Ws21YRWtqse02OfYxuCzO5QihmJH5Z-N8b-VmCRnb2R8iuMGE0COD5cHTfN8dR2Kt1XeCCrldVMHyUzD_V5vhyJQCWl/s400/HC-SR04-ultrasonic-module+(1).png" height="142" width="400" /></a></div>
<div style="background-color: white; color: #333333; font-family: Georgia,'Times New Roman',Times,serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
<br /></div>
<div style="background-color: white; color: #333333; font-family: Georgia,'Times New Roman',Times,serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
<br /></div>
<div style="background-color: white; color: #333333; font-family: Georgia,'Times New Roman',Times,serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
The supporting circuits fabricated on the module makes it almost stand alone and what the programmer need to do is to send a trigger signal to it for initiating transmission and receive the echo signal from it for distance calculation. The HR-SR04 has four pins namely Vcc, Trigger, Echo, GND and they are explained in detail below.</div>
<div style="background-color: white; color: #333333; font-family: Georgia,'Times New Roman',Times,serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
1) <b style="margin: 0px; padding: 0px;">VCC</b> : 5V DC supply voltage is connected to this pin.</div>
<div style="background-color: white; color: #333333; font-family: Georgia,'Times New Roman',Times,serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
2)<b style="margin: 0px; padding: 0px;"> Trigger</b>: The trigger signal for starting the transmission is given to this pin. The trigger signal must be a pulse with 10uS high time. When the module receives a valid trigger signal it issues 8 pulses of 40KHz ultrasonic sound from the transmitter. The echo of this sound is picked by the receiver.</div>
<div style="background-color: white; color: #333333; font-family: Georgia,'Times New Roman',Times,serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
3)<b style="margin: 0px; padding: 0px;">Echo</b>: At this pin, the module outputs a waveform with high time proportional to the distance.</div>
<div style="background-color: white; color: #333333; font-family: Georgia,'Times New Roman',Times,serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
4) <b style="margin: 0px; padding: 0px;">GND</b>: Ground is connected to this pin.</div>
<h5 style="background-color: white; color: #0f83c4; font-family: Arial,Helvetica,sans-serif; font-size: 14px; line-height: 22px; margin: 0px; padding: 10px 0px; text-align: justify;">
HC-SR04 timing diagram.</h5>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXPUg7TMpelY2jxvrkoWxf_eXzHIrW9xQ4Gb_N54DHq961C6JGHC9y4EEBOXAViJFPQRtfBMSb6MvRVcpGoFOOSLYFXINyfmPcFiGZvSKN3tMAlTZrOgLu5ejXBdCBOen5qmZlRMcPBHkU/s1600/HC-SR04-timing-diagram.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXPUg7TMpelY2jxvrkoWxf_eXzHIrW9xQ4Gb_N54DHq961C6JGHC9y4EEBOXAViJFPQRtfBMSb6MvRVcpGoFOOSLYFXINyfmPcFiGZvSKN3tMAlTZrOgLu5ejXBdCBOen5qmZlRMcPBHkU/s400/HC-SR04-timing-diagram.png" height="257" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div style="background-color: white; color: #333333; font-family: Georgia,'Times New Roman',Times,serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
From the timing diagram, you can see that the 40KHz pulse train is transmitted just after the 10uS triggering pulse and the echo output is obtained after some more time. The next triggering pulse can be given only after the echo is faded away and this time period is called cycle period. The cycle period for HC-SR04 must not be below 50mS. According to datasheet, the distance can be calculated from the echo pulse width using the following equations.</div>
<div style="background-color: white; color: #333333; font-family: Georgia,'Times New Roman',Times,serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
Distance in cm = echo pulse width in uS/58</div>
<div style="background-color: white; color: #333333; font-family: Georgia,'Times New Roman',Times,serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
Distance in inch = echo pulse width in uS/148</div>
<h4 style="background-color: white; color: #0f83c4; font-family: Arial,Helvetica,sans-serif; font-size: 18px; line-height: 22px; margin: 0px; padding: 10px 0px; text-align: justify;">
Ultrasonic range finder using 8051- Circuit diagram.</h4>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTLWJkQI2oq6lwbAdi0_InDQX0onxBE1eDq33ZU6dsSiTKwv4vgCOBMw_Gq7pPXQaYTE0H_5w4WmFvFbrgS3-HZjs-KzGvreLfQ13g8Z7FLfBQXcNoTUQy2Hf9wwuqDU_sLBRb0nFUhW37/s1600/HC-SR04-timing-diagram.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTLWJkQI2oq6lwbAdi0_InDQX0onxBE1eDq33ZU6dsSiTKwv4vgCOBMw_Gq7pPXQaYTE0H_5w4WmFvFbrgS3-HZjs-KzGvreLfQ13g8Z7FLfBQXcNoTUQy2Hf9wwuqDU_sLBRb0nFUhW37/s320/HC-SR04-timing-diagram.png" height="206" width="320" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDnv8M6rBB5O_rCbUro3Bg4bmtRTtxPMBoR2DskrrS7cC2oj6BBoi7b4qDwA0GMAHM-UcvZtEpHO7C18LBAZZpmuneqzB903LKfMMWp5o98yu6wRVdZ55f1-U9OEXXmOI2HobOmQxw5OHY/s1600/ultrasonic-range-finder-using-8051.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDnv8M6rBB5O_rCbUro3Bg4bmtRTtxPMBoR2DskrrS7cC2oj6BBoi7b4qDwA0GMAHM-UcvZtEpHO7C18LBAZZpmuneqzB903LKfMMWp5o98yu6wRVdZ55f1-U9OEXXmOI2HobOmQxw5OHY/s400/ultrasonic-range-finder-using-8051.png" height="201" width="400" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div>
<div style="background-color: white; color: #333333; font-family: Georgia,'Times New Roman',Times,serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
The ultrasonic module is interfaced to the microcontroller through P3.0 and P3.1 pins. Port0 used for transmitting the 8 bit display data to the display and port pins P1.0, P1.1, P1.2 are used for transmitting display drive signals for the corresponding display units D1, D2, D3. Push button switch S1, capacitor C3 and resistor R9 forms a de-bouncing reset circuitry. Capacitors C1,C2 and crystal X1 are associated with the clock circuit.</div>
<h4 style="background-color: white; color: #0f83c4; font-family: Arial,Helvetica,sans-serif; font-size: 18px; line-height: 22px; margin: 0px; padding: 10px 0px; text-align: justify;">
Program.</h4>
<div style="text-align: justify;">
<pre style="background-color: white; color: #333333; font-size: 15px; line-height: 22px; padding: 0px;">ORG 00H // origin
MOV DPTR,#LUT // moves the address of LUT to DPTR
MOV P1,#00000000B // sets P1 as output port
MOV P0,#00000000B // sets P0 as output port
CLR P3.0 // sets P3.0 as output for sending trigger
SETB P3.1 // sets P3.1 as input for receiving echo
MOV TMOD,#00100000B // sets timer1 as mode 2 auto reload timer
MAIN: MOV TL1,#207D // loads the initial value to start counting from
MOV TH1,#207D // loads the reload value
MOV A,#00000000B // clears accumulator
SETB P3.0 // starts the trigger pulse
ACALL DELAY1 // gives 10uS width for the trigger pulse
CLR P3.0 // ends the trigger pulse
HERE: JNB P3.1,HERE // loops here until echo is received
BACK: SETB TR1 // starts the timer1
HERE1: JNB TF1,HERE1 // loops here until timer overflows (ie;48 count)
CLR TR1 // stops the timer
CLR TF1 // clears timer flag 1
INC A // increments A for every timer1 overflow
JB P3.1,BACK // jumps to BACK if echo is still available
MOV R4,A // saves the value of A to R4
ACALL DLOOP // calls the display loop
SJMP MAIN // jumps to MAIN loop
DELAY1: MOV R6,#2D // 10uS delay
LABEL1: DJNZ R6,LABEL1
RET
DLOOP: MOV R5,#100D // loads R5 with 100D
BACK1: MOV A,R4 // loads the value in R4 to A
MOV B,#100D // loads B with 100D
DIV AB // isolates the first digit
SETB P1.0 // activates LED display unit D1
ACALL DISPLAY // calls DISPLAY subroutine
MOV P0,A // moves digit drive pattern for 1st digit to P0
ACALL DELAY // 1mS delay
ACALL DELAY
MOV A,B // moves the remainder of 1st division to A
MOV B,#10D // loads B with 10D
DIV AB // isolates the second digit
CLR P1.0 // deactivates LED display unit D1
SETB P1.1 // activates LED display unit D2
ACALL DISPLAY
MOV P0,A // moves digit drive pattern for 2nd digit to P0
ACALL DELAY
ACALL DELAY
MOV A,B // moves the remainder of 2nd division to A
CLR P1.1 // deactivates LED display unit D2
SETB P1.2 // activates LED display unit D3
ACALL DISPLAY
MOV P0,A // moves the digit drive pattern for 3rd digit to P0
ACALL DELAY
ACALL DELAY
CLR P1.2 // deactivates LED display unit D3
DJNZ R5,BACK1 // repeats the display loop 100 times
RET
DELAY: MOV R7,#250D // 1mS delay
LABEL2: DJNZ R7,LABEL2
RET
DISPLAY: MOVC A,@A+DPTR // gets the digit drive pattern for the content in A
CPL A // complements the digit drive pattern (see Note 1)
RET
LUT: DB 3FH // look up table (LUT) starts here
DB 06H
DB 5BH
DB 4FH
DB 66H
DB 6DH
DB 7DH
DB 07H
DB 7FH
DB 6FH
END</pre>
</div>
<h4 style="background-color: white; color: #0f83c4; font-family: Arial,Helvetica,sans-serif; font-size: 18px; line-height: 22px; margin: 0px; padding: 10px 0px; text-align: justify;">
About the program.</h4>
<div style="background-color: white; color: #333333; font-family: Georgia,'Times New Roman',Times,serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
The first part of the program sets the initial conditions. Port 0 and P0rt 1 are set as output ports for sending digit drive patterns and digit drive signals respectively. Port pin 3.0 is set as an output pin for sending the trigger signal to the ultrasonic module for starting transmission and port pin 3.1 is set as an input pin for receiving the echo. TMOD register of the microcontroller is so loaded that the Timer 1 operates in mode2 8 bit auto-reload mode. Timer 0 of the microcontroller is not used here. In the next part of the program (loop MAIN) the TL1 and TH1 registers of Timer1 are loaded with the initial values. TL1 is loaded with the initial value to start counting from and TH1 is loaded with the reload value. This is how timer 1 in mode 2 works: When TR1 bit of the TCON register is set the TL1 starts counting from the initial value loaded into it and keeps counting untill roll over (ie; 255D). When roll over occurs, TF1 flag is set and TL1 is automatically loaded with the reload value stored in TH1 and the sequence is repeated until TR1 is made low by the program. The TF1 goes high at the first roll over and if you want it as an indicator for each roll over, you have to clear it using the program after each roll over. In the next part of the MAIN loop P3.0 is set high for 10uS and then cleared to make 10uS triggering pulse. The ultrasonic module issues a 40Khz pulse wave form after receiving this trigger and the program waits until a valid echo is received at P3.1. The pulse width of the echo signal is proportional to the distance to the obstacle and so the next job of the program is to measure the pulse width. Whenever there is a valid echo pulse at P3.1, the Timer1 starts and it counts from the initial value to 255 ie: 255-207= 48 counts. Then the counter restarts and accumulator increments by one for every restart. This sequence is repeated until the echo signal at P3.1 vanishes (ie; P3.1 goes low). Now the content in A will be equal to the number of Timer1 reloads which is in fact proportional to the distance. From the datasheet it is clear that 58uS echo pulse width indicates 1cM distance. When the processor is clocked by a 12MHz crystal, 58 counts of Timer1 indicates 1cM. That means 1 reload is equal to 1cM. But here we are letting the Timer1 to count only 48 times before reload and this is done in order to compensate for the time lags caused by the branching instructions used for checking the status of P3.0 and P3.1 pins. If this trick is not done, the individual time lags caused by the branching instructions will be cumilatively added to the observed pulse width and the range finder will show a reading higher than the original distance. Some trial and error was required for getting the correct Timer1 reload value and with the 207D (ie; 48 counts) used here the error was found to be less than half a centimeter which is quite fine in this context. The next part of the program does necessary mathematics on the current content in A and displays it as 3 digit readout on the display.</div>
<h4 style="background-color: white; color: #0f83c4; font-family: Arial,Helvetica,sans-serif; font-size: 18px; line-height: 22px; margin: 0px; padding: 10px 0px; text-align: justify;">
Notes.</h4>
<div style="background-color: white; color: #333333; font-family: Georgia,'Times New Roman',Times,serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
1) The LUT used here was originally made for a common cathode seven segment display and here we are using common anode displays. The CPL A instruction will just complement the obtained digit drive pattern and make is suitable for the common anode scheme. If you have time ,then cook up an LUT for common anode scheme and replace the current one using it. By this you can avoid the extra CPL A instruction and it is the correct method.</div>
<div style="background-color: white; color: #333333; font-family: Georgia,'Times New Roman',Times,serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
2)The entire circuit can be powered from 5V DC.</div>
<div style="background-color: white; color: #333333; font-family: Georgia,'Times New Roman',Times,serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
3) Be careful while handling the Ultrasonic module. There are a lot of sensitive surface mount devices fabricated on its back side.<br />
<br />
<br />
<br />
</div>
<div style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
<br /></div>
<div style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
<br /></div>
<div style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
<br /></div>
<div style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
<br /></div>
<div style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
<br /></div>
<div style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
<br /></div>
<div style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
<br /></div>
<div style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
<div style="text-align: center;">
<a href="http://www.electronicsirfan.blogspot.com/" target="_blank">\\\\related topics\\\</a></div>
<ul>
<li><a href="http://electronicsirfan.blogspot.com/2013/12/8051-special-function-registers-and.html" target="_blank">8051 Special Function Registers and Ports</a>, </li>
<li> <a href="http://electronicsirfan.blogspot.com/2014/01/ultrasonic-range-finder-using-8051.html" target="_blank">Ultrasonic range finder using 8051</a>,</li>
<li><a href="http://electronicsirfan.blogspot.com/2013/12/8051-programming-tutorial.html" target="_blank">8051 Programming Tutorial</a>, </li>
<li><a href="http://electronicsirfan.blogspot.com/2013/12/8051-microcontroller8051.html" target="_blank">8051 Microcontroller/8051 Microcontroller Architecture,</a> </li>
<li> <a href="http://electronicsirfan.blogspot.com/2013/12/interfacing-of-buzzer-using.html">Interfacing Of a Buzzer Using Microcontroller 89C52/89S52,</a> </li>
<li> <a href="http://electronicsirfan.blogspot.com/2013/12/digital-clock-using-microcontroller_22.html">Digital Clock Using Microcontroller 89C52/89S52</a></li>
<li><div class="post-title entry-title">
<a href="http://electronicsirfan.blogspot.com/2013/12/digital-locking-system-using.html"> Digital Locking System Using Microcontroller 89C52/89S52 </a>
</div>
<div class="postmeta-primary">
<span class="meta_date"><br /></span><span class="meta_categories"></span> </div>
</li>
</ul>
</div>
<div style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
<div class="post-title entry-title" style="text-align: center;">
</div>
</div>
<div style="background-color: white; color: #333333; font-family: Georgia,'Times New Roman',Times,serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: center;">
<a href="http://www.electronicsirfan.blogspot.com/" target="_blank">Electronics Lab</a> Created By Muhammad Irfan</div>
</div>
<div style="background-color: white; color: #333333; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 15px; line-height: 22px; padding: 10px 0px; text-align: justify;">
<br /></div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/13526216155838659104noreply@blogger.com2tag:blogger.com,1999:blog-2190029239849113272.post-2091223212489360162013-12-26T02:38:00.000-08:002014-01-07T07:37:26.560-08:008051 Programming Tutorial<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: center;">
8051 Programming Tutorial</h2>
<h2 style="text-align: center;">
</h2>
<div style="text-align: justify;">
This article series is developed to
teach you 8051 micro controller programming. I have divided this
programming tutorial into a series of chapters as shown below. So you
can start with Chapter 1 and then move to chapter 2 and chapter 3 and so
on. So let’s begin the journey right now! </div>
<div style="text-align: justify;">
<b>Note:</b> Next chapters 1,2,3.. are under development phase. Please visit this page again for updates.</div>
<div style="text-align: justify;">
<b><span style="color: blue;">Note:</span></b>
To test any of these program or to write one your own and test, you
dont need to buy a microcontroller board now. You can test your program
using an 8051 simulator. Here is a big list of <span style="text-decoration: underline;"><b>8051 simulators</b></span> available. In the beginning try the first one given in the list, Edsim51. Its an easy to use tool. </div>
<div style="text-align: justify;">
To program any microcontroller available
in this world, first you need to learn and understand it’s instruction
sets. Instruction set contains a set of instructions that is available
for the programmer to create any kind of program he likes. Or in another
way, using the instruction set a programmer can create the program
required for the specific application he is making. So first of all one
needs to master all available instructions, how an instruction works,
how the execution of an instruction affects the microcontroller
(affecting the registers, psw, stack etc) and the way it is used in a
program. Once the instruction set is mastered, you can start playing
with programs. Before getting into programming, there are some
prerequisites. If you are really new to micro controller and if 8051 is
the first one you are playing with, please read the following articles
first.</div>
<b>1. <span style="text-decoration: underline;"><a href="http://electronicsirfan.blogspot.com/2014/01/difference-between-microcontroller-and.html" target="_blank">Difference between Microprocessor and Micro controller</a> </span></b><br />
<b>2. <a href="http://electronicsirfan.blogspot.com/2013/12/8051-microcontroller8051.html" target="_blank"><span style="text-decoration: underline;">Basics of 8051 Microcontroller – Pin diagram – Architecture – Memory Organization </span></a></b><br />
<b>3. <span style="text-decoration: underline;">Addressing modes of 8051</span> - </b><span style="color: red;"><i> You must read this article before writing any program for 8051 as this documents the root of instruction handling.</i></span><br />
<b>4. <a href="http://electronicsirfan.blogspot.com/2013/12/8051-special-function-registers-and.html" target="_blank"> <span style="text-decoration: underline;">8051 Special Function Registers and I/O Ports</span></a></b><br />
<div style="text-align: justify;">
Now lets come to instruction sets of 8051 micro controller. The 8051 instruction set can be classified as shown below.</div>
<ul>
<li>Instructions for data transfer/ data move</li>
<li>Instructions for arithmetic operations</li>
<li>Instructions for branching a program</li>
<li>Instruction for creating subroutines</li>
<li>Instructions for logical operations</li>
<li>Instructions for boolean operations </li>
<li>Special purpose instructions</li>
</ul>
<div style="text-align: justify;">
Follow the given link, where you can access the complete list of instructions for 8051 micro controller – <span style="text-decoration: underline;"><b>8051 Instruction Set </b></span> (see the heading Alphabetical order below first table).</div>
<div style="text-align: justify;">
<span style="color: red;"><b>Note:-</b></span>
8051 micro controller belongs to the MCS-51 family of micro
controllers. This basically means,any 8051 variant micro controller
(that comes under the MCS-51 family) made by any other manufacturer must
use the same set of instructions made for MCS-51. So the “<i><b>instruction decoder</b></i>” part of all micro controllers under MCS-51 family is same. <b>Example:</b>
Atmels AT89c2051 is one such micro controller that falls under MCS-51
family. So a program written for Intel 8051 can be used to run AT89C2051
too (you may have to make slight modifications to match hardware
disparities).</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>1. Instructions for data transfer includes</b> – MOV, MOVC, MOVX, PUSH, POP, XCH, XCHD</div>
<div style="text-align: justify;">
<b>2.Instructions for arithmetic operations are</b> – ADD, ADDC, SUBB, MUL, DIV, INC, DEC, DA A</div>
<div style="text-align: justify;">
<b>3. Instructions for branching and subroutines</b> – LJMP, AJMP, SJMP, LCALL, ACALL, JZ, JNZ, CJNE, DJNZ, JMP, NOP, RET, RETI</div>
<div style="text-align: justify;">
<b>4. Instructions for logical operations</b> – ANL, ORL, XRL, CLR, CPL, RL, RLC, RR, RRC, SWAP</div>
<div style="text-align: justify;">
<b>5. Instructions for boolean variable operations</b> – SETB, MOV, CLR, JB, JNB, JBC, ANL, ORL, CPL, JC, JNC</div>
<div style="text-align: justify;">
<b>6. Special purpose instructions involves</b> – MOVC, MOVX, SWAP, XCH, XCHD, JBC, RETI, DA A</div>
<div style="text-align: justify;">
You may learn about all instructions in
detail by following that link given above. There are 44 instructions in
8051 or MCS-51 instruction set.</div>
<div style="text-align: justify;">
I assume you have gone through data
transfer/arithmetic/branching and subroutine instructions by now. Now
lets write a very simple program.</div>
<h3 style="text-align: justify;">
A program to find sum of N natural numbers and store the sum</h3>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Program description:-</b></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b> </b>
The number “N” is stored in location 35H. Natural numbers generated from
0 to N must be stored from location 55H. The sum of natural numbers
must be stored in location 36H.</div>
<div style="text-align: justify;">
Analyzing the program description, we
need 3 registers. R0 to store the value of “N” (given in location
35H)and to act as a counter for generating natural numbers upto N. R5 is
used to save the value of first storage location of natural numbers and
then R5 is incremented by one each to store each newly generated
natural number. R7 is initiated as 0 and is incremented by 1 to generate
natural numbers.</div>
<h4 style="text-align: justify;">
The Program:-</h4>
<code lang="asm">MOV PSW, #00H // Register bank '0' is selected by executing this instruction.</code><br />
<code lang="asm">
MOV R0, 35H // The value of 'N' stored in location 35H is transfered to R0.<br />
MOV R5, #55H// The starting location for storing natural numbers '#55H' is transfered to R5<br />
MOV A, #00H// Accumulator is initiated with value 0 for adding natural numbers cumulatively. <br />
MOV R7, #00H// R7 is initialized to '0' to generate natural numbers. Note: '0' is not a natural number.<br />
LOOP: INC R7// R7 is incremented by 1 to generate next natural number. <br />
MOV @R5, 07H// This is indirect addressing mode used here.It
is not possible to transfer data from one register to another register
directly. So an instruction like MOV R5, R7 is invalid.Instead we use
the direct address (07) of register R7 of register bank #00 to transfer
the generated natural number to it's storage location in register
R5.Indirect addressing is used as we need to save the generated natural
number directly to memory address. R5 holds the starting location
address (of the storage area) as its value i.e #55H.By indirectly addressing, we can save what ever value in R7 directly to location #55H.<br />
INC R5// The storage location is incremented by 1 from #55H to #56H to store the next generated natural number<br />
ADD A, R7// The generated natural number is added to contents in accumulator.<br />
DJNZ R0, LOOP// The value of register Ro (value of 'N') is
decremented by 1. It is checked against stopping condition zero. If its
R0 is not equal to zero, the program control will move to label LOOP
again and the steps from INC R7 will be executed again until R0 is equal
to zero. When R0 is equal to zero, program control will exit the loop
and move to next instruction given below.<br />
MOV 36H,A// The sum of natural numbers in accumulator is moved to storage location 36H.<br />
</code><code lang="asm">STOP: SJMP STOP// An infinite loop written at
the end of the program. When this instruction is reached program
control will get stuck at this instruction as it's an infinite loop.To
get out of this infinite loop system reset must be applied.</code><br />
<h3>
</h3>
<h3>
A simple program to copy a block of data from one location to another</h3>
<b>Program Description:-</b><br />
<br />
10 bytes of data stored from 30H is to be copied to another location staring from 50H.<br />
Analyzing the program, we see, we need two registers to store
starting locations of source and destination. Lets say we take R0 as the
source and R2 as the destination registers. Now we need a counter to
count 10 bytes of data transfered from source to destination. Lets take
R3 for that. It is not possible to transfer data from one register to
another register directly by using any kind of addressing mode. So we
need accumulator to stand in between as a temporary register. So here is
it:<br />
<h4>
The Program:</h4>
<code lang="asm">MOV R0,#30H // Address of the starting location of source data is moved to R0.</code><br />
<code lang="asm">
MOV R1,#50H // Address of the starting location of destination is moved to R1<br />
MOV R3,#OAH// Set the counter R3 with 10. You can also use decimal number as MOV R3,#10d.<br />
LOOP: MOV A, @R0// Indirect addressing mode is used. Contents at the location of Ro (30H) is copied to accumulator.<br />
MOV @R1, A// Contents in accumulator is copied to location pointed by Ra (that is 50H).<br />
INC R0 // Ro is incremented by 1 to point to next location.<br />
INC R1// R1 is incremented by 1 to point to next location.<br />
DJNZ R3, LOOP // Counter register R3 is decremented by 1 and
checked against zero. See the explanation DJNZ in the first program "sum
of natural numbers"<br />
STOP: SJMP STOP // Infinite loop to terminate programh<br />
</code><code lang="asm"> </code><br />
<br />
<br />
<h4 style="text-align: justify;">
</h4>
<h4 style="text-align: justify;">
</h4>
<h4 style="text-align: justify;">
The Program:- </h4>
<code lang="asm">BEGIN: MOV R1,30H // Getting the value of "N"</code><br />
<code lang="asm">
MOV R7,#40H // The first number '0' of series is stored here. <br />
MOV @R7,#00H // Loading value 'o' to address 40H using indirect addressing<br />
INC R7 // Incrementing value of R7 from 40H to 41H to store next number '1' <br />
MOV @R7, #01H // Storing value '1' to location 41H. Note that
'o' and '1' are seed values of a fibonacci series and has to be
generated manually. <br />
MOV R5,#42H // New register R5 is loaded with location address
42H to store next values of series, generated by adding the 2 previously
generated numbers. <br />
DEC R1<br />
DEC R1 // The count value "N" is decremented by 2, as we have already generated and stored 1st two numbers. <br />
DEC R7 // R7 is now reduced from 41H to 40H. We need to add
contents of 40H and 41 H to get the number that is to be stored in 42H. <br />
LOOP: MOV A, @R7 // Contents in R7 is moved to accumulator. <br />
INC R7 // R7 is incremented to get the next value. <br />
ADD A,@R7 // The two values are added and stored in Acc. <br />
MOV @R5,A // The newly generated value of the series is stored in the address held by R5. <br />
INC R5 // R5 is incremented to store next value. <br />
DJNZ R1,LOOP // The count "N" is checked to zero (to know if all the numbers upto N are generated). <br />
</code><code lang="asm">STOP: SJMP STOP // Run infinitely here or end of program execution. </code><br />
<br />
<br />
<div style="text-align: justify;">
These 3 programs will be enough for a<i><b> “kick start”</b></i> in 8051 programming. More programs and concepts will be explained in upcoming articles. I recommend you to download <b>Edsim51 simulator</b>
(or any other one you prefer) and try out these programs. Make changes
to these codes and write simple codes based on your ideas – like
Multiplying 2 numbers, Generating a particular
series, Arithmetic calculator etc. Only by doing yourself, you can
master the art of programming!</div>
<div style="text-align: justify;">
<b>Happy Learning!</b><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<div style="text-align: center;">
<a href="http://www.electronicsirfan.blogspot.com/" target="_blank">\\\\related topics\\\</a></div>
<ul>
<li><a href="http://electronicsirfan.blogspot.com/2013/12/8051-special-function-registers-and.html" target="_blank">8051 Special Function Registers and Ports</a>, </li>
<li> <a href="http://electronicsirfan.blogspot.com/2014/01/ultrasonic-range-finder-using-8051.html" target="_blank">Ultrasonic range finder using 8051</a>,</li>
<li><a href="http://electronicsirfan.blogspot.com/2013/12/8051-programming-tutorial.html" target="_blank">8051 Programming Tutorial</a>, </li>
<li><a href="http://electronicsirfan.blogspot.com/2013/12/8051-microcontroller8051.html" target="_blank">8051 Microcontroller/8051 Microcontroller Architecture,</a> </li>
<li> <a href="http://electronicsirfan.blogspot.com/2013/12/interfacing-of-buzzer-using.html">Interfacing Of a Buzzer Using Microcontroller 89C52/89S52,</a> </li>
<li> <a href="http://electronicsirfan.blogspot.com/2013/12/digital-clock-using-microcontroller_22.html">Digital Clock Using Microcontroller 89C52/89S52</a></li>
<li><div class="post-title entry-title">
<a href="http://electronicsirfan.blogspot.com/2013/12/digital-locking-system-using.html"> Digital Locking System Using Microcontroller 89C52/89S52 </a>
</div>
<div class="postmeta-primary">
<span class="meta_date"><br /></span></div>
</li>
</ul>
</div>
<table><tbody>
<tr><td><br /></td>
<td></td></tr>
</tbody></table>
<h3 style="text-align: center;">
<a href="http://www.electronicsirfan.blogspot.com/" target="_blank">Electronics Lab</a> Created By<a href="https://plus.google.com/101596347605966492090" target="_blank"> Muhammad Irfan</a><br /> </h3>
</div>
Anonymoushttp://www.blogger.com/profile/13526216155838659104noreply@blogger.com0tag:blogger.com,1999:blog-2190029239849113272.post-63938121400689894142013-12-26T02:16:00.002-08:002014-01-07T07:37:52.258-08:008051 Microcontroller/8051 Microcontroller Architecture<div dir="ltr" style="text-align: left;" trbidi="on">
<h3 style="text-align: center;">
8051 Microcontroller/8051 Microcontroller Architecture</h3>
<div style="text-align: justify;">
<b>A micro controller</b> is
an integrated circuit or a chip with a processor and other support
devices like program memory, data memory, I/O ports, serial
communication interface etc integrated together. Unlike a microprocessor
(<b>ex: Intel 8085</b>), a microcontroller does not require
any external interfacing of support devices. Intel 8051 is the most
popular microcontroller ever produced in the world market. Now lets talk
about 8051 microcontroller in detail.</div>
<div style="text-align: justify;">
Before going further, it will be interesting for you to understand the <i><b>difference between a Microprocessor and Microcontroller</b></i>. We have a detailed article which describes the basic difference between both.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Here is a Quick Access to various sections of this article:-</b></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: left;">
<a href="http://electronicsirfan.blogspot.com/2013/12/8051-programming-tutorial.html" target="_blank">8051 Programming Tutorial </a> , <a href="http://electronicsirfan.blogspot.com/2014/01/difference-between-microcontroller-and.html" target="_blank"> Microprocessor and Microcontroller</a> , </div>
<div style="text-align: left;">
<div style="text-align: center;">
<a href="http://electronicsirfan.blogspot.com/2013/12/8051-special-function-registers-and.html" target="_blank">8051 Special Function Registers and Ports</a> , <a href="http://electronicsirfan.blogspot.com/2014/01/ultrasonic-range-finder-using-8051.html" target="_blank">Ultrasonic range finder using 8051</a></div>
</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<h3 style="text-align: justify;">
Introduction</h3>
<div style="text-align: justify;">
<b>Intel</b> first produced a microcontroller in <b>1976</b> under the name <b>MCS-48</b>, which was an <b>8 bit</b>
microcontroller. Later in 1980 they released a further improved version
(which is also 8 bit), under the name MCS-51. The most popular
microcontroller 8051 belongs to the MCS-51 family of microcontrollers by
Intel. Following the success of 8051, many other semiconductor
manufacturers released microcontrollers under their own brand name but
using the MCS-51 core. Global companies and giants in semiconductor
industry like <b>Microchip, Zilog, Atmel, Philips, Siemens</b>
released products under their brand name. The specialty was that all
these devices could be programmed using the same MCS-51 instruction
sets. They basically differed in support device configurations like
improved memory, presence of an ADC or DAC etc. Intel then released its
first 16 bit microcontroller in 1982, under name MCS-96</div>
<h3 style="text-align: justify;">
8051 Microcontroller Packaging</h3>
<div style="text-align: justify;">
There is no need of explaining what each
package means, you already know it. So I will skim through mainly used
packaging for 8051. See, availability of various packages change from
device to device. The most commonly used is Dual Inline Package (40
pins) – known popularly as DIP. 8051 is also available in QFP (Quad Flat
Package), TQFP (Thin Quad Flat Package), PQFP (Plastic Quad Flat
Package) etc. For explaining the pin diagram, we have used a 40 pin DIP
IC as model.</div>
<h3 style="text-align: justify;">
8051 Microcontroller Architecture</h3>
<div style="text-align: justify;">
Its possible to explain microcontroller
architecture to a great detail, but we are limiting scope of this
article to internal architecture, pin configuration, program memory and
data memory organization. The basic architecture remains same for the
MCS-51 family. In general all microcontrollers in MCS- 51 family are
represented by XX51, where XX can take values like 80, 89 etc.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Schematic and Features</b></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX99MU7K_nmmCf_MLuOKMER1SyRqtG0tVdEQoEA3rwUAq__BoMx8Vws6k4RGoVZ0NuRXdA_69oirHgxaxTzy7s8H1zgR1neRlc0TGRGsKAEuNg5wBAuNIxf_2vKj3YxaLIG80H1aYoIMdX/s1600/8051-schematic-Inputs-and-Outputs.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX99MU7K_nmmCf_MLuOKMER1SyRqtG0tVdEQoEA3rwUAq__BoMx8Vws6k4RGoVZ0NuRXdA_69oirHgxaxTzy7s8H1zgR1neRlc0TGRGsKAEuNg5wBAuNIxf_2vKj3YxaLIG80H1aYoIMdX/s1600/8051-schematic-Inputs-and-Outputs.jpg" /></a></div>
<div style="text-align: justify;">
<b> </b>
</div>
<h2>
8051 Microcontroller</h2>
<br />
<div style="text-align: justify;">
<b>A micro controller</b>
is an integrated circuit or a chip with a processor and other support
devices like program memory, data memory, I/O ports, serial
communication interface etc integrated together. Unlike a microprocessor
(<b>ex: Intel 8085</b>), a microcontroller does not require
any external interfacing of support devices. Intel 8051 is the most
popular microcontroller ever produced in the world market. Now lets talk
about 8051 microcontroller in detail.</div>
<div style="text-align: justify;">
Before going further, it will be interesting for you to understand the <a href="http://electronicsirfan.blogspot.com/2013/12/8051-programming-tutorial.html" target="_blank"><i><b>difference between a Microprocessor and Microcontroller</b></i>.</a> We have a detailed article which describes the basic difference between both.</div>
<div style="text-align: justify;">
<span style="text-decoration: underline;"><b>Microprocessor vs Microcontroller </b></span></div>
<div style="text-align: justify;">
<span style="text-decoration: underline;"><b><br /></b></span></div>
<div style="text-align: justify;">
<b>Here is a Quick Access to various sections of this article:-</b></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Pin Diagram :- <a href="http://electronicsirfan.blogspot.com/2013/12/8051-microcontroller8051.html" target="_blank">Internal Architecture</a> :- Program Memory Organization :- Data Memory Organization :-</b><b>8051 System Clock :- 8051 Reset Circuit</b></div>
<h3 style="text-align: justify;">
Introduction</h3>
<div style="text-align: justify;">
<b>Intel</b> first produced a microcontroller in <b>1976</b> under the name <b>MCS-48</b>, which was an <b>8 bit</b>
microcontroller. Later in 1980 they released a further improved version
(which is also 8 bit), under the name MCS-51. The most popular
microcontroller 8051 belongs to the MCS-51 family of microcontrollers by
Intel. Following the success of 8051, many other semiconductor
manufacturers released microcontrollers under their own brand name but
using the MCS-51 core. Global companies and giants in semiconductor
industry like <b>Microchip, Zilog, Atmel, Philips, Siemens</b>
released products under their brand name. The specialty was that all
these devices could be programmed using the same MCS-51 instruction
sets. They basically differed in support device configurations like
improved memory, presence of an ADC or DAC etc. Intel then released its
first 16 bit microcontroller in 1982, under name MCS-96</div>
<h3 style="text-align: justify;">
8051 Microcontroller Packaging</h3>
<div style="text-align: justify;">
There is no need of explaining what each
package means, you already know it. So I will skim through mainly used
packaging for 8051. See, availability of various packages change from
device to device. The most commonly used is Dual Inline Package (40
pins) – known popularly as DIP. 8051 is also available in QFP (Quad Flat
Package), TQFP (Thin Quad Flat Package), PQFP (Plastic Quad Flat
Package) etc. For explaining the pin diagram, we have used a 40 pin DIP
IC as model.</div>
<h3 style="text-align: justify;">
8051 Microcontroller Architecture</h3>
<div style="text-align: justify;">
Its possible to explain microcontroller
architecture to a great detail, but we are limiting scope of this
article to internal architecture, pin configuration, program memory and
data memory organization. The basic architecture remains same for the
MCS-51 family. In general all microcontrollers in MCS- 51 family are
represented by XX51, where XX can take values like 80, 89 etc.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Schematic and Features</b></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd0TZSUXRq0ELP-Q9XWNCsXHetpx43VoHBpoI1YgEiKgur0fMbUZIh89H_U5cZwlxH5Bicjl-3qGa5PO4YuXqlgRm_D5jT5wDr5QImx0LTawbpGhNsu1avsSLEpB8F0zATDvEAlamyB7da/s1600/8051-schematic-Inputs-and-Outputs.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd0TZSUXRq0ELP-Q9XWNCsXHetpx43VoHBpoI1YgEiKgur0fMbUZIh89H_U5cZwlxH5Bicjl-3qGa5PO4YuXqlgRm_D5jT5wDr5QImx0LTawbpGhNsu1avsSLEpB8F0zATDvEAlamyB7da/s1600/8051-schematic-Inputs-and-Outputs.jpg" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
The general schematic diagram of 8051
microcontroller is shown above. We can see 3 system inputs, 3 control
signals and 4 ports (for external interfacing). A Vcc power supply and
ground is also shown. Now lets explain and go through each in detail.
System inputs are necessary to make the micro controller functional. So
the first and most important of this is power, marked as Vcc with a GND
(ground potential). Without proper power supply, no electronic system
would work. XTAL 1 and XTAL 2 are for the system clock inputs from
crystal clock circuit. RESET input is required to initialize
microcontroller to default/desired values and to make a new start.</div>
<div style="text-align: justify;">
There are 3 control signals, EA,PSEN and
ALE. These signals known as External Access (EA), Program Store Enable
(PSEN), and Address Latch Enable (ALE) are used for external memory
interfacing.</div>
<div style="text-align: justify;">
Take a look at the <b>schematic diagram below</b> (a functional microcontroller)</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHCPbDI2AJSWx3NLybvOjPIw2JL5jsbIDWlf-0SDj1IQHQqReU4XUprPaocsO9hthyphenhyphenu4Iy_JtQ83s7UotR3j_xyDYDa7blkMCNM5ktJsqdGWbp-LnlYdX6vekF5tYs_cgHtn8TlSuvSlDL/s1600/8051-microcontroller-functional-circuit.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHCPbDI2AJSWx3NLybvOjPIw2JL5jsbIDWlf-0SDj1IQHQqReU4XUprPaocsO9hthyphenhyphenu4Iy_JtQ83s7UotR3j_xyDYDa7blkMCNM5ktJsqdGWbp-LnlYdX6vekF5tYs_cgHtn8TlSuvSlDL/s1600/8051-microcontroller-functional-circuit.jpg" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
As mentioned above, control signals are
used for external memory interfacing. If there is no requirement of
external memory interfacing then, EA pin is pulled high (connected to
Vcc) and two others PSEN and ALE are left alone. You can also see a 0.1
micro farad decoupling capacitor connected to Vcc (to avoid HF
oscillations at input).</div>
<div style="text-align: justify;">
There are four ports numbered 0,1,2,3
and called as Port 0, Port 1, Port 2 and Port 3 which are used for
external interfacing of devices like DAC, ADC, 7 segment display, LED
etc. Each port has 8 I/O lines and they all are bit programmable.</div>
<div style="text-align: justify;">
<br /></div>
<h3 style="text-align: justify;">
<a href="http://www.blogger.com/null" id="pin-diagram">8051 Pin Diagram & Description</a></h3>
<h3 style="text-align: justify;">
</h3>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJCtop2A4_TcRXS3pdqCYJfpl8YKP7IDYVbZv3kbn2T_gkaUln4EotdW9n8sI7ITPZYwA8VJGlKFIBwXnj2Nnw9-JmjuVggwMXkAP56IKVmH-UlCQlPiE26_YDgjtf_g9PP2LeSnsrmxE2/s1600/8051-pin-diagram.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJCtop2A4_TcRXS3pdqCYJfpl8YKP7IDYVbZv3kbn2T_gkaUln4EotdW9n8sI7ITPZYwA8VJGlKFIBwXnj2Nnw9-JmjuVggwMXkAP56IKVmH-UlCQlPiE26_YDgjtf_g9PP2LeSnsrmxE2/s1600/8051-pin-diagram.jpg" /></a></div>
<h3 style="text-align: justify;">
</h3>
<div style="text-align: justify;">
For describing pin diagram and pin
configuration of 8051, we are taking into consideration a 40 pin DIP
(Dual inline package). Now lets go through pin configuration in detail.</div>
<div style="text-align: justify;">
<b>Pin-40 :</b> Named as Vcc is the main power source. Usually its +5V DC.</div>
<div style="text-align: justify;">
You may note some pins are designated with two signals (shown in brackets).</div>
<div style="text-align: justify;">
<b>Pins 32-39:</b> Known as
Port 0 (P0.0 to P0.7) – In addition to serving as I/O port, lower order
address and data bus signals are multiplexed with this port (to serve
the purpose of external memory interfacing). This is a bi directional
I/O port (the only one in 8051) and external pull up resistors are
required to function this port as I/O.</div>
<div style="text-align: justify;">
<b>Pin-31:-</b> ALE aka
Address Latch Enable is used to demultiplex the address-data signal of
port 0 (for external memory interfacing.) 2 ALE pulses are available
for each machine cycle.</div>
<div style="text-align: justify;">
<b>Pin-30:-</b> EA/ External
Access input is used to enable or disallow external memory interfacing.
If there is no external memory requirement, this pin is pulled high by
connecting it to Vcc.</div>
<div style="text-align: justify;">
<b>Pin- 29:-</b> PSEN or Program Store Enable is used to read signal from external program memory.</div>
<div style="text-align: justify;">
<b>Pins- 21-28:-</b> Known as
Port 2 (P 2.0 to P 2.7) – in addition to serving as I/O port, higher
order address bus signals are multiplexed with this quasi bi directional
port.</div>
<div style="text-align: justify;">
<b>Pin 20:-</b> Named as Vss – it represents ground (0 V) connection.</div>
<div style="text-align: justify;">
<b>Pins 18 and 19:-</b> Used for interfacing an external crystal to provide system clock.</div>
<div style="text-align: justify;">
<b>Pins 10 – 17:-</b> Known as
Port 3. This port also serves some other functions like interrupts,
timer input, control signals for external memory interfacing RD and WR ,
serial communication signals RxD and TxD etc. This is a quasi bi
directional port with internal pull up.</div>
<div style="text-align: justify;">
<b>Pin 9:-</b> As explained
before RESET pin is used to set the 8051 microcontroller to its initial
values, while the microcontroller is working or at the initial start of
application. The RESET pin must be set high for 2 machine cycles.</div>
<div style="text-align: justify;">
<b>Pins 1 – 8:-</b> Known as
Port 1. Unlike other ports, this port does not serve any other
functions. Port 1 is an internally pulled up, quasi bi directional I/O
port.</div>
<h3 style="text-align: justify;">
</h3>
<h3 style="text-align: justify;">
<a href="http://www.blogger.com/null" id="architecture">8051 Internal Architecture</a></h3>
<h3 style="text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkW0lxcZGuRvBIEo9LZYTpfA66PuhKHF5AQJfqr_JlXsvxQ00N6bTS8wkw-M16cPaUYu2DU35z4IwzKVjPHbF6mfppBGAWWcGCxMpNc_FGWUqPkQpJYePRO2WM8_xtGDYA6XtDe0dnWEm7/s1600/8051-internal-architecture.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkW0lxcZGuRvBIEo9LZYTpfA66PuhKHF5AQJfqr_JlXsvxQ00N6bTS8wkw-M16cPaUYu2DU35z4IwzKVjPHbF6mfppBGAWWcGCxMpNc_FGWUqPkQpJYePRO2WM8_xtGDYA6XtDe0dnWEm7/s640/8051-internal-architecture.jpg" height="467" width="640" /></a></h3>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
There is no need of any detailed
explanation to understand internal architecture of 8051 micro
controller. Just look at the diagram above and you observer it
carefully. The system bus connects all the support devices with the
central processing unit. 8051 system bus composes of an 8 bit data bus
and a 16 bit address bus and bus control signals. From the figure you
can understand that all other devices like program memory, ports, data
memory, serial interface, interrupt control, timers, and the central
processing unit are all interfaced together through the system bus. RxD
and TxD (serial port input and output) are interfaced with port 3.</div>
<h3 style="text-align: justify;">
8051 Memory Organization</h3>
<div style="text-align: justify;">
Before going deep into the memory
architecture of 8051, lets talk a little bit about two variations
available for the same. They are Princeton architecture and Harvard
architecture. Princeton architecture treats address memory and data
memory as a single unit (does not distinguish between two) where as
Harvard architecture treats program memory and data memory
as separate entities. Thus Harvard architecture demands address, data
and control bus for accessing them separately where as Princeton
architecture does not demand any such separate bus.</div>
<div style="text-align: justify;">
<b>Example:-</b> 8051 micro controller is based on Harvard architecture and 8085 micro processor is based on Princeton architecture.</div>
<div style="text-align: justify;">
<b>Thus 8051 has two memories :- Program memory and Data memory</b></div>
<div style="text-align: justify;">
<br /></div>
<h3 style="text-align: justify;">
<a href="http://www.blogger.com/null" id="program-memory">Program memory organization</a></h3>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgKaLh1bGiOTtLyW53C9x1nuLImb5qbZroK70gazMr81GY8OtPiDUnE3-gWhHm4qcLRiS9ZDuA9CdkJXfAuEt6BFUMLqKyHYCu0dFr05-D-9q6Xl5BTz-sp_ybU668DTLeXK3RXtNYVHRa/s1600/Program-Memory-Arrangement.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgKaLh1bGiOTtLyW53C9x1nuLImb5qbZroK70gazMr81GY8OtPiDUnE3-gWhHm4qcLRiS9ZDuA9CdkJXfAuEt6BFUMLqKyHYCu0dFr05-D-9q6Xl5BTz-sp_ybU668DTLeXK3RXtNYVHRa/s1600/Program-Memory-Arrangement.jpg" /></a></div>
<h3 style="text-align: justify;">
</h3>
<div style="text-align: justify;">
Now lets dive into the program memory
organization 0f 8051. It has an internal program of 4K size and if
needed an external memory can be added (by interfacing ) of size 60K
maximum. So in total 64K size memory is available for 8051 micro
controller. By default, the External Access (EA) pin should be
connected Vcc so that instructions are fetched from internal memory
initially. When the limit of internal memory (4K) is crossed, control
will automatically move to external memory to fetch remaining
instructions. If the programmer wants to fetch instruction from external
memory only (bypassing the internal memory), then he must connect
External Access (EA) pin to ground (GND).</div>
<div style="text-align: justify;">
You may already know that 8051 has a
special feature of locking the program memory (internal) and hence
protecting against software piracy. This feature is enable by program
lock bits. Once these bits are programmed, contents of internal memory
can not be accessed using an external circuitry. How ever locking the
software is not possible if external memory is also used to store the
software code. Only internal memory can be locked and protected. Once
locked, these bits can be unlocked only by a memory-erase operation,
which in turn will erase the programs in internal memory too.</div>
<div style="text-align: justify;">
8051 is capable of pipelining.
Pipelining makes a processor capable of fetching the next instruction
while executing previous instruction. Its some thing like multi tasking,
doing more than one operation at a time. 8051 is capable of fetching
first byte of the next instruction while executing the previous
instruction.</div>
<h3 style="text-align: justify;">
</h3>
<h3 style="text-align: justify;">
<a href="http://www.blogger.com/null" id="data-memory">Data memory organization</a></h3>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikZEEJ6hF_3ZrOMyKFCFc3vJn9Y19zntQ2lq9Ftl7XvbPaImAtT82bij9gU_jEp3uD-LDgs1i9GIRF_SJYRssPf3oliQCJ8qkqtWTj77hTWMn_zuXqu1CRrwHpWWhhqKxxM_3ulQcnQOCY/s1600/Internal-and-External-Data-Memory-of-8051.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikZEEJ6hF_3ZrOMyKFCFc3vJn9Y19zntQ2lq9Ftl7XvbPaImAtT82bij9gU_jEp3uD-LDgs1i9GIRF_SJYRssPf3oliQCJ8qkqtWTj77hTWMn_zuXqu1CRrwHpWWhhqKxxM_3ulQcnQOCY/s1600/Internal-and-External-Data-Memory-of-8051.jpg" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
In the MCS-51 family, 8051 has 128 bytes of internal data memory and it
allows interfacing external data memory of maximum size up to 64K. So
the total size of data memory in 8051 can be upto 64K (external) + 128
bytes (internal). Observe the diagram carefully to get more
understanding. So there are 3 separations/divisions of the data memory:-
1) Register banks 2) Bit addressable area 3) Scratch pad area.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUWSVVIeFTRMnQYiJP9-JA6KOXpOZj2W4g9CTRO-C5Dxh0HM1xY9oEvhE4kc1pjcErjXdfuL78rna2q6iWw-6RBzRvWT6cWdfuP_Jp9lVbi4Dyk1Cwys8MxvS3lCbhguEUa-aA1mm4xDb2/s1600/Lower-128-Bytes-of-Internal-RAM-of-8051.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUWSVVIeFTRMnQYiJP9-JA6KOXpOZj2W4g9CTRO-C5Dxh0HM1xY9oEvhE4kc1pjcErjXdfuL78rna2q6iWw-6RBzRvWT6cWdfuP_Jp9lVbi4Dyk1Cwys8MxvS3lCbhguEUa-aA1mm4xDb2/s1600/Lower-128-Bytes-of-Internal-RAM-of-8051.jpg" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Register banks form the lowest 32 bytes
on internal memory and there are 4 register banks designated bank #0,#1,
#2 and #3. Each bank has 8 registers which are designated as R0,R1…R7.
At a time only one register bank is selected for operations and the
registers inside the selected bank are accessed using mnemonics R0..R1..
etc. Other registers can be accessed simultaneously only by direct
addressing. Registers are used to store data or operands during
executions. By default register bank #0 is selected (after a system
reset).</div>
<div style="text-align: justify;">
The bit addressable ares of 8051 is
usually used to store bit variables. The bit addressable area is formed
by the 16 bytes next to register banks. They are designated from address
20H to 2FH (total 128 bits). Each bits can be accessed from 00H to 7FH
within this 128 bits from 20H to 2FH. Bit addressable area is mainly
used to store bit variables from application program, like status of an
output device like LED or Motor (ON/OFF) etc. We need only a bit to
store this status and using a complete byte addressable area for storing
this is really bad programming practice, since it results in wastage of
memory.</div>
<div style="text-align: justify;">
The scratch pad area is the upper 80
bytes which is used for general purpose storage. Scratch pad area is
from 30H to 7FH and this includes stack too.</div>
<h3 style="text-align: justify;">
</h3>
<h3 style="text-align: justify;">
<a href="http://www.blogger.com/null" id="system-clock">8051 System Clock</a></h3>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBJcTSaUaCwqZLodRm9sgtpRQuPTVutYgnZNMoSrbrBdjhbFS-T2rLVkQHxtPP5KPxQYvOieo0H60qEjBV6uD4q_KOCXXzPyNiZGTvMDDbOYRGyZe3OjzVGcub0SSJPU2MDiJcdpYAhW4O/s1600/8051-Clock-Circuit.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBJcTSaUaCwqZLodRm9sgtpRQuPTVutYgnZNMoSrbrBdjhbFS-T2rLVkQHxtPP5KPxQYvOieo0H60qEjBV6uD4q_KOCXXzPyNiZGTvMDDbOYRGyZe3OjzVGcub0SSJPU2MDiJcdpYAhW4O/s1600/8051-Clock-Circuit.jpg" /> </a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
An 8051 clock circuit is shown above.
In general cases, a quartz crystal is used to make the clock circuit.
The connection is shown in figure (a) and note the connections to XTAL 1
and XTAL 2. In some cases external clock sources are used and you can
see the various connections above. Clock frequency limits (maximum and
minimum) may change from device to device. Standard practice is to use
12MHz frequency. If serial communications are involved then its best to
use 11.0592 MHz frequency.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxQEqYXm340xmK1jarmW-gn-5ujvvn-4RU6fAGCf32rFzwDpXpEkzsnUKEzpETTHjawdgNpWxOpRlcAlfqLfg6k7-JwTn0OnW5mxsvoXDDbToXDSF09mn2crVcQMCQbwenlFknPsCPghfp/s1600/System-Clock.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxQEqYXm340xmK1jarmW-gn-5ujvvn-4RU6fAGCf32rFzwDpXpEkzsnUKEzpETTHjawdgNpWxOpRlcAlfqLfg6k7-JwTn0OnW5mxsvoXDDbToXDSF09mn2crVcQMCQbwenlFknPsCPghfp/s1600/System-Clock.jpg" /> </a></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Okay, take a look at the above machine
cycle waveform. One complete oscillation of the clock source is called a
pulse. Two pulses forms a state and six states forms one machine cycle.
Also note that, two pulses of ALE are available for 1 machine cycle.</div>
<h3 style="text-align: justify;">
<a href="http://www.blogger.com/null" id="reset-circuit">8051 Reset Circuit</a></h3>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1qbgR02oMme_RfxzulfB16VYdjKl7d02RMuQWoAv8wiLfwNo0uhLr6D4aKk7aD0gIwdKYDB2iqmXIkscdIBHR4Y9ql5DFuU4YC0198Zub5irK1gipWJ9GwEIQ9i480JA7SwD_RIuP-NcA/s1600/8051-reset-circuit.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1qbgR02oMme_RfxzulfB16VYdjKl7d02RMuQWoAv8wiLfwNo0uhLr6D4aKk7aD0gIwdKYDB2iqmXIkscdIBHR4Y9ql5DFuU4YC0198Zub5irK1gipWJ9GwEIQ9i480JA7SwD_RIuP-NcA/s1600/8051-reset-circuit.jpg" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
8051 can be reset in two ways 1) is power-on reset – which resets the
8051 when power is turned ON and 2) manual reset – in which a reset
happens only when a push button is pressed manually. Two different
reset circuits are shown above. A reset doesn’t affect contents of
internal RAM. For reset to happen, the reset input pin (pin 9) must be
active high for atleast 2 machine cycles. During a reset operation :-
Program counter is cleared and it starts from 00H, register bank #0 is
selected as default, Stack pointer is initialized to 07H, all ports are
written with FFH. </div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<h3 style="text-align: justify;">
</h3>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<div style="text-align: center;">
<a href="http://www.electronicsirfan.blogspot.com/" target="_blank">\\\\related topics\\\</a></div>
<ul>
<li><a href="http://electronicsirfan.blogspot.com/2013/12/8051-special-function-registers-and.html" target="_blank">8051 Special Function Registers and Ports</a>, </li>
<li> <a href="http://electronicsirfan.blogspot.com/2014/01/ultrasonic-range-finder-using-8051.html" target="_blank">Ultrasonic range finder using 8051</a>,</li>
<li><a href="http://electronicsirfan.blogspot.com/2013/12/8051-programming-tutorial.html" target="_blank">8051 Programming Tutorial</a>, </li>
<li><a href="http://electronicsirfan.blogspot.com/2013/12/8051-microcontroller8051.html" target="_blank">8051 Microcontroller/8051 Microcontroller Architecture,</a> </li>
<li> <a href="http://electronicsirfan.blogspot.com/2013/12/interfacing-of-buzzer-using.html">Interfacing Of a Buzzer Using Microcontroller 89C52/89S52,</a> </li>
<li> <a href="http://electronicsirfan.blogspot.com/2013/12/digital-clock-using-microcontroller_22.html">Digital Clock Using Microcontroller 89C52/89S52</a></li>
<li><div class="post-title entry-title">
<a href="http://electronicsirfan.blogspot.com/2013/12/digital-locking-system-using.html"> Digital Locking System Using Microcontroller 89C52/89S52 </a>
</div>
<div class="postmeta-primary">
<span class="meta_date"><br /></span></div>
</li>
</ul>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: center;">
<b> <a href="http://www.electronicsirfan.blogspot.com/" target="_blank">Electronics Lab</a> Created By <a href="https://plus.google.com/101596347605966492090" target="_blank">Muhammad Irfan</a></b> </div>
</div>
Anonymoushttp://www.blogger.com/profile/13526216155838659104noreply@blogger.com0tag:blogger.com,1999:blog-2190029239849113272.post-69799793853532357312013-12-26T00:20:00.000-08:002014-01-07T07:39:25.846-08:008051 Special Function Registers and Ports<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: center;">
8051 Special Function Registers and Ports</h2>
<div style="text-align: justify;">
So you may have guessed something from the name itself – “<i><b>Special Function Registers</b></i>” known with an acronym <b>SFR</b>. Well, your guess is right <img alt=":)" class="wp-smiley" src="http://www.circuitstoday.com/wp-includes/images/smilies/icon_smile.gif" /> Okay! Lets come to the point. There <b>are 21 Special function registers (SFR)</b>
in 8051 micro controller and this includes Register A, Register B,
Processor Status Word (PSW), PCON etc etc. There are 21 unique
locations for these 21 special function registers and each of these
register is of 1 byte size. Some of these special function registers <i><b>are bit addressable</b></i> (which means you can access 8 individual bits inside a single byte), while some others are <i><b>only byte addressable</b></i>. Let’s take a look at them in detail.</div>
<h3 style="text-align: justify;">
Register A/Accumulator</h3>
<div style="text-align: justify;">
The most important of all special function registers, that’s the first comment about <b>Accumulator</b> which is also known as <b>ACC</b> or <b>A.</b>
The Accumulator (sometimes referred to as Register A also) holds the
result of most of arithmetic and logic operations. ACC is usually
accessed by direct addressing and its physical address is <b>E0H.</b> Accumulator is <i><b>both byte and bit addressable.</b></i>
You can understand this from the figure shown below. To access the
first bit (i.e bit 0) or to access accumulator as a single byte (all 8
bits at once), you may use the same physical address E0H. Now if you
want to access the second bit (i.e bit 1), you may use E1H and for third
bit E2H and so on.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZNy2NRuW4LgXzrQ_CuiThwT1OYOT8Q7tK1rKOzKMygABaOZQ57H_BRzEGBYpGQX48d8qweJlkVmiEPH1VdNlVP7lYHGRgHPq40zZ3uxhvemDlIl6ynu9fvVuWDrUic_T8yVSAutHp0NKx/s1600/Accumulator-Register-A.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZNy2NRuW4LgXzrQ_CuiThwT1OYOT8Q7tK1rKOzKMygABaOZQ57H_BRzEGBYpGQX48d8qweJlkVmiEPH1VdNlVP7lYHGRgHPq40zZ3uxhvemDlIl6ynu9fvVuWDrUic_T8yVSAutHp0NKx/s1600/Accumulator-Register-A.jpg" /> </a></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<h3 style="text-align: justify;">
Register B</h3>
<div style="text-align: justify;">
The major purpose of this register is in
executing multiplication and division. The 8051 micro controller has a
single instruction for multiplication<b> (MUL)</b> and division <b>(DIV)</b>.
If you are familiar with 8085, you may now know that multiplication is
repeated addition, where as division is repeated subtraction. While
programming 8085, you may have written a loop to execute repeated
addition/subtraction to perform multiplication and division. Now here in
8051 you can do this with a single instruction.</div>
<div style="text-align: justify;">
<b>Ex: MUL A,B</b> – When this instruction is executed, data inside A and data inside B is multiplied and answer is stored in A.</div>
<div style="text-align: justify;">
<span style="color: blue;"><b>Note:</b></span> For MUL and DIV instructions, it is necessary that the two operands must be in A and B.</div>
<div style="text-align: justify;">
<span style="color: red;"><b>Note:</b></span> Follow this link if you are interested in knowing about <a href="http://www.circuitstoday.com/microprocessor-and-microcontroller"><b>differences between a microprocessor and microcontroller</b></a>.</div>
<div style="text-align: justify;">
Register B is also byte addressable and
bit addressable. To access bit o or to access all 8 bits (as a single
byte), physical address F0 is used. To access bit 1 you may use F1 and
so on. Please take a look at the picture below.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzZOAdgL7s3dcLVmNHrhI30TNRHml_2KHe4vQMuRIXtpyq0WjvmVFB4k5dEjRXlRXpCMfzWTej-LlcLOOPCl4QaJK8sk49l99NaE-g6yx8Q9Ign08rxGIuG16BZHaDHgyDuzPLu9b_ywhf/s1600/Register-B.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzZOAdgL7s3dcLVmNHrhI30TNRHml_2KHe4vQMuRIXtpyq0WjvmVFB4k5dEjRXlRXpCMfzWTej-LlcLOOPCl4QaJK8sk49l99NaE-g6yx8Q9Ign08rxGIuG16BZHaDHgyDuzPLu9b_ywhf/s1600/Register-B.jpg" /> </a></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>Note:</b> Register B can also be used for other general purpose operations.</div>
<h3 style="text-align: justify;">
Port Registers</h3>
<div style="text-align: justify;">
As you may already know, there are 4
ports for 8051. If you are unfamiliar of the architecture of 8051 please
read the following article:- <a href="http://www.circuitstoday.com/8051-microcontroller#architecture"><b>The architecture of 8051</b></a></div>
<div style="text-align: justify;">
So 4 Input/Output ports named P0, P1, P2
and P3 has got four corresponding port registers with same name P0, P1,
P2 and P3. Data must be written into port registers first to send it
out to any other external device through ports. Similarly any data
received through ports must be read from port registers for performing
any operation. All 4 port registers are bit as well as byte addressable.
Take a look at the figure below for a better understanding of port
registers.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjP9F9cXbVZlPFAexUW3hM4qjYV_AnaVA1pFvqK25pLi-NTSoz3vnu0r2QB9-mgmkrsIho49hFjh1BDfpiXMS2NEQfxx8ZPCA2wV8kDWqYfrQfC08M0Xc57i3Rnh4_vdsYDvPPdQq_4NO3S/s1600/Port-Registers.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjP9F9cXbVZlPFAexUW3hM4qjYV_AnaVA1pFvqK25pLi-NTSoz3vnu0r2QB9-mgmkrsIho49hFjh1BDfpiXMS2NEQfxx8ZPCA2wV8kDWqYfrQfC08M0Xc57i3Rnh4_vdsYDvPPdQq_4NO3S/s1600/Port-Registers.jpg" /> </a></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b>From the figure:-</b></div>
<ul style="text-align: justify;">
<li>The physical address of port 0 is 80</li>
<li>The physical address of port 1 is 90</li>
<li>And that of port 2 is A0</li>
<li>And that of port 3 is B0</li>
</ul>
<h3 style="text-align: justify;">
Stack Pointer</h3>
<div style="text-align: justify;">
Known popularly with an acronym SP,
stack pointer represents a pointer to the the system stack. Stack
pointer is an 8 bit register, the direct address of SP is 81H and it is
only byte addressable, which means you cant access individual bits of
stack pointer. The content of the stack pointer points to the last
stored location of system stack. To store something new in system stack,
the SP must be incremented by 1 first and then execute the “store”
command. Usually after a system reset SP is initialized as 07H and data
can be stored to stack from 08H onwards. This is usually a default case
and programmer can alter values of SP to suit his needs.</div>
<h3 style="text-align: justify;">
Power Management Register (PCON)</h3>
<div style="text-align: justify;">
Power management using a
microcontroller is something you see every day in mobile phones.
Haven’t you noticed and got wondered by a mobile phone automatically
going into stand by mode when not used for a couple of seconds or
minutes ? This is achieved by power management feature of the controller
used inside that phone.</div>
<div style="text-align: justify;">
As the name indicates, this register is
used for efficient power management of 8051 micro controller. Commonly
referred to as PCON register, this is a dedicated SFR for power
management alone. From the figure below you can observe that there are 2
modes for this register :- <i><b>Idle mode and Power down mode.</b></i></div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfcabX86p35snyGu9np1EB-sVjDPoMNxRf5Mqe-V-vzQ814wTSdMT6k-I5wBcg50AJ93C2a2Hz6DaJvg0h-7b0v7vpqQDQ9uj4RPeb_-JUbWGbHVabWCzm2DzuV6CBWZZ7NsOKQQxI8qgM/s1600/Register-PCON.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfcabX86p35snyGu9np1EB-sVjDPoMNxRf5Mqe-V-vzQ814wTSdMT6k-I5wBcg50AJ93C2a2Hz6DaJvg0h-7b0v7vpqQDQ9uj4RPeb_-JUbWGbHVabWCzm2DzuV6CBWZZ7NsOKQQxI8qgM/s1600/Register-PCON.jpg" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Setting bit 0 will move the micro controller to Idle mode and Setting bit 1 will move the micro controller to Power down mode.</div>
<h3 style="text-align: justify;">
Processor Status Word (PSW)</h3>
<div style="text-align: justify;">
Commonly known as the PSW register, this
is a vital SFR in the functioning of micro controller. This register
reflects the status of the operation that is being carried out in the
processor. The picture below shows PSW register and the way register
banks are selected using PSW register bits – RS1 and RS0. PSW register
is both bit and byte addressable. The physical address of PSW starts
from D0H. The individual bits are then accessed using D1, D2 … D7. The
various individual bits are explained below.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsFeBBKXXpHfqVjIxsNkXNXsUdfyVqI77nDdYkjD0gP100EzYfFesr_J5zBUC6N6mesNPH82RM8nlL8HHOJuG8nEvMejjtMzGnE2pfXrYeVrQPkAIgxHuj_fJuAGDTZaU2cgY5fZMylk4Q/s1600/Processor-Status-Word.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsFeBBKXXpHfqVjIxsNkXNXsUdfyVqI77nDdYkjD0gP100EzYfFesr_J5zBUC6N6mesNPH82RM8nlL8HHOJuG8nEvMejjtMzGnE2pfXrYeVrQPkAIgxHuj_fJuAGDTZaU2cgY5fZMylk4Q/s640/Processor-Status-Word.jpg" height="246" width="640" /> </a></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div style="text-align: justify;">
</div>
<table border="1" cellpadding="0" cellspacing="0" style="width: 655px;">
<tbody>
<tr>
<td valign="top" width="54"><div align="center">
<b>Bit No</b></div>
</td>
<td valign="top" width="66"><div align="center">
<b>Bit Symbol</b></div>
</td>
<td valign="top" width="76"><div align="center">
<b>Direct Address</b></div>
</td>
<td valign="top" width="85"><div align="center">
<b>Name</b></div>
</td>
<td valign="top" width="335"><div align="center">
<b>Function</b></div>
</td>
</tr>
<tr>
<td valign="top" width="54">0</td>
<td valign="top" width="66">P</td>
<td valign="top" width="76">D0</td>
<td valign="top" width="85">Parity</td>
<td valign="top" width="335">This bit will be set if ACC has odd number of 1’s after an operation. If not, bit will remain cleared.</td>
</tr>
<tr>
<td valign="top" width="54">1</td>
<td valign="top" width="66">-</td>
<td valign="top" width="76">D1</td>
<td valign="top" width="85"><br /></td>
<td valign="top" width="335">User definable bit</td>
</tr>
<tr>
<td valign="top" width="54">2</td>
<td valign="top" width="66">OV</td>
<td valign="top" width="76">D2</td>
<td valign="top" width="85">Overflow</td>
<td valign="top" width="335">OV flag is set if there is a carry from bit
6 but not from bit 7 of an Arithmetic operation. It’s also set if there
is a carry from bit 7 (but not from bit 6) of Acc</td>
</tr>
<tr>
<td valign="top" width="54">3</td>
<td valign="top" width="66">RS0</td>
<td valign="top" width="76">D3</td>
<td valign="top" width="85">Register Bank select bit 0</td>
<td valign="top" width="335">LSB of the register bank select bit. Look for explanation below this table.</td>
</tr>
<tr>
<td valign="top" width="54">4</td>
<td valign="top" width="66">RS1</td>
<td valign="top" width="76">D4</td>
<td valign="top" width="85">Register Bank select bit 1</td>
<td valign="top" width="335">MSB of the register bank select bits.</td>
</tr>
<tr>
<td valign="top" width="54">5</td>
<td valign="top" width="66">F0</td>
<td valign="top" width="76">D5</td>
<td valign="top" width="85">Flag 0</td>
<td valign="top" width="335">User defined flag</td>
</tr>
<tr>
<td valign="top" width="54">6</td>
<td valign="top" width="66">AC</td>
<td valign="top" width="76">D6</td>
<td valign="top" width="85">Auxiliary carry</td>
<td valign="top" width="335">This bit is set if data is coming out from bit 3 to bit 4 of Acc during an Arithmetic operation.</td>
</tr>
<tr>
<td valign="top" width="54">7</td>
<td valign="top" width="66">CY</td>
<td valign="top" width="76">D7</td>
<td valign="top" width="85">Carry</td>
<td valign="top" width="335">Is set if data is coming out of bit 7 of Acc during an Arithmetic operation.</td>
</tr>
</tbody>
</table>
<div style="text-align: justify;">
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
At a time registers can take value from R0,R1…to R7. You may already know there are 32 such registers. <i><b>So how you access 32 registers with just 8 variables to address registers?</b></i>
Here comes the use of register banks. There are 4 register banks named
0,1,2 and 3. Each bank has 8 registers named from R0 to R7. At a time
only one register bank can be selected. Selection of register bank is
made possible through PSW register bits PSW.3 and PSW.4, named as RS0
and RS1.These two bits are known as register bank select bits as they
are used to select register banks. The picture will talk more about
selecting register banks.</div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisurCnV2ikJnJF5yjlpxa0wjys_0G3wBbKWzek0i3t3tEcj01DNdS4thgVs0FqK6fjUwK29gdcmYOSkEBQIp5n2A3jK5VnA7x2lpOYcBjp7ox6ht_zKREM775Zj7QT_L3hHjHU8lYR5xKY/s1600/Processor-Status-Word1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisurCnV2ikJnJF5yjlpxa0wjys_0G3wBbKWzek0i3t3tEcj01DNdS4thgVs0FqK6fjUwK29gdcmYOSkEBQIp5n2A3jK5VnA7x2lpOYcBjp7ox6ht_zKREM775Zj7QT_L3hHjHU8lYR5xKY/s1600/Processor-Status-Word1.jpg" /> </a></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div style="text-align: justify;">
So far we have discussed about all major
SFR’s in 8051. There many other still waiting! Please remember there
are 21 SFR’s and we have discussed only 9 specifically. The table below
lists all other 12 SFR’s.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
</div>
<table border="1" cellpadding="0" cellspacing="0" style="width: 603px;"><tbody>
<tr>
<td valign="top" width="54"><h3 align="center">
<b>SFR</b></h3>
</td>
<td valign="top" width="66"><h3 align="center">
<b>Address</b></h3>
</td>
<td valign="top" width="335"><h3 align="center">
<b>Function</b></h3>
</td>
</tr>
<tr>
<td valign="top" width="54">DPH</td>
<td valign="top" width="66">83</td>
<td valign="top" width="335">Data pointer registers (High). Only byte addressing possible.</td>
</tr>
<tr>
<td valign="top" width="54">DPL</td>
<td valign="top" width="66">82</td>
<td valign="top" width="335">Data pointer register (Low). Only byte addressing possible.</td>
</tr>
<tr>
<td valign="top" width="54">IP</td>
<td valign="top" width="66">B8</td>
<td valign="top" width="335">Interrupt priority. Both bit addressing and byte addressing possible.</td>
</tr>
<tr>
<td valign="top" width="54">IE</td>
<td valign="top" width="66">A8</td>
<td valign="top" width="335">Interrupt enable. Both bit addressing and byte addressing possible.</td>
</tr>
<tr>
<td valign="top" width="54">SBUF</td>
<td valign="top" width="66">99</td>
<td valign="top" width="335">Serial Input/Output buffer. Only byte addressing is possible.</td>
</tr>
<tr>
<td valign="top" width="54">SCON</td>
<td valign="top" width="66">98</td>
<td valign="top" width="335">Serial communication control. Both bit addressing and byte addressing possible.</td>
</tr>
<tr>
<td valign="top" width="54">TCON</td>
<td valign="top" width="66">88</td>
<td valign="top" width="335">Timer control. Both bit addressing and byte addressing possible.</td>
</tr>
<tr>
<td valign="top" width="54">TH0</td>
<td valign="top" width="66">8C</td>
<td valign="top" width="335">Timer 0 counter (High). Only byte addressing is possible.</td>
</tr>
<tr>
<td valign="top" width="54">TL0</td>
<td valign="top" width="66">8A</td>
<td valign="top" width="335">Timer 0 counter (Low). Only byte addressing is possible.</td>
</tr>
<tr>
<td valign="top" width="54">TH1</td>
<td valign="top" width="66">8D</td>
<td valign="top" width="335">Timer 1 counter (High). Only byte addressing is possible.</td>
</tr>
<tr>
<td valign="top" width="54">TL1</td>
<td valign="top" width="66">8B</td>
<td valign="top" width="335">Timer 1 counter (Low). Only byte addressing is possible.</td>
</tr>
<tr>
<td valign="top" width="54">TMOD</td>
<td valign="top" width="66">89</td>
<td valign="top" width="335">Timer mode select. Only byte addressing is possible.</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<i><b><br /></b></i></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<h2 style="text-align: center;">
<a href="http://www.electronicsirfan.blogspot.com/" target="_blank">\\\\related topics\\\</a></h2>
<h2 style="text-align: center;">
<br /></h2>
<ul>
<li><a href="http://electronicsirfan.blogspot.com/2013/12/8051-special-function-registers-and.html" target="_blank">8051 Special Function Registers and Ports</a>, </li>
<li><a href="http://electronicsirfan.blogspot.com/2014/01/ultrasonic-range-finder-using-8051.html" target="_blank">Ultrasonic range finder using 8051</a>,</li>
<li><a href="http://electronicsirfan.blogspot.com/2013/12/8051-programming-tutorial.html" target="_blank">8051 Programming Tutorial</a>, </li>
<li><a href="http://electronicsirfan.blogspot.com/2013/12/8051-microcontroller8051.html" target="_blank">8051 Microcontroller/8051 Microcontroller Architecture,</a> </li>
<li> <a href="http://electronicsirfan.blogspot.com/2013/12/interfacing-of-buzzer-using.html">Interfacing Of a Buzzer Using Microcontroller 89C52/89S52,</a> </li>
<li> <a href="http://electronicsirfan.blogspot.com/2013/12/digital-clock-using-microcontroller_22.html">Digital Clock Using Microcontroller 89C52/89S52</a></li>
<li><div class="post-title entry-title">
<a href="http://electronicsirfan.blogspot.com/2013/12/digital-locking-system-using.html"> Digital Locking System Using Microcontroller 89C52/89S52 </a>
</div>
<div class="postmeta-primary">
<span class="meta_date"><br /></span></div>
</li>
</ul>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: center;">
<a href="http://www.electronicsirfan.blogspot.com/" target="_blank">Electronics Lab</a> Created By <a href="https://plus.google.com/101596347605966492090" target="_blank">Muhammad Irfan</a><br />
</div>
</div>
Anonymoushttp://www.blogger.com/profile/13526216155838659104noreply@blogger.com0tag:blogger.com,1999:blog-2190029239849113272.post-44018151923601351712013-12-22T09:29:00.002-08:002014-01-07T07:39:56.940-08:00Interfacing Of a Buzzer Using Microcontroller 89C52/89S52 <div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
Interfacing Of a Buzzer Using Microcontroller 89C52/89S52 </div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJlxn1ZI6k8Pyxq7woHvROcU6d_QQx0M5mqmHKsrn199ayMAWGokzdhX4inZRPZOfm9SlhK8t94xksyf2q7X-JC03Hob2OW2QhwnRl5Vq3-WJvAJf5QeyNTipGC2bqBAajNsnOYDR-fqk/s400/Buzzer.JPG" height="276" width="400" /></div>
<br />
Welcome back embedded system geeks! In this article we are going to learn about the interfacing of a Buzzer with the microcontroller.
But if this is your first mini-project you should probably check-out
my previous article on Blinking LED'S for more understanding of the
programming I will be dealing with this project. Once you get to know
what Buzzer is and the programming logic behind connecting a Buzzer and a
microcontroller you will able <span class="IL_AD" id="IL_AD2">to apply</span> the same logic to any microcontroller (i.e. your microcontroller may be a PIC or an AVR microcontroller). At the end of the explanation of <span class="IL_AD" id="IL_AD6">the code</span> there are some questions for you to answer which can help you to improve your programming skills.<br />
<br />
<br />
<h2 class="module_title ">
<i>why do we need a Buzzer?</i> </h2>
<div>
Buzzer
is used many times in embedded systems. For an instance-Digital clock
with an alarm-here buzzer can be used an alarm or a fire alarm or an
intruder alarm. There are so many uses.</div>
<h2 class="module_title ">
<span class="Apple-style-span"><span class="Apple-style-span" style="font-size: medium;"><i>Components required</i></span></span></h2>
<div style="text-align: left;">
<ul style="text-align: left;">
<li> 1 microcontroller 89C52(89S52 will also do) </li>
<li> 1 potentiometer-10k </li>
<li> 2 ceramic capacitors-22pF </li>
<li> 1 switch(button for reset purpose) </li>
<li> 1 electrolytic capacitor-10uF,25V </li>
<li> 1 crystal oscillator-11.0592MHz </li>
<li> 1 resistor-10k </li>
<li> 5 LED's </li>
<li> 1 resistor-1k </li>
<li> 5 330 ohm resistor </li>
<li> 1 Buzzer </li>
<li> 1 transistor-BC548</li>
</ul>
<h2 class="module_title ">
<i><span class="Apple-style-span" style="font-size: medium;"><br />
</span></i></h2>
<h2 class="module_title ">
<i><span class="Apple-style-span" style="font-size: medium;">Schematic Diagram </span></i></h2>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_6pfGfEOVKJGHnXcXKIb5kHqdSMjlvgCNcdidYXBcW9gSDYLQFsfdKy735oqP7FYa-HUaMzib0bRzFwk1tkbpGDXkAR4y-Qqui7Lpckji3LB6CHP7The-KwY99ZS4LsT94KOiVBNbM6g/s1600/Buzzer+Schematic.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_6pfGfEOVKJGHnXcXKIb5kHqdSMjlvgCNcdidYXBcW9gSDYLQFsfdKy735oqP7FYa-HUaMzib0bRzFwk1tkbpGDXkAR4y-Qqui7Lpckji3LB6CHP7The-KwY99ZS4LsT94KOiVBNbM6g/s400/Buzzer+Schematic.JPG" height="262" width="400" /></a></div>
<div>
<br /></div>
</div>
<h2 class="module_title ">
</h2>
This project has been made using Proteus software.If you want to learn more about the software you can watch the <span class="IL_AD" id="IL_AD7">tutorials</span> provided below<br />
<br />
<h2 class="module_title ">
<i>The connection of the circuit is explained below</i></h2>
<div style="text-align: left;">
<ul style="text-align: left;">
<li> Port 2 of the microcontroller is defined as the output port </li>
<li> Port 3 of the microntroller is defined as the output port </li>
<li> 4 LED's are connected to the four pins of the output port 2 from P2.0 TO P2.3 respectively </li>
<li> An LED is connected to the pin 3 of the output port 3 of the microcontroller </li>
<li> A Buzzer is connected to the pin 8 of the output port 3 </li>
<li> Other components connected to the microcontroller are for the working of the microcontroller. </li>
</ul>
</div>
<div style="text-align: left;">
<h2 class="module_title ">
<i>Working </i> </h2>
</div>
<div style="text-align: left;">
</div>
<div style="text-align: left;">
The working of the <span class="IL_AD" id="IL_AD9">circuit</span> is shown with an application of a decade counter. As soon as the microcontroller receives a power supply, the counter will start counting. An image of the counter is shown below<br />
<br />
<h2 class="module_title ">
<br />
</h2>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXF9Jp17P8VVCduG-mwctFAMXUEGhwb9yazeVv1BzqMNuwwbiiF_jjQybOZIBFyRcXJlaqO88cCGji2Ebxq9l_c7zZmdMxBcyYlsl-RFelV_crLeL-uYYJXlAb3vNVTxUlbLC2wExZO6c/s1600/counter.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXF9Jp17P8VVCduG-mwctFAMXUEGhwb9yazeVv1BzqMNuwwbiiF_jjQybOZIBFyRcXJlaqO88cCGji2Ebxq9l_c7zZmdMxBcyYlsl-RFelV_crLeL-uYYJXlAb3vNVTxUlbLC2wExZO6c/s320/counter.JPG" height="245" width="320" /></a></div>
<h2 class="module_title ">
</h2>
<h2 class="module_title ">
</h2>
<div>
The Decade counter will count from 0 to 9 and when the counter counts 9, the buzzer will be switched ON.The <span class="IL_AD" id="IL_AD11">transistor</span> connected to the buzzer acts as a switch.The programming of the microcontroller is explained below:<br />
<br />
<div dir="ltr" style="text-align: left;">
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
#include "REGX52.H"</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
#include "delay.h" /*delay header file is included*/</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
void main()</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
{</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
P2=0X00;/*port 2 is defined as output port*/</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
P3=0XFF;/*port 3 is defined as output as port*/</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
while(1)</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
{ P3_2=0; /*set pin 3 of port 2 to logic 0 */</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
P3_7=0; /*set pin 8 of port 2 to logic 0 */</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
P2=0X00; /*code for the decade counter begins here*/</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
delay_sec(1);</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
P2=0X01;</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
delay_sec(1);</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
P2=0X02;</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
delay_sec(1);</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
P2=0X03;</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
delay_sec(1);</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
P2=0X04;</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
delay_sec(1);</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
P2=0X05;</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
delay_sec(1);</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
P2=0X06;</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
delay_sec(1);</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
P2=0X07;</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
delay_sec(1);</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
P2=0X08;</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
delay_sec(1);</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
P2=0X09;</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
delay_sec(1); /* code for decade counter ends here*/</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
if(P2==0X09)</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
{ P3_2=1; /*LED is switched ON*/</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
P3_7=1; /*buzzer is switched ON*/</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
delay_sec(3); /*buzzer is switched ON for 3 seconds*/</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
P3_2=0; /*LED is switched OFF*/</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
P3_7=0; /*buzzer is switched OFF*/</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
}</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
}</div>
</div>
<div style="border-bottom-color: rgb(165, 42, 42); border-bottom-style: solid; border-left-color: rgb(165, 42, 42); border-left-style: solid; border-right-color: rgb(165, 42, 42); border-right-style: solid; border-top-color: rgb(165, 42, 42); border-top-style: solid; border-width: initial; clear: left; float: left; margin-bottom: -1px; margin-left: 0px; margin-right: -1px; margin-top: 0px; padding-bottom: 1px; padding-left: 1px; padding-right: 1px; padding-top: 1px; width: 288px;">
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
}</div>
</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<h2 class="module_title ">
<i>Try this for Fun</i> </h2>
<div>
Try to program your microcontroller in which the Buzzer is used as a musical device meaning your buzzer will output a musical tune .<br />
<br />
<br />
<br />
<h2 style="text-align: center;">
<a href="http://www.electronicsirfan.blogspot.com/" target="_blank">\\\\related topics\\\</a></h2>
<h2 style="text-align: center;">
<br /></h2>
<ul>
<li><a href="http://electronicsirfan.blogspot.com/2013/12/8051-special-function-registers-and.html" target="_blank">8051 Special Function Registers and Ports</a>, </li>
<li><a href="http://electronicsirfan.blogspot.com/2014/01/ultrasonic-range-finder-using-8051.html" target="_blank">Ultrasonic range finder using 8051</a>,</li>
<li><a href="http://electronicsirfan.blogspot.com/2013/12/8051-programming-tutorial.html" target="_blank">8051 Programming Tutorial</a>, </li>
<li><a href="http://electronicsirfan.blogspot.com/2013/12/8051-microcontroller8051.html" target="_blank">8051 Microcontroller/8051 Microcontroller Architecture,</a> </li>
<li> <a href="http://electronicsirfan.blogspot.com/2013/12/interfacing-of-buzzer-using.html">Interfacing Of a Buzzer Using Microcontroller 89C52/89S52,</a> </li>
<li> <a href="http://electronicsirfan.blogspot.com/2013/12/digital-clock-using-microcontroller_22.html">Digital Clock Using Microcontroller 89C52/89S52</a></li>
<li><div class="post-title entry-title">
<a href="http://electronicsirfan.blogspot.com/2013/12/digital-locking-system-using.html"> Digital Locking System Using Microcontroller 89C52/89S52 </a>
</div>
<div class="postmeta-primary">
<span class="meta_date"><br /></span></div>
</li>
</ul>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
<a href="http://www.electronicsirfan.blogspot.com/" target="_blank">Electronics Lab</a> Created By <a href="https://plus.google.com/101596347605966492090" target="_blank">Muhammad Irfan </a></div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/13526216155838659104noreply@blogger.com0tag:blogger.com,1999:blog-2190029239849113272.post-4971976360780019042013-12-22T09:26:00.003-08:002014-01-07T07:40:45.396-08:00Digital Clock Using Microcontroller 89C52/89S52<div dir="ltr" style="text-align: left;" trbidi="on">
<h3 class="post-title entry-title">
Digital Clock Using Microcontroller 89C52/89S52</h3>
<h3 class="post-title entry-title">
</h3>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDWpyF3eHnKJUOUMiAxP-ny_lJrQJobACa6ckOTvUpo0QZZ83VYrfTj9DniO5eVSXIgef6fNgZ_fpH0drYz4IXq5HnWglOtT4ij17l9BorCQfGMx_pOiXil5t_sO7u9ups1V6Y8r-KpVo/s1600/digital+clock.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDWpyF3eHnKJUOUMiAxP-ny_lJrQJobACa6ckOTvUpo0QZZ83VYrfTj9DniO5eVSXIgef6fNgZ_fpH0drYz4IXq5HnWglOtT4ij17l9BorCQfGMx_pOiXil5t_sO7u9ups1V6Y8r-KpVo/s320/digital+clock.JPG" height="189" width="320" /></a></div>
<br />
<br />
<span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;"></span><br />
<div class="module" id="lensDescription" style="border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 30px; position: static; vertical-align: baseline;">
<div class="module" id="lensDescriptionBody" style="border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: static; vertical-align: baseline;">
<div class="viewing" style="border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">
<div class="clear" style="border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">
<div id="lens_abstract_value" style="border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 14px; line-height: 1.5em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">
Are you a <span class="IL_AD" id="IL_AD6">beginner</span> in micro controller projects?and are you stuck where <span class="IL_AD" id="IL_AD1">to start</span> from?if yes,then this is one of the simplest mini projects that you can <span class="IL_AD" id="IL_AD3">start from</span> . This mini project <span class="IL_AD" id="IL_AD5">will give</span>
you a clear understanding of programming your micro controller. we
sometimes look at our watch and wonder " how does this thing work".
Well, in this <span class="IL_AD" id="IL_AD8">digital clock</span> project, you will gain some insight on how micro controller can be used to <span class="IL_AD" id="IL_AD7">make it work</span> as a Digital Clock.</div>
</div>
</div>
</div>
</div>
<h2 class="module_title " style="border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #555555; font-family: Georgia, 'Times New Roman', serif; font-size: 1.71em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 14px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">
<i>Components required:</i></h2>
<div>
<ul style="text-align: left;">
<li><i><span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-style: normal; line-height: 21px;">1 microcontroller 89C52(89S52 will also do)</span></i></li>
<li><i><span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-style: normal; line-height: 21px;">2 ceramic capacitors-22pF</span></i></li>
<li><i><span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-style: normal; line-height: 21px;">1 switch(button for reset purpose)</span></i></li>
<li><i><span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-style: normal; line-height: 21px;">1 electrolytic capacitor-10uF,25V</span></i></li>
<li><i><span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-style: normal; line-height: 21px;">1 crystal oscillator-11.0592MHz</span></i></li>
<li><i><span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-style: normal; line-height: 21px;">16x2 LCD display</span></i></li>
<li><i><span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-style: normal; line-height: 21px;">1 resistor-10k</span></i></li>
</ul>
<span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif;"><span class="Apple-style-span" style="font-size: 14px; line-height: 21px;"></span></span><br />
<div>
<span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif;"><span class="Apple-style-span" style="font-size: 14px; line-height: 21px;"><span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif;"><span class="Apple-style-span" style="font-size: 14px; line-height: 21px;"><br />
</span></span></span></span></div>
<span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;"></span><br />
<h2 class="module_title " style="border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Georgia, 'Times New Roman', serif; font-size: 1.71em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 14px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">
<span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;">
<i>Circuit diagram</i></span></h2>
<span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBKX4RhmEF8aRVkKfIQGOR8idsy5VDx2m2ScakE5p5E13Dqcf_4Kle4or-8F0W9RUL3rrf0uK9VrKf-1VuzJ0fZl8QowfQQTYMBOJ5s5Gw61F4dpZ-w2nLXMR8VwAEOks7ZcLUmueVaMs/s1600/schematic+diagram.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBKX4RhmEF8aRVkKfIQGOR8idsy5VDx2m2ScakE5p5E13Dqcf_4Kle4or-8F0W9RUL3rrf0uK9VrKf-1VuzJ0fZl8QowfQQTYMBOJ5s5Gw61F4dpZ-w2nLXMR8VwAEOks7ZcLUmueVaMs/s400/schematic+diagram.JPG" height="298" width="400" /></a></div>
<div>
<i><br />
</i></div>
</span><span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;"><h2 class="module_title " style="border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Georgia, 'Times New Roman', serif; font-size: 1.71em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 14px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">
<i>Software you will need</i></h2>
</span><span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;">This project has been done in proteus software.If you are new to proteus software, the <span class="IL_AD" id="IL_AD10">tutorials</span> given below may get you started with the software.</span><span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;">note:if you are familiar with proteus you can skip this part.</span></div>
<div>
<span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif;"><span class="Apple-style-span" style="font-size: 14px; line-height: 21px;"><br />
</span></span></div>
<div>
<span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif;"><span class="Apple-style-span" style="font-size: 14px; line-height: 21px;"><a href="http://allaboutlearningandearning.blogspot.com/2011/07/proteus-tutorial.html">Click here to get started with Proteus tutorial</a></span></span></div>
<div>
<div>
<span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif;"><span class="Apple-style-span" style="font-size: 14px; line-height: 21px;"><br />
</span></span></div>
</div>
<div>
<span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;">The programming of the microcontroller
is done using keil compiler.port 2 of 89C52 is used as the output
port.whereas port 1 is used as the input port.when P1_4 is grounded the
12 hr mode is activated and when P1_5 is grounded the 24 hr mode is
activated.In the schematic diagram P1_5 is grounded so the 24hr mode is
activated.it is as shown below</span></div>
<div>
<span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;"><br />
</span></div>
<div>
<span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;"><br />
</span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbfG3_dXWKAEt4AMwYYKWgc-AXeTUHmC325W8C3nF2sJX6GlNgy8oWqIfgwBkq_280RBGmvTX4aAZsyCYavGGIirDw6ZUMjt1gBsU3DZiHE3szdxx_pzLMoC2yvxRrg0zRP14vM5u-Bo0/s1600/digtal+clock+24hrs.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbfG3_dXWKAEt4AMwYYKWgc-AXeTUHmC325W8C3nF2sJX6GlNgy8oWqIfgwBkq_280RBGmvTX4aAZsyCYavGGIirDw6ZUMjt1gBsU3DZiHE3szdxx_pzLMoC2yvxRrg0zRP14vM5u-Bo0/s400/digtal+clock+24hrs.JPG" height="266" width="400" /></a></div>
<div>
<span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;"></span><br />
<h2 class="module_title nopad" style="border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Georgia, 'Times New Roman', serif; font-size: 1.71em; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px !important; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">
<span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;"><i>Code:</i></span></h2>
<div>
<span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;"><i><br />
</i></span></div>
<span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;"></span><br />
<h3 class="module_subtitle" style="border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Georgia, 'Times New Roman', serif; font-size: 1.29em; font-weight: normal; line-height: 1.2em; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 14px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;">
<span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;">
<i>The detail explanation of the code is done below:</i></span></h3>
<span class="Apple-style-span" style="color: #555555; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;">
<div>
<i><br />
</i></div>
</span></div>
<div style="border-width: 1px; border: solid blue; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
#include "REGX52.H"</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
#include "delay.h"</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
#include "lcd.h"</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
void main(void)</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
{</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
int hr=0; /*initiate hour=0 */</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
int min=0; /*initiate minutes=0 */</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
int sec=0; /*initiate seconds=0 */</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
P1=0xff; /*set port 1 as input port */</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
P2=0x00; /*set port 2 as output port*/</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
while(1)</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
{ LCD_INIT(); /*initialize LCD*/</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
if (P1_4==0)/*if P1_4 is grounded enter the 12hr loop */</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
{</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
for (sec=0;sec<60;sec )</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
{</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
LCD_DisplayNum(hr,2);</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
LCD_STRING(":");</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
LCD_DisplayNum(min,2);</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
LCD_STRING(":");</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
LCD_DisplayNum(sec,2);</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
LCD_STRING(" (12 HR)");</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
delay_sec(1);</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
LCD_CLEAR();</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
if (sec==59)</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
{</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
min=min 1;</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
if(min==60)</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
{</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
if(hr==11&&min==60&&sec==59)</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
{hr=0;min=0;sec=0;}</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
else</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
{ hr=hr 1;</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
min=0;}</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
}</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
}</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
} }</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
else</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
{</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
if(P1_5==0) /*if P1_5 is grounded enter the 24hr loop */</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
{</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
for (sec=0;sec<60;sec )</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
{</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
LCD_DisplayNum(hr,2);</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
LCD_STRING(":");</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
LCD_DisplayNum(min,2);</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
LCD_STRING(":");</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
LCD_DisplayNum(sec,2);</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
LCD_STRING(" (24 HR)");</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
delay_sec(1);</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
LCD_CLEAR();</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
if (sec==59)</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
{</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
min=min 1;</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
if(min==60)</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
{</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
if(hr==23&&min==60&&sec==59)</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
{hr=0;min=0;sec=0;}</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
else</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
{ hr=hr 1;</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
min=0;}</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
}</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
}</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
} }}</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
LCD_INIT();</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
}</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
}</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
</div>
<div style="border-width: 1px; border: solid blue; clear: left; float: left; margin: 0 -1px -1px 0; padding: 1px; width: 288px;">
<br />
<h2 style="text-align: center;">
<a href="http://www.electronicsirfan.blogspot.com/" target="_blank">\\\\related topics\\\</a></h2>
<h2 style="text-align: center;">
<br /></h2>
<ul>
<li><a href="http://electronicsirfan.blogspot.com/2013/12/8051-special-function-registers-and.html" target="_blank">8051 Special Function Registers and Ports</a>, </li>
<li><a href="http://electronicsirfan.blogspot.com/2014/01/ultrasonic-range-finder-using-8051.html" target="_blank">Ultrasonic range finder using 8051</a>,</li>
<li><a href="http://electronicsirfan.blogspot.com/2013/12/8051-programming-tutorial.html" target="_blank">8051 Programming Tutorial</a>, </li>
<li><a href="http://electronicsirfan.blogspot.com/2013/12/8051-microcontroller8051.html" target="_blank">8051 Microcontroller/8051 Microcontroller Architecture,</a> </li>
<li> <a href="http://electronicsirfan.blogspot.com/2013/12/interfacing-of-buzzer-using.html">Interfacing Of a Buzzer Using Microcontroller 89C52/89S52,</a> </li>
<li> <a href="http://electronicsirfan.blogspot.com/2013/12/digital-clock-using-microcontroller_22.html">Digital Clock Using Microcontroller 89C52/89S52</a></li>
<li><div class="post-title entry-title">
<a href="http://electronicsirfan.blogspot.com/2013/12/digital-locking-system-using.html"> Digital Locking System Using Microcontroller 89C52/89S52 </a>
</div>
<div class="postmeta-primary">
<span class="meta_date"><br /></span></div>
</li>
</ul>
</div>
<h3 class="post-title entry-title">
</h3>
<h3 class="post-title entry-title">
</h3>
<h3 class="post-title entry-title">
</h3>
<h3 class="post-title entry-title">
</h3>
<h3 class="post-title entry-title">
</h3>
<h3 class="post-title entry-title">
</h3>
<h3 class="post-title entry-title">
</h3>
<h3 class="post-title entry-title">
</h3>
<h3 class="post-title entry-title">
</h3>
<h3 class="post-title entry-title">
</h3>
<h3 class="post-title entry-title">
</h3>
<h3 class="post-title entry-title">
</h3>
<h3 class="post-title entry-title">
</h3>
</div>
Anonymoushttp://www.blogger.com/profile/13526216155838659104noreply@blogger.com0