lpcxpresso845max_ctimer_pwm_example from SDK_2.x_LPC845

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

lpcxpresso845max_ctimer_pwm_example from SDK_2.x_LPC845

521 Views
1234567890
Contributor IV

Hi, following an advice I imported the examples from the SDK in the title, because the examples for my LPC845-BRK are very buggy. The boards differ of course (64 pin MAX, 48 pin BRK and so on), but for understanding the drivers the pure code should be good.

So I imported the example in the title. Here is a part of pin_mux.c:

pastedImage_1.png

What's that? PORT2, 4 and 5 on a LPC845? It has only PORT0 and PORT1. And where does pin 20, 44 and 45 come from?

And the readme.txt doesn't say anything about on what pin the PWM comes out of the chip. And a scope or logic analyzer should be recommended/optional to watch the PWM at PIO0_28. Without that the example is pretty boring.

And in main:

pastedImage_2.png

1.) 2 lines later, with BOARD_BootClockFRO30M(), the FRO with 30 MHz is selected as main clock source. Not 12 MHz.

2.) And 1 line later BOARD_InitDebugConsole() contains CLOCK_Select(BOARD_DEBUG_USART_CLK_ATTACH), so it's called again in board.c. So the code in the screenshot above should be deleted completely.

Labels (1)
0 Kudos
2 Replies

404 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi

I was informed, this issue has been fixed. the fix will be included in next SDK release. Thanks for bringing the problem to our attention.

Fixed code:

    const uint32_t pio0_28_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);
    /* PIO0_28 IOCON index number is 20. it is configured as */
    IOCON_PinMuxSet(IOCON, IOCON_INDEX_PIO0_28, pio0_28_config);
 
    const uint32_t pio1_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);
    /* PIO1_16 IOCON index number is 44. it is configured as */
    IOCON_PinMuxSet(IOCON, IOCON_INDEX_PIO1_16, pio1_16_config);
 
    const uint32_t pio1_17_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);
    /* PIO1_17 IOCON index number is 45. it is configured as */
    IOCON_PinMuxSet(IOCON, IOCON_INDEX_PIO1_17, pio1_17_config);‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

 

 


Have a great day,
Jun Zhang

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

404 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi,

Thanks for letting us know the issue.

I will escalate it to development team. Thanks for bringing the problem to our attention.


Have a great day,
Jun Zhang

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos