Hi
The GPIO configuration of LPC 845 which is slave was not configured properly. When checking the pins, it shows the same state when configuring either high/low. By checking the frequency of external clock, it doesn't show any sine waves just showing high and low. When checking the internal frequency same scenarios have been occur. From the studies, LPC845 need not any external clock. Is that true?
The suspect is that, the controller may get into the ISP mode or may the internal clock doesn't work. Also the PLL for external clock has configured but same scenario has occur.
I have attached you the schematics of our board. Kindly suggest some solution.
With regards
Dharsan K K
Embedded Software Engineer
Hi @DHARSAN
1. If the GPIO pins show the same state (high or low) regardless of how they’re configured, it suggests that the pins might not be properly initialized or that the microcontroller is in a mode where GPIOs are not functional (e.g., ISP mode).
2. The LPC845 does not necessarily need an external clock source to function.
If you’ve configured the PLL, ensure that the reference clock is stable. If the PLL isn’t locking or if the input frequency is unstable, it can cause erratic clock behavior.
You can also route the clock signal to a pin for testing by configuring the CLKOUT feature. This can help you measure the actual clock signal on an oscilloscope to verify its stability and frequency.
BR
Hang
SYSCON->SYSAHBCLKCTRL0 |=1<<6; //clock for GPIO0 port
SYSCON->PRESETCTRL0 |=1<<6;
SYSCON->SYSAHBCLKCTRL1 |=1<<20; //clock for GPIO1 port
SYSCON->PRESETCTRL0 |=1<<20;
IOCON->PIO[IOCON_INDEX_PIO1_8]|=0x00; //pin 1
GPIO->DIR[1]|=(1<<8);
// GPIO->SET[1]|=(1<<8);
GPIO->CLR[1]|=(1<<8);
IOCON->PIO[IOCON_INDEX_PIO1_9]|=0x00; //pin 3
GPIO->DIR[1]|=(1<<9);
// GPIO->SET[1]|=(1<<9);
GPIO->CLR[1]|=(1<<9);
IOCON->PIO[IOCON_INDEX_PIO0_4]|=0x00; //pin 9
GPIO->DIR[0]|=(1<<4);
// GPIO->SET[0]|=(1<<4);
GPIO->CLR[0]|=(1<<4);
IOCON->PIO[IOCON_INDEX_PIO1_7]|=0x00; //pin 47
GPIO->DIR[1]|=(1<<7);
GPIO->CLR[1]|=(1<<7);
The above program is the initialization for the respective pins as it does not work for the code.
Even the pins are taken up from the track for the verification. Do the pins need to pull down or pull up for the issue?
Hi @DHARSAN
If the LPC845 is in ISP mode, it would ignore the user code and remain in bootloader mode, which could explain why the GPIOs don’t respond. Normally, ISP mode is entered if certain pins are held low during reset. Ensure that the ISP pin (typically PIO0_12) is not being held low during reset unless intentionally entering ISP mode. This pin might require a pull-up resistor to avoid unintentionally entering ISP mode:
Confirm that no other hardware connections or configurations are inadvertently pulling this pin low on startup.
BR
Hang
The controller has flashed the program and the GPIO has not configured properly. Suspected that if the controller get into the ISP mode, whether i need to give pull up or pull down though it already programmed.