Hi,
There exists many Unified Channel Mode of Operation such as Input period measurement, Quadrature decode
(for phase_A and phase_B encoders type) for MPC5553.
What does exactly happen when any of these modes is selected?
Let's consider quadrature decode mode (for phase_A and phase_B encoders type). I want to know what happens in background if I select this mode. What settings have been already made for this encoder type? Where can I get the software code used for its settings?
I've referred MPC5553/MPC5554 Microcontroller Reference Manual to understand basics but not getting idea how it is implemented in firmware code.
Thanks in advance.
Hi,
diagrams shown in the reference manual are the best ones to understand how it works:
I also found very simple testing code in my repository - see attached. You can connect respective signals to pins (the best way is to use very slow signals or manually controlled signals) and then watch the effect in EMIOS registers to understand the functionality. The example is written for count and direction encoders type but it doesn't matter, it works in similar way.
Regards,
Lukas
Hi Lukas,
Thanks for your quick response.
I went through attached testing code. There I found:
edge_count[i] = EMIOS.CH[8].CCNTR.R; /* read edge count */
Is there any requirement for additional settings to use CCNTR?
Does this CCNTR automatically get updated? Does the mode of operation have any impact on CCNTR?
Your reply will help me a lot.
Yes, CCNTR is automatically updated. You can connect the signals from encoder to the pins and watch the CCNTR. No other settings are required.
The CCNTR is updated in the same way regardles of mode - you will see the same effect also when using Phase_A and Phase_B Encoder.
Regards,
Lukas