Register Login

Login with your site account

Lost your password?

Not a member yet? Register now

WebclassesWebclasses
  • Home
  • Courses
    • Start Learning Here

      • Learn HTML
      • Learn CSS
      • Learn PHP
      • Learn JS
      • Learn SQL
      • Learn C
      • Learn C++
      • Learn 8051

      New Course

      8051 Micro-controller

      8051 Micro-controller

      Free
      Read More
  • Blog
  • Contact Us
    • Home
    • Courses
      • Start Learning Here

        • Learn HTML
        • Learn CSS
        • Learn PHP
        • Learn JS
        • Learn SQL
        • Learn C
        • Learn C++
        • Learn 8051

        New Course

        8051 Micro-controller

        8051 Micro-controller

        Free
        Read More
    • Blog
    • Contact Us
    • Home
    • All courses
    • 8051 Micro-controller

    8051 Micro-controller

    mahethekiller
    (0 review)
    Free
    8051 Micro-controller

    8051 COUNTER

    Counter is very useful in embedded system because we always need something for counting events happening outside.

    let’s take a example if we want to make a visitor counter for counting visitor in museum then we need a device that count person at entry gate. To make this type of device we need counter in embedded device.

    • Now timers can also be used as counters counting events happening outside the 8051.
    • When timer is used as a counter, it is a pulse outside of the 8051 that increments the TH, TL registers.
    • TMOD and TH, TL registers are the same as for the timer discussed in timer section.
    • Programming the timer in the timer section also applies to programming it as a counter except the source of the frequency.
    C/T Bit in TMOD Register :
    • The C/T bit in the TMOD registers decides the source of the clock for the timer.
    • When C/T = 1, the timer is used as a counter and gets its pulses from outside the 8051.
    • The counter counts up as pulses are fed from pins 14 and 15, these pins are called T0 (timer 0 input) and T1 (timer 1 input).
    port 3 pins used for Timers 0 and 1
    port 3 pins used for Timers 0 and 1

     

    Pin Port Pin Function Description Function
    14 P3.4 T0 Timer/counter 0 external input
    15 P3.5 T1 Timer/counter 1 external input
    Example:

    Assume that a 1-Hz external clock is being fed into pin T1 (P3.5). Write a C program for counter 1 in mode 2 (8-bit auto reload) to count up and display the state of the TL1 count on P1. Start the count at 0H.

    Solution:
    #include <reg51.h>
    
    sbit T1=P3^5;
    
    void main(void){
    	
    	T1=1;
    	
    	TMOD=0x60;
    	
    	TH1=0;
    	
    	while (1) {
    		
    		do {
    			
    			TR1=1;
    			
    			P1=TL1;
    			
    		}
    		
    		while (TF1==0);
    		
    		TR1=0;
    		
    		TF1=0;
    		
    	}
    	
    }
     Example:

    Assume that a 1-Hz external clock is being fed into pin T0 (P3.4). Write a C program for counter 0 in mode 1 (16-bit) to count the pulses and display the state of the TH0 and TL0 registers on P2 and P1,respectively.

    Solution:
    #include <reg51.h>
    
    void main(void){
    	
    	T0=1;
    	
    	TMOD=0x05;
    	
    	TL0=0
    	
    	TH0=0;
    	
    	while (1) {
    		
    		do {
    			
    			TR0=1;
    			
    			P1=TL0;
    			
    			P2=TH0;
    			
    		}
    		
    		while (TF0==0);
    		
    		TR0=0;
    		
    		TF0=0;
    		
    	}
    	
    }

     

    Prev 8051 Mode 2 Programming
    • Description
    • Curriculum
    • Instructors
    • Reviews (0)

    The Intel 8051 microcontroller is among one of the most popular general purpose microcontrollers in use today. The success of the Intel 8051 spawned a number of clones which are collectively referred to as the MCS-51 family of microcontrollers, which includes chips from vendors such as Atmel, Philips, Infineon, and Texas Instruments.

    Historical Background
    • 1947 Invention of Transistors.
    • 1959 Invention of Integrated Circuits.
    • 1971 Invention of Microprocessor.
    • 1976 Invention of Microcontroller.

    Today, over 50 companies produce variations of the 8051. 8051 cores are available for implementations in Field Programmable Gate Arrays (FPGA) or Application Specific Integrated Circuits (ASIC). The 8051 was developed by Intel but other manufacturers (e.g., Siemens, Philips, Atmel, etc.) are second sources of this family of devices.

    Course Features

    • Lectures 16
    • Quizzes 0
    • Duration 10 hours
    • Skill level All levels
    • Language English
    • Students 51
    • Certificate No
    • Assessments Self
    • Share:
      • Lecture1.1
        8051 Overview
        0m
      • Lecture1.2
        8051 Internal Organization of Computers
        0m
      • Lecture1.3
        8051 Microcontrollers and embedded processors with 8051 family
        0m
      • Lecture1.4
        8051 Compiler
        0m
      • Lecture1.5
        8051 FLAG BITS AND PSW REGISTER
        0m
      • Lecture1.6
        8051 Register Banks And Stacks
        0m
      • Lecture1.7
        8051 I/O Port , Reset , Oscillator
        0m
      • Lecture1.8
        8051 WHY PROGRAM 8051 IN C
        0m
      • Lecture1.9
        8051 DATA TYPES
        0m
      • Lecture1.10
        8051 TIME DELAY
        0m
      • Lecture1.11
        8051 Logical and Bit-wise operators
        0m
      • Lecture1.12
        8051 TIMER PROGRAMMING
        0m
      • Lecture1.13
        8051 TMOD Register
        0m
      • Lecture1.14
        8051 Mode 1 Programming
        0m
      • Lecture1.15
        8051 Mode 2 Programming
        0m
      • Lecture1.16
        8051 COUNTER
        0m
    mahethekiller

    Reviews

    Average Rating

    0
    0 rating

    Detailed Rating

    5 stars
    0
    4 stars
    0
    3 stars
    0
    2 stars
    0
    1 star
    0

    You May Like

    C ++ Programming Read More
    mahethekiller

    C ++ Programming

    20
    0
    Free
    C Programming Read More
    mahethekiller

    C Programming

    0
    0
    Free
    SQL Programming Read More
    mahethekiller

    SQL Programming

    0
    0
    Free

    Leave A Reply Cancel reply

    Your email address will not be published. Required fields are marked *

    Latest Courses

    8051 Micro-controller

    8051 Micro-controller

    Free
    Javascript Programming

    Javascript Programming

    Free
    C ++ Programming

    C ++ Programming

    Free

    Recent Posts

    • How to Create a Basic CRUD application Using PHP and MySql
    • Login And Logout Script using PHP Sessions
    • How to Upload an image using Ajax and PHP

    Courses

    • HTML
    • CSS
    • Javascript
    • PHP

    Advanced

    • SQL
    • C Programming
    • C++ Programming
    • 8051 Microcontroller

    Links

    • Home
    • Blog
    • Courses

    Webclasses