Reading an output analog pin with an input analog pin
Can someone please let me know what I'm not doing correctly?


the analog (output) pins on those chips are not exactly analog: they are pwm output pins. as such, their output is either 0 or 1, nothing in between, with the chance of being 1 equal the duty cycle.

that kind of output can be a steady "analog" if you run it through a low pass filter - the simplest would be an rc filter where the r is in serial with the c.

so if you hook th epwm pin up to a rc filter and adc the output of that rc filter, you will get a real "analog".