You are here

CapSense RAW Value always maximum | Cypress Semiconductor

CapSense RAW Value always maximum

Summary: 6 Replies, Latest post by johann_1862776 on 29 Nov 2016 05:28 AM PST
Verified Answers: 2
Last post
Log in to post new comments.
johann_1862776's picture
User
7 posts

Hello community,

 

i´m developing an application with CY8CKIT-042-BLE, a SSD1306 OLED-Display and a NXP PN512 NFC-Controller.

I ned three buttons for my application and i want to use CapSense for that.

I use the CapSense v3.0 component with PSoC Creator 3.3 SP2.

The Example "PRoC_BLE_CapSense_P4_OneButton" works fine to tune the CapSense button(s) with the Tuner Application.

 

But in my Application (not the same code for CapSense) the CapSense v3.0 component is not working correctly.

If i print out (over UART) the RAW Value of any CapSense button, the value is always the highest possible value.

 

I don´t came along with this faulty behavior.

 

Can anyone take a look in my source and can tell me what is wrong with my project?

Thanks in advance.

 

PS.: CapSense algorithm is in C file "buttons.c"

johann_1862776's picture
User
7 posts

Can anybody tell me witch HW (Timers, SysTick, IntVectors, ...) is used by the CapSense Component?

I think there is are a race condition with the HW that i use in my project, but the ressource monitor nor the documentation of CapSense describes the use of any HW by CapSense.

In my project i use the SysTick Timer, WDT0, SCB0 and SCB1, TCPWM2 and TCPWM3, 2x PWM.

I use the PRoC BLE board of the CY8CKIT-042-BLE Kit.

 

Please help me

user_1377889's picture
User
9583 posts

When you open the CapSense datasheet and to proceed to "Resources" you will see that there is no timer or other resource used except the CSD block, an interrupt and one to two IDACs. So there might be the interrupt that causes your "race condition". Check / set the priorities to test. In your handlers (if you have got any) avoid lengthy code, loops and (absolutely no) delays.

 

Bob

PS: Where in Germany are you located? I live near Bremen.

johann_1862776's picture
User
7 posts

Tanks for your reply.

I live near Munich in Bavaria.

I have a mode, called standby, in which no interrupt is periodically triggered except the interrupt of WDT0. Also in this mode i get always the highest possible RAW Value.

The WDT0 interrupt only triggers my "Scheduler" to execute the function which execute the relevant functions of the CapSense component.

My assumption until now was that i reconfigured an interrupt vector that is used by CapSense. Now i think that assumption was wrong.

I do not have any delays in normal operating mode. I handle this with one HW-Timer and a set of functions, called Scheduler, to delay operations.

What do you mean with handlers? Handlers in general or for CapSense?

user_1377889's picture
User
9583 posts

A "handler" is the code that "handles" the interrupt ;-)

I would suggest you to reduce the (a copy) project to its barest using capsense. One thing I could see: you are mostly working with "widgets". A single widget with 3 buttons could be enough.

 

Bob

yuva's picture
Cypress Employee
29 posts

Hi,

 

In your project I see that you are using manual tuning for capsense. Have you followed the tuning procedure given in section 5.3  in the CapSense design guide. Can you check if tuning helps to your your issue? Also disable the IDAC auto-calibration and try setting it manually. 

 

Thanks,

Yuva.

johann_1862776's picture
User
7 posts

Dear Yuva,

thank you for your help. I have decided to do a fresh start of my project.

The code was very ugly, so i ported FreeRTOS to my uC to have a better frame for my project and implemented first Deep-Sleep and CapSense as a Task in it.

Until now, CapSense and Deep-Sleep is working perfectly with all other components that i had added in my old workspace before.

I don´t know what has caused this behavior, but it isn´t important anymore.

This topic can be closed.

Log in to post new comments.
RSS Back to Top
Topic locked