CrossRoads:
I think I made a mistake though, I didn't connect AVCC(because I thought it was internally connected in the atmega) and AREF to anything. Could this be causing all the trouble??
Yes! Avcc must be connected to Vcc. Add a 0.1uF cap to Gnd also.
Add a 0.1uF cap from Aref to Gnd as well.
Will try it now. Do I need to put a cap between Avcc and Vcc too?
thanks