-->

Timer

By

Timer 

What is a Timer ? 

A Timer is device it sense the time interval and produce an output at a set value . example alarm Timer setting.(Timer in Wikipedia )


,What is the need of a timer in Micro controller ?
1) Some time  micro controller Code need some accurate  Delay  ( Example blinking An LED in each      accurate 1 sec. Look LED Blinking example

2)Some Time the code needs the code Repeat

3) Most of the Interfacing devices with micro-controller needs a clock (accurate interval of clocks)
   Example:   LCD module require Clock  Signal Look LCD Interfacing
               

Timer in 8051

Also a Timer actually require a clock pulse  (pling) .These pulse are given from controller  (actually it is in software based not giving ) see below picture
8051 type controller has  two Timer Timer 0 and Timer 1 (These two timer is the length of 16 bit ,0000 to  FFFF ).These Timer is named as TR0 and TR1. 



The Timer Setting/configuring  can controlling by the TMOD register 



These TMOD register Values is used to decide how the Timer Works .
Sample program




download the fullcode and Test

Timer

By

Timer 

What is a Timer ? 

A Timer is device it sense the time interval and produce an output at a set value . example alarm Timer setting.(Timer in Wikipedia )


,What is the need of a timer in Micro controller ?
1) Some time  micro controller Code need some accurate  Delay  ( Example blinking An LED in each      accurate 1 sec. Look LED Blinking example

2)Some Time the code needs the code Repeat

3) Most of the Interfacing devices with micro-controller needs a clock (accurate interval of clocks)
   Example:   LCD module require Clock  Signal Look LCD Interfacing
               

Timer in 8051

Also a Timer actually require a clock pulse  (pling) .These pulse are given from controller  (actually it is in software based not giving ) see below picture
8051 type controller has  two Timer Timer 0 and Timer 1 (These two timer is the length of 16 bit ,0000 to  FFFF ).These Timer is named as TR0 and TR1. 



The Timer Setting/configuring  can controlling by the TMOD register 



These TMOD register Values is used to decide how the Timer Works .
Sample program




download the fullcode and Test

Rotation Counter using 8051

By

Rotation Counter using 8051


 I need to make a counter for a transformer winding machine .In that the winding is made by hand . so the roation  need to be keep in mind ,that is too much difficult .So the winding shaft rotaion counting by an infrared sensor module which is connected with 89S52 microcontroler and a LCD .

Infrared based Rotation Counter by 805 or  (contact less Rotation Counter  or Rotation counter without using Interrupt.



 

Code : 


INFRARED Module 


Download the Full Project  CODE and with Proteus  Here

Rotation Counter using 8051

By

Rotation Counter using 8051


 I need to make a counter for a transformer winding machine .In that the winding is made by hand . so the roation  need to be keep in mind ,that is too much difficult .So the winding shaft rotaion counting by an infrared sensor module which is connected with 89S52 microcontroler and a LCD .

Infrared based Rotation Counter by 805 or  (contact less Rotation Counter  or Rotation counter without using Interrupt.



 

Code : 


INFRARED Module 


Download the Full Project  CODE and with Proteus  Here

Switch Bounce Tutorials

By

Switch Bounce


Microcontrolers may not in Human thinking frequency .Human thinking frequency is lies in some of low Hz .  Microcontroler works variety range of frequency ie ,12Mhz,20 Mhz etc .  In a push Button  micro controller interfacing, Human and Micro controller are feels that whether the push is pressed or not  in different way as follows in the graph .




Some small duration pulse due to denounce generated as multiple touch error
Hardware solution
It can be made by a resistor and a capacitor in the following manner or any other for comfortable




When ever the switch is pressed the capacitor will charge  rapidly ,practically the first charge wil be across  the  ,capacitor ,


So we can avoid the denouncing effect .

The capacitor and the resistor will be select in accordance with time constant . as follows





For more information go here



Will be update 


Switch Bounce Tutorials

By

Switch Bounce


Microcontrolers may not in Human thinking frequency .Human thinking frequency is lies in some of low Hz .  Microcontroler works variety range of frequency ie ,12Mhz,20 Mhz etc .  In a push Button  micro controller interfacing, Human and Micro controller are feels that whether the push is pressed or not  in different way as follows in the graph .




Some small duration pulse due to denounce generated as multiple touch error
Hardware solution
It can be made by a resistor and a capacitor in the following manner or any other for comfortable




When ever the switch is pressed the capacitor will charge  rapidly ,practically the first charge wil be across  the  ,capacitor ,


So we can avoid the denouncing effect .

The capacitor and the resistor will be select in accordance with time constant . as follows





For more information go here



Will be update 


WORKING OF 74HC138 IC

By
Working of  74HC138 IC



               74HC138 is a decoder of the type octal 3- to- 8 Line Decoder / Demulator and Inverter.
The chip enables 3 pins - A, B and C - to output 8-bit , meaning that decodes three address lines in 8 possible ways . Simple, with 3 input bits to form 8 Address : 2 3 = 8; See the truth table:



         
An address decoder is also called a " demultiplexer " or " demux " . Although these terms are more generic and can refer to devices other than decoders addresses, TTL 74138 mentioned here can be called " demux 3- to -8" .
Decoders addresses are fundamental building blocks for systems using bus bars. They are represented in all families of integrated circuits and all the standard libraries FPGA and ASIC . They are discussed in introductory texts in digital logic design




WORKING OF 74HC138 IC

By
Working of  74HC138 IC



               74HC138 is a decoder of the type octal 3- to- 8 Line Decoder / Demulator and Inverter.
The chip enables 3 pins - A, B and C - to output 8-bit , meaning that decodes three address lines in 8 possible ways . Simple, with 3 input bits to form 8 Address : 2 3 = 8; See the truth table:



         
An address decoder is also called a " demultiplexer " or " demux " . Although these terms are more generic and can refer to devices other than decoders addresses, TTL 74138 mentioned here can be called " demux 3- to -8" .
Decoders addresses are fundamental building blocks for systems using bus bars. They are represented in all families of integrated circuits and all the standard libraries FPGA and ASIC . They are discussed in introductory texts in digital logic design




Making multiple input by 3 wire Interfacing .

By
Parallel to serial  Interfacing with Micro controller 

Interfacing with 74HC165 with 8051


   I am trying to make multiple input with using minimum input port of micro controller ,ie 3 wire .
By using a 3 wire we can interface more input as we wish.


 I am making a tutorial for it , Basics of 74HC165  which is a parallel to serial shift register .


   












Only three pin is connected with this IC . 
1)   SH/LD  or PL  is used load  parallel data to the IC .A low pulse (ground) is applied for store the         parallel data at the pin from A to H . And a High (5 Volt) is applied to stop the reading from the          PIN A to H .
2) Then to read the loaded or saved data to Micro controller we have to give clock to the PIN 2 of           74HC165  (CLK) . 8 pulses is applied to read 8 bit (Pin A to B)

