I am using an ATMega8 and trying to use pins 0-7 on Port B and 0-3 on PortC as outputs. (Port D is configured as Inputs). I have the internal oscillator selected, and have DDRB (and DDRC)set to 0xFF.
The problem is with Pins Pb6 and Pb7. They are set as output, and if I set them High or Low, and measure the voltage with nothing connected, they read correctly as 0 or +5v.
However, when I connect an LED and a Resistor, things get weird.
If the the led and resistor are connected to ground, the voltage on the output pin drops to around 2.6 volts, which causes the LED to only light dimly. If the led and resistor are connected to +5v, the inputs appear to "fluctuate", and the LED does not light!
I connected the led/resistor in both configurations to other output pins on Port B, and everything works fine.
I also am unable to use those pins on the STK500 board (and I did read up/search and follow the directions regarding using the XT1/XT2 pins on PortE for the STK500....) They have the same problem... they show the correct output level when disconnected, but cannot power an LED properly.
I did make sure bit AS2 in ASSR was not set. Also, when I debug in AVR studio, things work properly... this seems to be related to sourcing/sinking current?
Thoughts or suggestions?
Oh... I also tried a second ATMega8... same results.