What is the logic set for quadrature decode phase AB encoder in eMIOS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

What is the logic set for quadrature decode phase AB encoder in eMIOS

598 Views
poojamarekar
Contributor I

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. 

0 Kudos
3 Replies

522 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

diagrams shown in the reference manual are the best ones to understand how it works:

pastedImage_1.png

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

0 Kudos

522 Views
poojamarekar
Contributor I

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. 

0 Kudos

522 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

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

0 Kudos