3) QH / SO . serial out pin is used to get the stored parallel data to serially.

The CLK INH pin must be connect in ground for enable clock.


    To use cascaded 74HC165 for increasing i/p .connect the Seriall output pin (PIN 9) of first satge into serial input of first stage see the following circuit.
   




see the code below





  
  #include  
#include
#include "lcd.h"
sbit PL = P1^0; // Loading parallel data to HC165.
sbit CLK = P1^1; // Clock pulse to HC165.
sbit Beep = P1^2; //
sbit data_in = P1^3;

void clock(void);
void display(unsigned char value);

void main()
{
unsigned char position ,no_of_ip = 17;
lcd_init();
string(" gElectron");
while(1)

{
PL = 0 ;
delay(2);
PL = 1;

for(position = 1; no_of_ip > position; position++ , clock())
{

if(data_in == 1)
display(position);

}
}
}

void clock(void)
{
CLK = 1;
delay(1);
CLK = 0;

}

void display(unsigned int value)
{
unsigned int a[1];
Beep = 1;
lcd_init();
lcd_cmd(0x01);
string("Pressed key ");
lcd_cmd(0xc0);
sprintf(a,"%d",value);
string(a);
delay(1);
Beep = 0;

}

Download the whle file here github.


Making multiple input by 3 wire Interfacing .

By
Parallel to serial  Interfacing with Micro controller 

Interfacing with 74HC165 with 8051


   I am trying to make multiple input with using minimum input port of micro controller ,ie 3 wire .
By using a 3 wire we can interface more input as we wish.


 I am making a tutorial for it , Basics of 74HC165  which is a parallel to serial shift register .


   












Only three pin is connected with this IC . 
1)   SH/LD  or PL  is used load  parallel data to the IC .A low pulse (ground) is applied for store the         parallel data at the pin from A to H . And a High (5 Volt) is applied to stop the reading from the          PIN A to H .
2) Then to read the loaded or saved data to Micro controller we have to give clock to the PIN 2 of           74HC165  (CLK) . 8 pulses is applied to read 8 bit (Pin A to B)

3) QH / SO . serial out pin is used to get the stored parallel data to serially.

The CLK INH pin must be connect in ground for enable clock.


    To use cascaded 74HC165 for increasing i/p .connect the Seriall output pin (PIN 9) of first satge into serial input of first stage see the following circuit.
   




see the code below





  
  #include  
#include
#include "lcd.h"  
sbit PL  = P1^0;   // Loading parallel data to HC165.
sbit CLK = P1^1;   // Clock pulse to HC165.
sbit Beep  = P1^2;   // 
sbit data_in  = P1^3;

  void clock(void);
  void display(unsigned char value);
     
void main()
{  
 unsigned char position ,no_of_ip = 17;
  lcd_init();
  string("   gElectron");     
  while(1)

   {  
      PL = 0 ;
  delay(2);
  PL = 1;

   for(position = 1; no_of_ip > position; position++ , clock())
  {     
  
    if(data_in == 1)
     display(position);   

  }
   } 
}  

 void clock(void)
 {
   CLK = 1;
   delay(1);
   CLK = 0;

 }

