CapSense interrupts

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

cross mob
seaoc_1454951
Level 2
Level 2
10 questions asked 5 replies posted 5 questions asked

The CapSense component uses interrupts that trigger after each sensor scan is complete.
Is there anything you have to pay attention to in the user application in order not to disturb this interrupt?

For example
Do not use interrupts with higher priority than CapSense interrupt.
There is a limit on the processing time of user interrupts with higher priority.

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Some general rules of thumb for interrupt handlers:

  • Do not use delay functions within the handler directly or indirectly (Some LCD components use delays)
  • Do not wait for an event to happen (Signal ready, Timer expires)
  • When appropriate: Reset the interrupt cause and set a flag (global volatile uint8 variable) which is tested in the main loop and acted upon

Keep in mind:

Any global variablewhich gets changed within an interrupt handler must be declared as "volatile"

When you find a conflicting access you may encapsulate this within a "Critical Section". See CyEnterCriticalSection() and CyExitCriticalSection() APIs.

Of course you may use interrupts of higher priority (lower numbers) than the capsense interrupt.

There is no numeric limit, but ​keep the handlers short​.

Bob

View solution in original post

0 Likes
1 Reply
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Some general rules of thumb for interrupt handlers:

  • Do not use delay functions within the handler directly or indirectly (Some LCD components use delays)
  • Do not wait for an event to happen (Signal ready, Timer expires)
  • When appropriate: Reset the interrupt cause and set a flag (global volatile uint8 variable) which is tested in the main loop and acted upon

Keep in mind:

Any global variablewhich gets changed within an interrupt handler must be declared as "volatile"

When you find a conflicting access you may encapsulate this within a "Critical Section". See CyEnterCriticalSection() and CyExitCriticalSection() APIs.

Of course you may use interrupts of higher priority (lower numbers) than the capsense interrupt.

There is no numeric limit, but ​keep the handlers short​.

Bob

0 Likes