This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

why I have to connect the ADC pin with the PWM pin to take measure, what happen in the Microcontroller?



why I have to connect the ADC pin with PWM pin with a cable(wire),  what happen in the Microcontroller when i connect that pins?,  i have to do that in an exercise about take measures of one PWM less faster than the other PWM, so sorry for the question, but i'm a beginner and i'll have an oral examination in september 2nd, i really apreciate any explanation, thanks!,

  • Thought this had been covered earlier - on a related post...

    http://e2e.ti.com/support/microcontrollers/c2000/f/171/t/283398.aspx

    Is not a PWM signal confined to the digital realm (1s & 0s) while the ADC uses the analog realm?  (0V - VDD - continuous)

    So - feeding a PWM signal to an analog input can be expected to yield that voltage output by the PWM - when that PWM output is either "1" or "0."  (of course one must allow for ADC's input capacitance, input resistance and such - but beyond the bounds here)  Depending upon where in the PWM cycle the ADC performs its measurement - your analog result will vary.  Predictably - if PWM is high the ADC will record "near VDD" - if PWM is low - ADC records "near 0V."  Thus - the value of tieing a purely digital signal (PWM) to a purely analog input - appears minimal.  (or - is a remarkably inefficent method to "calculate" PWM width and/or frequency - if either can even be achieved should the PWM frequency be sufficiently high...)

    As suggested - earlier reference post (about 10 posts down - that thread) by imposing an R-C filter between the PWM output and ADC input - an analog voltage can be routed to the ADC - which (if RC values are well chosen) will be proportional to the PWM pulse width.  RC values based upon PWM frequency & desired response time.  (larger R-C products will yield smoother DC value - but require far longer to reflect any variation in PWM duty cycle)  In Engineering - we always "balance" trade-offs...

    There is significant difference between analog & digital - seems unusual that this type issue would register w/this advanced MCU...

    Update: 14:47 CST - Reflecting upon this "unusual" requirement - might you have misunderstood what's to be done?  Sometimes - PWM signals may serve to "encode" an analog value - usually an increase in PWM's duty cycle reflects an increase in analog value.  This is done as its far easier to "transfer" data digitally - than via analog.

    That said - the nature of your post still concerns.  Converting a PWM signal to analog does incur some loss in accuracy.  And takes time - and requires non-trivial, program code as you must attempt to detect both the "high & low" periods of the input PWM signal.  (which will then be entirely processed w/in the digital domain)  Should the PWM signal be of sufficient frequency - your ability to preisely "sync" your ADC "moment of acquisition" to a critical PWM edge - seems more than a little outrageous for a, self-described, "beginner." 

    If a gaming table was available - I'd place nice chip-stack on, "misunderstood assignment."