I tried to connect both an Atmega8 and an Atmega168 uC to the serial port of my computer and I have the same results: just squares. Let me detail the problem:
I used a simple Arduino sketch: Serial.begin(9600) in setup() and Serial.print (sensorValue); delay (1000) in loop(). I did not used an external crystal, just the internal of both uCs. I used the schematic provided by sparkfun, found here http://www.sparkfun.com/tutorials/104
, but connected a capacitor from 2 to ground and one from 6 to ground, in the 232 IC. I made the connections correctly, checked and double checked them. I used 3x1,5 batteries to power the chips.
I tried both hyperterminal (where I did not receive anything), and the serial monitor of the Arduino IDE, where I receive only squares, at a second (see the delay) interval. I also tried Teraterm and I had the same results.
I have Windows XP and I do not know other programming languages for the AVRs, except Arduino IDE and Processing.
What am I missing? Can any of you who tried this post some schematic with an AVR and the MAX232? Is it the code (which, as you guessed, works perfectly for an Arduino board) ?
Thank you very much for your patience.