Analogue Read/Write Behaving As Binary

I am using two ATMEGA328P-PU microcontrollers (the chip from the arduino uno), and I am programming the chips by connecting the TX, RX, and reset pins to an arduino board without a chip on it. This method of programming and using chips has worked for me in the past, but I have never used analogue signals with these particular chips, so I will accept the possibility that these chips are defective.

Nothing wrong with the chips. To be fair to beginners to arduino, they didn't do beginners any favors by naming the function analogWrite(), where it should really have been named pwmWrite(). The mega328p does not have a true digital to analog converter internally, it does however have some hardware timers that can be configured to output a signal at a constant frequency but with a variable duty cycle (the time the signal is HIGH) that can be set to anywhere from 0% to 100% HIGH over 256 range of values. To convert this digital PWM signal to a true analog voltage involves wiring it to a low pass filter (R/C network) and usually then buffering it with a unit gain op-amp. Of course another method would be to utilize an external DAC module.

Not to further confuse the issue but the analogRead() function is a true ADC function that the 328P has built into it and converts any analog voltage in the range of 0 to +5vdc into a 10 bit digital value thus converting the voltage to a digital value from 0 to 1023.

That help?