Hi,
I was using LPC2378's pin SSEL1 P0.6 (SSP1 peripheral, slave select) in GPIO mode while I discovered (to me) weird behaviour. Note I had switched on the fast IO before I did any experiments.
I configured the pin to be gpio (PINSEL) output (FIODIR) and initialized the value to be 1 (FIOSET). Mask (FIOMASK) left at defauult zero value.
I have another pin on port 0 which is configured as an input.
In the code I had something like:
FIO0DIR |= FIO0_OUTPUT_MASK; /* One pin will be an output */ FIO0DIR &= ~FIO0_INPUT_MASK; /* One pin will be an input */ FIO0CLR = FIO0_OUTPUT_MASK; /* Set the output to be low */ while ((FIO0PIN & FIO0_INPUT_MASK) != 0) {} /* Wait for the input to be low */ do_something_else_expecting_output_is_low(); FIO0SET = FIO0_OUTPUT_MASK; /* Set the output back to be high */
The surprising behaviour for me is in the point where the whole FIOPIN is read. Here the output pin goes high (2.5V), but not so high as it is after DIR/SET registers update (3.3V). Looks like it is switched to be an input. Further SET/CLR do not affect the output until the DIR is altered to assign the pin output function (again).
Is this just standard behaviour I only didn't understand while reading the users manual or is this weird unexpected stuff?
Thanks for any info.
Regards Pavel