Hi,
Well finally I think I know what is happening.
I wrote a small piece of code to test the mysterious PTB4.
#define WONTWORK TRUE
void main(void) {
CONFIG1_COPD = 0;
PTB_PTB4 = 0;
#if WONTWORK
DDRB_DDRB4 = 0; //set up DDRB4 as an inport- does not work
#else
DDRB_DDRB4 = 1; //set it up as an outport - works
#end
PTB_PTB5 = 0;
for(;

{
DDRB_DDRB4 = 0; //it does not work on PTB4
DDRB_DDRB4 = 1;
DDRB_DDRB5 = 0; //it works on PTB5
DDRB_DDRB5 = 1;
} /* loop forever */
}
It looks like that if you want PTB4 to be an outport, you mustn't set it up as an inport to begin with.
If you do, it is impossible to switch to an outport.
The odd thing is that PTB5 behaves as the data book says.
I will discuss it further, maybe it is something on the ICS08JL board that makes it behave so strange.
Thanks for your initial message!
Regards
Ake