CCU4 Single Shot Issues

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

cross mob
User16575
Level 1
Level 1
Hi,

Im have been running into a strange issue:

I am using the capture compare unit to generate a single pulse and poll the line after the pulse. The CCU4 is configured in single shot mode, Edge aligned and compare mode. In addition, the CCU4 generates an interrupt on a compare match and an interrupt on period match.


I am performing sequence the following in software:

1. Set up period and compare, period values. Load values by triggering a shadow transfer
2. Start Timer
3. Wait for compare interrupt
4. Change a GPIO
5.Wait for Period Interrupt

However, when i run the following sequence sequentially ( back to back executions), i found that the sequence only works when i insert a 300 microsecond delay between each sequence execution. Without the delay, the period interrupt executes before the compare interrupt and causes issues with my program.



I was wondering if there is there is a delay that is needed between when a timer ends is single shot mode and when new values can be loaded using a shadow transfer ?

Note: I clear each interrupt flag with the ISR routine.
0 Likes
0 Replies