Counter_App: Count Matech Event

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

cross mob
Andi_H
Employee
Employee
First solution authored First like received
Hello,

HW: xmc1404

I am using the Counter App 4.1.10. to count pwm pulses. (Up and down counting, controlled by Software (D_IO_APP))
I change the count_match Value "on the fly"
--> When i count "up" everything is fine --> Count Match Event occourse as expected.
But when i count down, the Count Match Event did not occourse.

Are there any ideas what i am doing wrong?

I've read a few posts where problems with counting down were described --> is this an documented bug?

best regards
Andi
0 Likes
1 Solution
Andi_H
Employee
Employee
First solution authored First like received
PROBLEM SOLVED:

you have to reconfigure the CCxEventConfig after the change of direction:

COUNTER_CC4_lEvtConfig(counter_handler->ccu4_handle->slice_ptr,XMC_CCU4_SLICE_IRQ_ID_COMPARE_MATCH_UP,stepper_conf->counter_handler->ccu4_handle->count_match_node_id);
or
COUNTER_CC4_lEvtConfig(counter_handler->ccu4_handle->slice_ptr,XMC_CCU4_SLICE_IRQ_ID_COMPARE_MATCH_DOWN,stepper_conf->counter_handler->ccu4_handle->count_match_node_id);

best regards
Andi

View solution in original post

0 Likes
1 Reply
Andi_H
Employee
Employee
First solution authored First like received
PROBLEM SOLVED:

you have to reconfigure the CCxEventConfig after the change of direction:

COUNTER_CC4_lEvtConfig(counter_handler->ccu4_handle->slice_ptr,XMC_CCU4_SLICE_IRQ_ID_COMPARE_MATCH_UP,stepper_conf->counter_handler->ccu4_handle->count_match_node_id);
or
COUNTER_CC4_lEvtConfig(counter_handler->ccu4_handle->slice_ptr,XMC_CCU4_SLICE_IRQ_ID_COMPARE_MATCH_DOWN,stepper_conf->counter_handler->ccu4_handle->count_match_node_id);

best regards
Andi
0 Likes