Problems with PSoC6 LVD Interrupt

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

cross mob
lock attach
Attachments are accessible only for community members.
Davud
Level 1
Level 1
First solution authored 5 sign-ins First like given

Hi PSoC Community.

I have trouble configuring a Low-Voltage Detection system on the PSoC6 and am in need of help. When the supply voltage reaches a specified thredshold, an interrupt should be triggered, which should result in a red LED to turn on. From my testing I can conclyde, that the LVD interrupt is only called when the supply voltage reaches ~ 2.3V (aka. when the system shuts down) regardless of the specified thredshold voltage. Changing the thredshold voltage nor any other setting does not appear to change this result. 

I believe to have followed the example implementation precisely, given in the PDL documentation.

I am using the PSoC6-Pioneer kit and PSoC Creator 4.4.

Kindly take a look at the project-attachment below.

0 Likes
1 Solution
Davud
Level 1
Level 1
First solution authored 5 sign-ins First like given

Hi again Ekta.

I have found the problem. The problem was with the PSoC6-BLE Pioneer Kit (CY8CKIT-062-BLE) I was using. When running the project on this PSoC model, the thredshold voltage interrupt would never fire. This was tested when PDL v.3.0.1.

Another problem I encountered is, that if I tried to use PDL v.3.1.5 (the latest) to compile the project, the project would compile but not run on the PSoC6. I also encountered that no project compiled with this version of the PDL would run on the PSoC. My observations can be listed as the following:

1. When debugging the CM0 core, the code execution would get stuck at some unusual place, outside of main.c.

2. The CM4 core would be completely undebugable and I would get an error stating to check the connection to the device. 

My Project runs absolutely fine on the model (CYBLE-416045-02).

Our university had just bought the PSoC6 Pioneer kit, so I have no idea why the afforementioned problems may be affecting this one.

Thank you for your time.

View solution in original post

0 Likes
4 Replies
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hi @Davud 

I went through your code. The LVD configuration is correct.

According to your explanation, I understand that you are observing interrupt only when the supply voltage reached 2.3 V during the system shutdown. This is also the expected output as LVD interrupt should occur only when there is a cross-over or down of the actual voltage from what we are setting for LVD. Just maintaining the voltage below the threshold should not cause any interrupt.

Kindly correct me if my understanding of the issue is not correct.

Best Regards
Ekta

Davud
Level 1
Level 1
First solution authored 5 sign-ins First like given

Hi Ekta. 

Thank you for your reply.

I see, my tests conclude that the interrupt does not fire when the cross-over of the specified thredshold voltage occurs. I.e., the the interrupt only fires at system shutdown. I have confirmed this by varying the supply voltage from 3.3V to 2.3V (in steps of mV).

Varying the specified thredshold voltage setting (as in CY_LVD_THRESHOLD_2_6_V, CY_LVD_THRESHOLD_2_8_V, etc.) does not change the afforementioned result. 

I want the interrupt to fire when the supply voltage crosses over the specified thredshold voltage, which should also be the normal case to my understanding. As you also have confirmed the code, I fail to see what I am missing?

Best regards.

0 Likes
lock attach
Attachments are accessible only for community members.
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hi @Davud , 

I have written the code below and tested it on one of the cypress evaluation boards. I am seeing the interrupt getting triggered and the LED getting toggled when the applied voltage crosses the set threshold.

Can you try using it at your end and see if this works for you?

Also, can you also try debugging the project and see if the code moves to the interrupt handler when there is a voltegae crossover? You can try calling the Cy_LVD_GetStatus() api to see if the detected voltage is below the threshold if the API returns CY_LVD_STATUS_BELOW.

You can see how I have implemented this in the interrupt handler of the code provided.

Best Regards
Ekta

Davud
Level 1
Level 1
First solution authored 5 sign-ins First like given

Hi again Ekta.

I have found the problem. The problem was with the PSoC6-BLE Pioneer Kit (CY8CKIT-062-BLE) I was using. When running the project on this PSoC model, the thredshold voltage interrupt would never fire. This was tested when PDL v.3.0.1.

Another problem I encountered is, that if I tried to use PDL v.3.1.5 (the latest) to compile the project, the project would compile but not run on the PSoC6. I also encountered that no project compiled with this version of the PDL would run on the PSoC. My observations can be listed as the following:

1. When debugging the CM0 core, the code execution would get stuck at some unusual place, outside of main.c.

2. The CM4 core would be completely undebugable and I would get an error stating to check the connection to the device. 

My Project runs absolutely fine on the model (CYBLE-416045-02).

Our university had just bought the PSoC6 Pioneer kit, so I have no idea why the afforementioned problems may be affecting this one.

Thank you for your time.

0 Likes