Part Number: TMS320F28379D
Tool/software: Code Composer Studio
Good day.
We need 4 quadrature encoders on our device, so I created my own in CLB. I have two GPIO's coming in driving two FSM's, one for forward and one for backward. These then feed into a LUT with an OR between them. The output of the LUT triggers the counter and add or subtract is determined by if FSM for forward is high. I then have a system timer that triggers every 10 ms and I read the value of counter using CLB_getRegister(CLB1_BASE, CLB_REG_CTR_C0);. I have a watch expression that keeps an eye on the value.
This is basics and I was sure it worked at some point. Now I'm having an issue where the counter value jumps around. I've simplified the test forcing the counter to add by hard coding the mode1 to 1, and only trigger if the encoder drives forward (This is one clock cycle pulses). It counts up fora moment then the value goes jumps to a new value, including a value that is lower than what it was. How can it be lower if there is no reset event set and if the mode1 is set to 1?
Thank you for the feedback