pulse simulation


Results 1 to 13 of 13

Threaded View

  1. #1
    Join Date
    May 2006
    Posts
    27

    Default pulse simulation

    hello
    i want simulate a cycle rpm sensor for automotive.
    http://www.geea.org/IMG/swf/capteur_vitesse_6.swf

    the frequency must be able.
    i ve test this code (!!! it s not the same cycle of the picture)
    ' _!-!_!-!__!--!_!-!_!-!

    ' pic16F877

    ' Variable
    W0 var word
    W1 var word
    i var byte
    up var PORTB.4
    dn var PORTB.5
    w0=0
    i=0
    'DN Define frequency down button
    'UP Define frequency up button
    PO con 3 ' Define pulse output pin

    low PO ' Initialize output polarity
    inc:
    If (up = 1) Or (W0 = 10000) Then decr ' Increment freq on button
    W0 = W0 + 10

    decr:
    If (dn = 1) Or (W0 = 0)Then pulse ' Decrement freq on button
    W0 = W0 - 10

    pulse:
    for i =1 to 38
    Pulsout 3,W0 ' Generate pulse
    Pause W0/100 ' Intra-pulse delay
    next i
    Pulsout 3,W0
    W1=W0*2
    Pause W1/100
    Pulsout 3,W1

    Goto inc ' Forever

    this code is ok but not optimized with button
    how do? use pulsout or pwm?

    thank
    Attached Images Attached Images   

Similar Threads

  1. 2 Beam Optical Pulse Generator
    By WOZZY-2010 in forum Schematics
    Replies: 8
    Last Post: - 6th April 2010, 04:03
  2. Pulse Capture and byte building
    By boroko in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 21st July 2009, 01:59
  3. Single digit 7 Seg LED clock - PIC16F88
    By thirsty in forum Code Examples
    Replies: 4
    Last Post: - 17th July 2009, 08:42
  4. Replies: 3
    Last Post: - 13th September 2008, 17:40
  5. Pulse Frequency Multiplication
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 21st August 2005, 10:39

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts