Pin voltage drops under load

When I put a load across pins 1-12, the voltage between the pin and ground drops substantially. A basic LED connected across these pins, with or without resistor barely illuminates. Pin 13 seems to be fine. I think I've somehow damaged the ATMEGA328, but I thought I would ask to see if anyone else has any ideas why this might be happening. Is there anything on the board itself which could be damaged, and causing this result? I know it's not the code, because I wrote a program that simply kept pins 1-13 high, and nothing else. They definitely don't seem able to maintain 5 V under load.

Thanks.

Have you properly used the pinmode command to set the I/O pins to output mode and then set the bit(s) HIGH? I/O pins default after a reset to input mode and cannot source or sink current.

Let us see your code if your in doubt.

Lefty

I haven't, so I'll give that a shot and see what happens. I'm new to the arduino, but thanks.

A basic LED connected across these pins, with or without resistor barely illuminates.

I think I've somehow damaged the ATMEGA328

You will have damaged if you connect an LED without a resistor.
http://www.thebox.myzen.co.uk/Tutorial/LEDs.html

But not setting the pin as an output has probably saved it.

You can't take more than 40mA from a pin without damaging it.