Searching \ for 'Timing Pulses' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=timing+pulses
Search entire site for: 'Timing Pulses'.

Truncated match.
PICList Thread
'Timing Pulses'
1996\11\05@114711 by Mr M R Bowman

flavicon
picon face
Hi, i need some help, i am trying to time a PWM signal whose
length varies from 0.2-2mili seconds, i am using a loop at
the moment that increments a counter until the pulse drops
back to 0.  The problem is that it does not seem to work
very well.  I need to get about 8 bits resolution.

I will email the code if that helps.

Thanks in advance.

PS I am using a PIC16C84 running with a 4MHz crystal.
--

+-------------------------------------------------------------------+
|       Martin Bowman - University of Warwick, Coventry, UK         |
|                     - 3rd Year Electronic Engineering             |
|                     - E Mail (spam_OUTesukqTakeThisOuTspamwarwick.ac.uk)                |
|                     - Packet  .....G7VHEKILLspamspam@spam@GB7COV.GBR.EU                 |
+------------------ IF IT AINT BROKE - DONT FIX IT -----------------+

1996\11\05@180902 by Craig Knotts

flavicon
face
; Let me give it a shot
; 2000 usec - 200 usec = 1800 usec
; 1800 usec/256 = 7 used

       bsf     Aport,0                 ;start the PWM output
       movlw   65                      ;set up delay for minimum width
       movwf   Loop_Counter
Loop1
       decfsz  Loop_Counter
       goto    Loop1
Loop2
       movf    Pulse_Width,w           ;Get the desired pulse width
       subwf   Loop_Counter            ;Compare to the current loop count
       skpnc                           ;if current count is >= desired count
       bcf     Aport,0                 ;then terminate the pulse
       incfsz  Loop_Counter            ;count up the loop until it rolls over
       goto    Loop                    ;back around to beginning of loop

______________________________ Reply Separator _________________________________
Subject: Timing Pulses
Author:  esukqspamKILLspamCSV.WARWICK.AC.UK at internet
Date:    11/5/96 3:00 PM


Hi, i need some help, i am trying to time a PWM signal whose
length varies from 0.2-2mili seconds, i am using a loop at
the moment that increments a counter until the pulse drops
back to 0.  The problem is that it does not seem to work
very well.  I need to get about 8 bits resolution.

I will email the code if that helps.

Thanks in advance.

PS I am using a PIC16C84 running with a 4MHz crystal.
--

+-------------------------------------------------------------------+
|       Martin Bowman - University of Warwick, Coventry, UK         |
|                     - 3rd Year Electronic Engineering             |
|                     - E Mail (.....esukqKILLspamspam.....warwick.ac.uk)                |
|                     - Packet  EraseMEG7VHEspam_OUTspamTakeThisOuTGB7COV.GBR.EU                 |
+------------------ IF IT AINT BROKE - DONT FIX IT -----------------+

1996\11\06@041927 by efoc

flavicon
face
Mr M R Bowman wrote:
>
> Hi, i need some help, i am trying to time a PWM signal whose
> length varies from 0.2-2mili seconds, i am using a loop at
> the moment that increments a counter until the pulse drops
> back to 0.  The problem is that it does not seem to work
> very well.  I need to get about 8 bits resolution.
>
> I will email the code if that helps.
>
> Thanks in advance.
>
> PS I am using a PIC16C84 running with a 4MHz crystal.

Hi, I have been working on a system that counts pulses and pulse width
using the 84 .I use both the T0 clock and INT on portB0 to generate
ints.
If you set the ints up so that an int is generated on the rising edge of
portb0 and increment a counter every time an int is generated you can
count pulses. now if you also set the clock to generate an int at a set
duty cycle you can count the number of pulses on the portb0 pin within a
set time. all of this can be done in the background and due to the
nature of the ints it is also VERY presise.

I hope this is of some use

Peter........

1996\11\06@151718 by Mr M R Bowman

flavicon
picon face
Hello again, thanks for all your help with the timing pulses
thing, i have that sorted out.  Cheers.


--

+-------------------------------------------------------------------+
|       Martin Bowman - University of Warwick, Coventry, UK         |
|                     - 3rd Year Electronic Engineering             |
|                     - E Mail (esukqspamspam_OUTwarwick.ac.uk)                |
|                     - Packet  @spam@G7VHEKILLspamspamGB7COV.GBR.EU                 |
+------------------ IF IT AINT BROKE - DONT FIX IT -----------------+

More... (looser matching)
- Last day of these posts
- In 1996 , 1997 only
- Today
- New search...