Sign in

username:

password:



Not a member?

Search piclist



Search tips

Subscribe to piclist



piclist by Keywords

12F675 | 16F628 | 16F84 | 16f877 | 16F877A | 16F88 | 18F458 | ADC | AVR | Bootloader | CAN | CCS | CRC | EAGLE | EEPROM | ICD | ICSP | IDE | JDM | LED | Macros | Microchip | MPLAB | PCB-CAD | PIC10F | Pic12f675 | PIC16F84 | PIC16F84A | PIC16F877 | PIC18 | PIC18F452 | PicBasic | PICC | PICSTART | PWM | RS-485 | RS232 | SMT | SPI | UART | USART | USB | Wireless | Wisp628 | Xilinx

Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | Piclist | PULSE WIDTH MEASUREMENT USING PIC16F690


Advertise Here

A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.

PULSE WIDTH MEASUREMENT USING PIC16F690 - andy_angad - Jun 24 5:10:04 2009

Hey i wanted to measure the width of a square wave pulse..
Neone have a sample code please let me know.

Thank You

------------------------------------

to unsubscribe, go to http://www.yahoogroups.com and follow the instructions

______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )


Re: PULSE WIDTH MEASUREMENT USING PIC16F690 - Dennis Clark - Jun 24 10:10:54 2009


> Hey i wanted to measure the width of a square wave pulse..
> Neone have a sample code please let me know.

Dude, this isn't twitter, you can use all of the letters here...
Anyway, I can think of four ways off the top of my head, you didn't
mention what you wanted specifically, so no one can hone in on your task.
For instance, do you want the period, high time or low time?

1) Sit in a tight loop, look for a transition and consult a timer.
2) Set an interrupt that triggers on an edge and consult a timer.
3) Use an ICP (input capture) pin which controls its own timer.
4) Use an interrupt that is triggered at a fixed interval and look at an
I/O line and count hits (your timer triggers the ISR here.)

IMO the best is #3, next best is #2. #2 is especially useful if you
have several lines and you can hook them to Pin Change interrupts. If
you don't have easy access to Pin Change interrupts and need to time
more than one or two signals than #4 works well, but the resolution is
pretty much dictated by how fast you can afford to run the interrupt.
I've used #4 with 10us tic's to time multiple R/C receiver channels in a
remote control. This works really well

As a reference, I don't use #1, I use #2 to handle IR decoding, #3 to
time a SONAR pulse and #4 to look at R/C control signals.

have fun,
DLC

> Thank You
--
Dennis Clark
TTT Enterprises

------------------------------------

to unsubscribe, go to http://www.yahoogroups.com and follow the instructions



(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )