- ###############################################
- Facing Issue with the interrupt generation on the pcnt threshold watchpoint.
- When watchpoint is added as threshold, apart from the high limit and low limit, we are facing issue such that, the interrupt is first generated at the threshold value, after crossing zero, but lets say, in between if I change the pcnt threshold, by deleting the current watchpoint and add another watchpoint which should get triggered in a further count, the interrupt does not get generated, or reaching till pcnt_default_isr, and it will be triggered only after the limit is touched and the counter value gets zeroed, and again reaches the same value.
- using version ESP IDF 5.1
- Here below is a flow prints which was added in the rotary encoder flow.
- New configuration : CurrPos : 29 || New Target : 327
- pcnt: watchers[0] = [0, 327] // Target set for 327
- pcnt: watchers[1] = [-1, 0] // Invalid
- pcnt: watchers[2] = [2, -3576] // Lower threshold
- pcnt: watchers[3] = [3, 3576] // Upper threshold
- pcnt: watchers[4] = [-1, 0] // Invalid
- ###############################################
- Curr Cycle : 29 int_count : 1
- Curr Cycle : 62 int_count : 1
- Curr Cycle : 207 int_count : 1
- Curr Cycle : 308 int_count : 2 // Interrupt recieved for watchpoint, int count incremented
- Motor position reached at 327, stopping motor // Recieved interrupt, and motor stopped
- ###############################################
- New configuration : CurrPos : 331 || New Target : 629
- pcnt: watchers[0] = [0, 629]
- pcnt: watchers[1] = [-1, 0]
- pcnt: watchers[2] = [2, -3576]
- pcnt: watchers[3] = [3, 3576]
- pcnt: watchers[4] = [-1, 0]
- ###############################################
- Curr Cycle : 331 int_count : 2
- Curr Cycle : 365 int_count : 2
- Curr Cycle : 410 int_count : 2
- .
- Curr Cycle : 611 int_count : 2
- [color=#FF0000]Curr Cycle : 661 int_count : 2 // Crossed new target which was 629, but interrupt count not incremented[/color]
- Curr Cycle : 711 int_count : 2
- .
- Curr Cycle : 2634 int_count : 2
- Curr Cycle : 3543 int_count : 2
- Curr Cycle : 18 int_count : 3 // High limit interrupt: added interrupt count from 2 to 3, but ignored as its not the one which we are looking for
- Curr Cycle : 68 int_count : 3
- Curr Cycle : 573 int_count : 3
- Curr Cycle : 623 int_count : 3
- Curr Cycle : 674 int_count : 4
- Motor position reached at 629, stopping motor
ESP32 interrupt issue in Rotary Encoder usage using pcnt unit
ESP32 interrupt issue in Rotary Encoder usage using pcnt unit
Who is online
Users browsing this forum: No registered users and 141 guests