PSoC5LP : Relationship between resume processing of USB component and UART interrupt priority

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

Hi,

We are considering PSOC5LP.

< Use subsystem and component >

- USB FS

- Timer interrupt : priority default <7>

- USB interrupt : priority default <7>

- UART Tx and Rx interrupt : priority default <7>

- Sleep mode

<The process that causes the problem>

PSoC5LP goes to sleep,

Wake up with a timer interrupt.

We have a question about the USB resume processing performed within the timer interrupt.

We understand that in the USB resume processing, it is necessary to recognize the PICU interrupt of the USB Dp pin input.

However, if the default interrupt priority is kept, resume processing will not operate properly.

The following is the USB suspend and resume processing program executed in CY_ISR.

------------------------------

        CY_SET_REG8(CYREG_PICU15_INTTYPE6, USBFS_Dp_INTR_FALLING);

     

        USBFS_Suspend();

     

        // Sleep until interrupt of USB Dp

        do

        {

            CyDelayUs(20);

            CyPmSaveClocks();

            CyPmSleep2(PM_SLEEP_TIME_NONE, PM_SLEEP_SRC_PICU);

            CyPmRestoreClocks();

            CyDelayUs(20);

        }

        while (!(CY_GET_REG8(CYREG_PICU15_INTSTAT) & 0x40));

        CY_SET_REG8(CYREG_PICU15_INTTYPE6, USBFS_Dp_INTR_NONE);

        USBFS_Resume();

------------------------------

LED turn-off processing before this program,

LED lighting processing is added after the program.

Then, We have confirmed that it does not light up after "USBFS_Resume".

It seems that I can't get out of the loop and reach the last USBFS_Resume.

So the following question.

1.

In the above program,

CYREG_PICU15_INTSTAT is used to determine the end of the loop.

By raising the priority of UART_RXInternalInterrupt and UART_TXInternalInterrupt, the same program can exit the loop.

At this time, the UART is not communicating, so the UART interrupt is not used.

Do you know the reason or relationship to get it working?

2.

Regarding the interrupt priority, all other interrupts are set to Default <7>.

If the priority of only UART_RXInternalInterrupt and UART_TXInternalInterrupt of Interrupts on the cydwr screen is raised 7 to 6 or more,

Can you think of any possible problems?

Regards,

0 Likes
1 Reply
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello MaMi_1205306

Just to confirm, I guess by CyPmSleep2, you mean CyPmSleep.

Also are you sure if the device is moving into the sleep mode and not stuck in the while (!(CY_GET_REG8(CYREG_PICU15_INTSTAT) & 0x40)); loop.

Can you please attach you project, we can have a look at it. This will help us to understand why changing the UART interrupt priority causes the code to reach the last USBFS_Resume.

Best Regards

Ekta

0 Likes