Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to capture PWM signal

Status
Not open for further replies.

shma103

Junior Member level 1
Joined
Feb 22, 2005
Messages
16
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,509
capture pwm

Hi,

Anybody knows how to write a code for PIC microcontroller that can read/capture pwm signal and give output according to the pwm ?

The pwm signal is coming from a sensor. I want to program the PIC microcontroller to read this pwm signal and will give the output to other circuitry based on the pwm signal.

any ideas or links that can help me ?

thanks.
 

capture pwm signal

Hi

In order to do that you must use a timer\counter module in the microcontroller

measure the Ton and the Toff

Set a timer to inc every 5 Usec and trigger it from the signal raise edge and shut it down when the signal fall - look at the register of the counter and you have your time priod measurement.

If you can switch to MSP430 Ti supply a code in assembly & C language

All the best


Bobi
 

capture pwm pic

Yes You can use microcntroller in capturing PWM signals trough a sensors.
You can just use a built in timer or a pre program code and compare it to a signal occuring in the input

or to suggest you better use a PSoC Cypress Basic Stamp USB dongle.
"
amplifiers, ADCs, DACs, filters and comparators and digital functions such as timers, counters, PWMs, SPI and UARTs. "

so what are you waiting for..PSoC CY8C27xxx device

https://www.cypress.com

Thanks

Cyrix-Cracker
 

pic capture pwm

You can better measure a PWM signal with capture/compare feature of a Timer.

For this

1. The signal is to be connected to a pin (associated with a timer) which can generate a capture interrupt.
2. Enable capture on both edges (raising, falling)
3. With this you can easily measure OnTime and OffTimeof PWM.

You can find so many appnoted in the net
 


    shma103

    Points: 2
    Helpful Answer Positive Rating
pwm capture msp430

Thanks all for the advice.

at this moment I'm looking at PIC microcontroller solutions since the projects involve several other modules that use this microcontroller. I'll try the other options after the PIC.

Thanks VVV for the link.

shma
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top