Thread: Detection of Pulse duration

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    83

    Detection of Pulse duration

    Dear All,
    I want to implement one small project in my college task involves using 8051 microcontroller...using C programming
    Program to count the following the pulses with respect to following conditions:-
    1. If i loose pulses equal to 200ms then I have to display message “No Calculation”

    2. If I loose pulses equal to 400ms then I have to display message “zero”

    3. If I loose pulses 1sec then I have to display message “ Signal is Invalid”

    4. In all other cases I have to return X ( Number of Pulses) + Y( Any value assumed)

    I am not asking complete code..just give me some clues i will try to design the code..i am thankfull to you

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    So what are you currently planning? Do you have any ideas?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Apr 2008
    Posts
    83

    Hello Macs

    My Idea is:- I will fed from external (Signal Gen) fixed duration of 2min=2000ms..i will use timer to increment each mille second(pulse duration is 1ms)…
    Code:
    1.	Start count the pulses store in ‘X’
    2.	if(X>=2000ms) 
    {
       Buff=X;
    }
    else
    {
      measure once again till reaching 2000ms;
    }
    3.	Take 2000-X 
    if(2000-X==200ms)
    {
       printf(“No calculation”);
    }
    else if( 2000-X==400ms)
    {
      printf(“Zero”);
    }
     
    else if(2000-X==1000ms)
    {
       Printf(“Signal is Invalid”);
    }
    else
    {
      return X+Y;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. I need to play a pre recorded vox file using C
    By m.sudhakar in forum C Programming
    Replies: 4
    Last Post: 11-17-2006, 06:59 PM
  2. Collision Detection
    By Grantyt3 in forum C++ Programming
    Replies: 3
    Last Post: 09-30-2005, 03:21 PM
  3. The Timing is incorret
    By Drew in forum C++ Programming
    Replies: 5
    Last Post: 08-28-2003, 04:57 PM
  4. Automatic vs. Static Duration
    By JMB in forum C++ Programming
    Replies: 7
    Last Post: 10-14-2002, 07:16 PM
  5. bounding box collision detection
    By DavidP in forum Game Programming
    Replies: 7
    Last Post: 07-07-2002, 11:43 PM