K82: LLWU wakeup due LPUART1

cancel
Showing results for 
Search instead for 
Did you mean: 

K82: LLWU wakeup due LPUART1

232 Views
EugeneHiihtaja
Senior Contributor I

Hi !

I'm using LPUART1 where RX pin is PTC3 ( LLWU_P7) and TX pin - PTC4 ( LLWU_P8).

I would like to wakeup MCU from LLS3 mode if some incoming bytes available on RX pin ( Falling edge at START bit).

It looks like if I configure LLWU_P7 as wakeup source -> it can wakeup MCU.

But should I reconfigure Pin muxing as well and return RX assignment back after wakeup ?

Before LLS3:

PORT_SetPinMux(LPUART1_RX_PORT, LPUART1_RX_PIN, kPORT_MuxAsGpio);

After:

 PORT_SetPinMux(LPUART1_RX_PORT, LPUART1_RX_PIN, kPORT_MuxAlt3);

or just one call LLWU_EnableInternalModuleInterruptWakup(.. LLWU_P7,..) is enough for have wakeup finctionality ?

Also first byte is always lost . Is any idea if it possible to receive it properly ?

Regards,

Eugene

0 Kudos
7 Replies

80 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Eugene Hiihtaja,

     If you want to use the LLWU_P7 as wakeup source, you need to configure the PTC3 as the GPIO pin, and enable the internal pull up.

    You can refer to this configuration, this is the LLUW_P10 PTC6 configuration:

    const port_pin_config_t portc6_pin78_config = {/* Internal pull-up resistor is enabled */
                                                   kPORT_PullUp,
                                                   /* Fast slew rate is configured */
                                                   kPORT_FastSlewRate,
                                                   /* Passive filter is disabled */
                                                   kPORT_PassiveFilterDisable,
                                                   /* Open drain is disabled */
                                                   kPORT_OpenDrainDisable,
                                                   /* Low drive strength is configured */
                                                   kPORT_LowDriveStrength,
                                                   /* Pin is configured as PTC6 */
                                                   kPORT_MuxAsGpio,
                                                   /* Pin Control Register fields [15:0] are not locked */
                                                   kPORT_UnlockRegister};
    /* PORTC6 (pin 78) is configured as PTC6 */
    PORT_SetPinConfig(PORTC, 6U, &portc6_pin78_config);‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

LLWU_SetExternalWakeupPinMode(LLWU, LLWU_WAKEUP_PIN_IDX, LLWU_WAKEUP_PIN_TYPE);

About details, you can refer to the K82 sdk, power_manager project, APP_SetWakeupConfig function.

Wish it helps you!

If you still have question about it, please kindly let me know.


Have a great day,
Kerry

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

0 Kudos

80 Views
EugeneHiihtaja
Senior Contributor I

Hi Kerry !

It means after LLWU wakeup I should reconfigure gpio pin back as LPUART1 RX ?

But if I call LLWU_SetExternalWakeupPinMode(LLWU, LLWU_WAKEUP_PIN_IDX, LLWU_WAKEUP_PIN_TYPE); line

and leave pin as LPUARTRX it works as well.

So reconfiguration of pin is mandatory or not ?

Regards,

Eugene

0 Kudos

80 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Eugene,

   If you just use LLWU_SetExternalWakeupPinMode, and didn't modify the mux, it also works on your side and really don't have any problems, then you can don't configure the mux, as I know, even the mux is the other function, not the GPIO, but the gpio input function should also work.

Wish it helps you!


Have a great day,
Kerry

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

0 Kudos

80 Views
EugeneHiihtaja
Senior Contributor I

Hi Kerry !

I also have tried with and without modifications and it seems to me work also.

But I haven't find way to get first byte. Even RX interrupts is enabled.

I use  transfer speed.

I just wondering if proper clock selection for LPUART1 can help with first byte drop.

It seems to me similar technique works with I2C slave interface when I2C_SDA line is connected to LLWU_P11/PTC11 pin.

But not clear yet if first byte drop or not.

Is any idea how-to properly wakeup MCU due incoming transaction ( START ) on I2C slave interface.

Regards,

Eugene

0 Kudos

80 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Eugene Hiihtaja,

    The first byte is lost, it is understandable.

    Because the wake up need time, and as you know, after the chip get the falling edge, it just detect it as the wake up signal, it won't process it as the UART Start signal, so the first byte will be lost:

pastedImage_1.png

   From my opinion, I think you another UART side, and send two bytes, just use one byte as the the dedicated wakeup byte, in the K82 side, also process the first byte as the wake up byte, and not process the data.

Wish it helps you!


Have a great day,
Kerry

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

0 Kudos

80 Views
EugeneHiihtaja
Senior Contributor I

Hi Kerry !

So in our case duration of start bit 8.3us is comparable with wakeup time 6.3us and basically first start is not detected.

I just wondering how to I2C can work in similar mode ? Clock there 400Mhz what is even higher.

Or I2C slave peripheral is always "ON" and can detect own address even on LLS3 mode and LLWU pin no need at all.

Regards,

Eugene

0 Kudos

80 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Eugene,

   Sorry for my later reply.

   What I mean is the first edge will be detected as the LLWU wake up signal, not the I2C start signal, just after the MCU has really waked up, then it's I2C module can work normally, that's why you will lost the first byte.

    So, I think from your master side, you can try another start signal again.

    VLLSX mode can't use the I2C address match to wake up the mcu:

pastedImage_1.png

Wis it helps you!


Have a great day,
Kerry

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

0 Kudos