Hello , I have tried to modify the led_blinky demo code to blink the GREEN LED for a month.
But even I modified all the functions about LED in the main function, It still doesn't work.
The demo code version is SDK_2_9_0_LPCXpresso824MAX-lpcxpresso824max_led_blinky
Those functions that I have been modified are
======================================
pin_mux.c - BOARD_InitPins
add
const uint32_t IOCON_INDEX_PIO0_16_config = (/* Selects pull-up function */
IOCON_PIO_MODE_PULLUP |
/* Enable hysteresis */
IOCON_PIO_HYS_EN |
/* Input not invert */
IOCON_PIO_INV_DI |
/* Disables Open-drain function */
IOCON_PIO_OD_DI |
/* Bypass input filter */
IOCON_PIO_SMODE_BYPASS |
/* IOCONCLKDIV0 */
IOCON_PIO_CLKDIV0);
IOCON_PinMuxSet(IOCON, IOCON_INDEX_PIO0_16, IOCON_INDEX_PIO0_16_config);
======================================
pin_mux.h
add
#define BOARD_LED_GREEN_PERIPHERAL GPIO /*!<@brief Device name: GPIO */
#define BOARD_LED_GREEN_SIGNAL PIO0 /*!<@brief GPIO signal: PIO0 */
#define BOARD_LED_GREEN_GPIO GPIO /*!<@brief GPIO device name: GPIO */
#define BOARD_LED_GREEN_GPIO_PIN 16U /*!<@brief PIO0 pin index: 12 */
#define BOARD_LED_GREEN_PORT 0U /*!<@brief PORT device name: 0U */
#define BOARD_LED_GREEN_PIN 16U /*!<@brief 0U pin index: 12 */
#define BOARD_LED_GREEN_CHANNEL 16 /*!<@brief GPIO PIO0 channel: 12 */
#define BOARD_LED_GREEN_PIN_NAME PIO0_16 /*!<@brief Pin name */
#define BOARD_LED_GREEN_LABEL "SW2/D1[1]/P3[45]/J2[5]/P0_12-RED-ISP" /*!<@brief Label */
#define BOARD_LED_GREEN_NAME "LED_GREEN" /*!<@brief Identifier name */
#define BOARD_LED_GREEN_DIRECTION kPIN_MUX_DirectionOutput /*!<@brief Direction */
======================================
Led_blinky.c
#define BOARD_LED_PORT BOARD_LED_GREEN_PORT
#define BOARD_LED_PIN BOARD_LED_GREEN_PIN
======================================
LPC824.h(Both of them aren't work)
/*
#define IOCON_INDEX_PIO0_17 (0 )
#define IOCON_INDEX_PIO0_13 (1 )
#define IOCON_INDEX_PIO0_12 (2 )
#define IOCON_INDEX_PIO0_5 (3 )
#define IOCON_INDEX_PIO0_4 (4 )
#define IOCON_INDEX_PIO0_3 (5 )
#define IOCON_INDEX_PIO0_2 (6 )
#define IOCON_INDEX_PIO0_11 (7 )
#define IOCON_INDEX_PIO0_10 (8 )
#define IOCON_INDEX_PIO0_16 (9 )
#define IOCON_INDEX_PIO0_15 (10)
#define IOCON_INDEX_PIO0_1 (11)
#define IOCON_INDEX_PIO0_9 (13)
#define IOCON_INDEX_PIO0_8 (14)
#define IOCON_INDEX_PIO0_7 (15)
#define IOCON_INDEX_PIO0_6 (16)
#define IOCON_INDEX_PIO0_0 (17)
#define IOCON_INDEX_PIO0_14 (18)
#define IOCON_INDEX_PIO0_28 (20)
#define IOCON_INDEX_PIO0_27 (21)
#define IOCON_INDEX_PIO0_26 (22)
#define IOCON_INDEX_PIO0_25 (23)
#define IOCON_INDEX_PIO0_24 (24)
#define IOCON_INDEX_PIO0_23 (25)
#define IOCON_INDEX_PIO0_22 (26)
#define IOCON_INDEX_PIO0_21 (27)
#define IOCON_INDEX_PIO0_20 (28)
#define IOCON_INDEX_PIO0_19 (29)
#define IOCON_INDEX_PIO0_18 (30)
*/
#define IOCON_INDEX_PIO0_13 (1 )
#define IOCON_INDEX_PIO0_12 (2 )
#define IOCON_INDEX_PIO0_5 (3 )
#define IOCON_INDEX_PIO0_4 (4 )
#define IOCON_INDEX_PIO0_28 (5 )
#define IOCON_INDEX_PIO0_3 (6 )
#define IOCON_INDEX_PIO0_2 (7 )
#define IOCON_INDEX_PIO0_11 (8 )
#define IOCON_INDEX_PIO0_10 (9 )
#define IOCON_INDEX_PIO0_16 (10)
#define IOCON_INDEX_PIO0_27 (11)
#define IOCON_INDEX_PIO0_26 (12)
#define IOCON_INDEX_PIO0_25 (13)
#define IOCON_INDEX_PIO0_24 (14)
#define IOCON_INDEX_PIO0_15 (15)
#define IOCON_INDEX_PIO0_1 (16)
#define IOCON_INDEX_PIO0_9 (17)
#define IOCON_INDEX_PIO0_8 (18)
#define IOCON_INDEX_PIO0_7 (22)
#define IOCON_INDEX_PIO0_6 (23)
#define IOCON_INDEX_PIO0_0 (24)
#define IOCON_INDEX_PIO0_14 (25)
#define IOCON_INDEX_PIO0_23 (26)
#define IOCON_INDEX_PIO0_22 (27)
#define IOCON_INDEX_PIO0_21 (28)
#define IOCON_INDEX_PIO0_20 (29)
#define IOCON_INDEX_PIO0_19 (30)
#define IOCON_INDEX_PIO0_18 (31)
#define IOCON_INDEX_PIO0_17 (32)
======================================
Could anyone tell me where did I make mistakes?
Thanks a lot
Solved! Go to Solution.
Hello ooooowen,
I modify it for you, the GREEN led can work well, please see my attachment project.
Hope it helps,
Alice
Thanks, it does work. I'm sorry, could you tell me what's different about tour project and mine? except IOCON_INDEX_PIO0_16 and BOARD_LED_PIN
I trying to the BLUE LED by modify those two defines , but it's the same situation with my previous question.
Hello,
GPIO out put direction and function:
Got it. Thank you.