cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

seaoc_1454951
New Contributor

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
Reply
1 Solution
JoMe_264151
Expert II

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
Reply
1 Reply
JoMe_264151
Expert II

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
Reply