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.

[PIC] How to read pwm signal output

Status
Not open for further replies.

cnandha19

Member level 3
Joined
Aug 28, 2015
Messages
59
Helped
1
Reputation
2
Reaction score
1
Trophy points
8
Activity points
604
1. i am getting pwm output of one microcontroller like 25% 50% 75% signals
2. i want to given that signal into other pic microcontroller AS:| input and read that pwm signals on Digital IO or PWM
(Read tat Waveforms as 25 % 50% 75%) and i want to store that PWM SIGNALS in internAL eeprom
 

Hi

for relatively low frequency you could use the capture function.

It is very precise.

There is a counter. running with selectable clock freqency.
The capture function just freezes the counter value at the selected edge of the input signal (PWM)

Read at least three edges:
* rising1
* falling
* rising2

* calculate "rising2 - rising1" to get the period_time of the PWM signal
* calculate "falling - rising1" to get the high_time of the PWM signal
* calculate "high_time / period_time" to get the duty_cycle

(You don´t need to restart the counter. Nor you need to take care about overflow, as long as "PWM_period_time < counter_overflow_time)

The error should be +/- 1 counter tick.

The resolution depends on PWM frequency and counter_clock_frequency

Klaus
 
I get the feeling that this is an example of the "XY Problem" (https://xyproblem.info/).
What are you trying to do that you think measuring the PWM duty cycle is the solution?
Susan
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top