void display(unsigned int value)
  {  
  unsigned int a[1];
    Beep =   1;
    lcd_init();
 lcd_cmd(0x01);   
    string("Pressed key ");
    lcd_cmd(0xc0); 
  sprintf(a,"%d",value);  
     string(a); 
     delay(1);
     Beep = 0;
     
  }   


Download the whle file here github.


Google Photo Backup

By
                       


        Google lunched a New application called Google photos   where we can add our lime time photos with each album with geo tagging location . google app automatically upload the photos and with our location . So we can see the photos including the location where was the photo taken .
The great advantage is that who is suffering with low memory mobile ,but they need to upload their photos accordingly , use the Google photo application sync with it. After syncing the photos we can delete the photos from the mobile .It delete only from the mobile and available on the net ever .


* It can easily share on social network
* It can be see Monthly view ,day view and more


 A geotaging location shown in the album cover . The photos automatically created while travelling.and tagged with the location






     

Google Photo Backup

By
                       


        Google lunched a New application called Google photos   where we can add our lime time photos with each album with geo tagging location . google app automatically upload the photos and with our location . So we can see the photos including the location where was the photo taken .
The great advantage is that who is suffering with low memory mobile ,but they need to upload their photos accordingly , use the Google photo application sync with it. After syncing the photos we can delete the photos from the mobile .It delete only from the mobile and available on the net ever .


* It can easily share on social network
* It can be see Monthly view ,day view and more


 A geotaging location shown in the album cover . The photos automatically created while travelling.and tagged with the location






     

Microcontroller Based ammeter and voltmeter using Atmega 16

By
Here  Atmega16  measuring the  current and voltage by inbuilt comparator  .Previous post described how to read ADC value click here . Two  ADC port is used  PA0/ADC0  is  measuring voltage .And PA1/ADC1 is  measuring current .

For Advancedtutorials click here Voltmeter Design

                We have to measure 0 to 12 volt, but controller can only read as maximum voltage 5 volt .
Hence a voltage divider circuit used to reduce the corresponding voltage level  at a mximum 5Volt.










take
Vin  = 12volt
Vout = 5 volt.
Assume one of the resistor value and find out the other .
***********************************************************************************
  we have to measure current ,But we cant directly measure the current . there are more technique to measure the current. we uses a shunt resistor method .
The millivoltmeter voltage is taken and calculated by some equation and displayed as current .for more click here

For example .
According Ohm's law,  0.1 Ohm resistor under 1A current will give 0.1V voltage drop
*********************************************************************************




                                             The program shown below
* Created: 14-Oct-15 6:44:15 PM
* Author: Gireesh
*/
#define F_CPU 16000000UL
#include <avr/io.h>
#include<util/delay.h>
#include"lcd.h"
#include "adc.h"

int main(void)

{

unsigned char volt[5] ,current[5];
DDRD = 0xFF;
int v,i;
char ch_sec =0;
adc_init();
lcd_init();
string ("G Electron ");
LINE2
string("Power Supply");
_delay_ms(50);
CLEAR
while(1)

{
v = read_adc(0); // reading voltage
i = read_adc(1); // reading voltage for current
v = (v * 4.89 * 2.4)/10;
i = (i * 2.92);
i = ((i*4.89)/0.47)/10;



if(v< 1200)
{
volt[0] = ((v /1000)%10)+0x30;
volt[1] = ((v /100) % 10) + 0x30;
volt[2] = '.';
volt[3] = ((v/ 10) %10) + 0x30;
volt[4] = (v % 10) + 0x30 ;


string("Volt : ");
for(int i =0; i<5;i++)
lcd_data(volt[i]); // just displaying ADC value
string("V");
}
else
{

string("Over Voltage");
}
LINE2
if(i<3100)
{
current[0] =((i /1000)%10)+0x30;
current[1] = '.';
current[2] = ((i /100) % 10) + 0x30;
current[3] = ((i/ 10) %10) + 0x30;
string("Current : ");
for(int i =0; i<4;i++)
lcd_data(current[i]);
string("A");
}
else
{

string("Over Current");
}
_delay_ms(50);
CLEAR
}
}
design circuits to feed controller for current and Volt. the whole project can be download Below including proteus file For downloading click below
      
                                                 Download

More Posts

gElectron. Powered by Blogger.

Contributors

16x2 LCD Interfacing with STM32,STM32F103C6

 16x2 LCD  Interfacing with STM32,STM32F103C6 lcd_init(); LCD_LINE1; lcd_String(" GeElectron"); LCD_LINE2; lc...

Contact Form

Name

Email *

Message *

Contact us

Name

Email *

Message *

Follow Us

https://www.facebook.com/gElectron-393939667321867/ FBbox/https://www.facebook.com/IVYthemes

Comments

[blogger]

MKRdezign

Test

Latest

[recent][newsticker]

Technology

Top Ads

RECENT COMMENTS

Subscribe Via Email

Subscribe to our newsletter to get the latest updates to your inbox. ;-)


Your email address is safe with us!

RECENT COMMENTS