Issues with I/O (PC2-4, ATmega32)

Hi
Excuse me if this questions in the wrong forum section but now I have bashed my head against this weird issue for some time.

I'm teaching a course in microcontrollers and have a couple of line tracking robots with ATmega32:s (sorry, only Swedish). They're designed for BASCOM, which in my honest opinion is crap.

I've modified version 22 of Arduino and made a stk500-compatible bootloader work but have now run into some problems. Everything I've tried has worked like a charm. Now I'm having issues with using PC2-4 as inputs. Since I have multiple robots I can rule out faulty hardware and since the physical design has worked many times before with BASCOM I suspect that it's a software issue. I have checked the Arduino files (mainly pins_penguino.cxx) and can't find a reasonable explanation and now time's running out. One hypothesis is that it's a conflict with analog I/O but I can't find any code that might explain it.

My modified software package can be downloaded here.

Kind regards

Found out that I had JTAG enabled and according to the data sheet that disabled PC2-5 as INPUTs. Lot's of hours for such a simple thing.