For a unknown reason, for me of course, the PIO0_8 in such a board is always read as logical LOW. The jumpers follow the factory settings. The pin is set as input:
#include "board.h"
#include <cr_section_macros.h>
...
SystemCoreClockUpdate();
Board_Init();
Chip_GPIO_SetPinDIRInput(LPC_GPIO_PORT, 0, 8);
...
bool tSup = Chip_GPIO_GetPinState (LPC_GPIO_PORT, 0, 8);
// here always read false (or LOW), even when the pin is at 2.5V
Even though the pull-ups resistors are enabled by default, I set one 10K at the pin. This pin, the 14 in the 20 lead package, reads 2.5 volts, HIGH I guess, but internally at the chip it's read as LOW. I didn't found any conflict in this pin, looking both at the schematic and int the board.c library function, Board_Init(). But maybe I'm overlooking something.
Pins 0, 4 and 6 are set as inputs as well, and their readings are as expected: low when low, and high when high.
Any ideas? Thank you in advance!!
Hi,
PIO0_8 can works as XTAL so it is possible that somewhere in the init is enabled this functionality.
In this schematic https://www.embeddedartists.com/sites/default/files/support/xpr/LPC812_max/LPC812_MAX_Schematic_Rev3... is shown that PI0_8 is maybe connected to crystal.
Try to look if the chip runs from integrated crystal or external.
If internal than try this before GPIO init:
Chip_SWM_Init();
Chip_SWM_DisableFixedPin(SWM_FIXED_XTALIN);
Chip_SWM_Deinit();