GDU Phase Multiplexer

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

GDU Phase Multiplexer

1,040 Views
axhubner
Contributor II

Hi,

 

i am using a S12ZVML128 to drive a DC motor (in fact 2 DC Motors) (not a DC brushless motor). To detect short circuit and other failtures i am trying to monitor the phase status of the HSX. Therforce the selected phase voltage in the GDU Phase Multiplexer is routed to internal ADC channel. Unfortunally I always read the current HD Voltage dividet by 12 instead of the selected phase voltage.

In the datasheet is written:

"The value written to the GDUPHMUX register does not take effect until the LDOK bit is set and the next PWM reload cycle begins. Reading GDUPHMUX register reads the value in the buffer. It is not necessary the value which is currently used."

 

I am just using the PWM-Generator A and no PTU/Global Load OK.

 

To set the LDOKA bit of the PWM Generator A i use this peace of code whitch gets called periodically.

 

if(PMFENCA_LDOKA == 0)

  {

      PMFENCA_LDOKA = 1;

      /* Set PWM Enable to reload new PWM Values */

      PMFENCA_PWMENA = 1;

  }

 

How can i read the current voltage on the HS0/HS1/HS2?

 

Regards Axel

Labels (1)
Tags (1)
0 Kudos
3 Replies

632 Views
iggi
NXP Employee
NXP Employee

Hi Alex,

I thought the PTU and related glb_ldok signal you don't use causes the issue. But the PTU initiates and triggers PMF and ADC modules with that signal. See Figure 1-12. BDCM Control Loop Configuration in S12ZVM datasheet.

glb_ldok -  device-internal PMF input signal is connected to the global load OK bit at integration level. For each of the three PWM generator time bases the use of the global load OK input can be enabled individually (GLDOKA,B,C).

I understand that global load OK (GLDOK) in PMF module can replace function of local LDOK, but not sure if that causes the problem.

if we suppose the PMF module is correctly configured as below, can you try with using the PTU module and global LDOK?

----------------------------------------------------------------------------------------------------------

PMFCFG2_REV0 = 1;             // 01 PWM generator A generates reload event.  

PMFCFG2_REV1 = 0;

PMFMODA = 2500;                   // 20 kHz  

PMFDTMA = 25;                        // 0.25 us  

PMFVAL0 = PMFMODA >> 1; 

PMFVAL2 = PMFMODA >> 1;  

PMFVAL4 = PMFMODA >> 1;  

PMFENCA_LDOKA = 1;           // apply PMF Modulo value  

PMFENCA_PWMENA = 1;  

PMFENCA_GLDOKA = 1;         // 0 = Local LDOKA controls buffered registers / 1 = external Load OK controls buffered registers

 

PMFFQCA_HALFA = 1;             // Half-cycle enabled      

PMFFQCA_LDFQA = 3;            // Reload every four PWM, fcore / 1

---------------------------------------------------------------------------------------------------

Regards,

iggi

632 Views
axhubner
Contributor II

Thanks Iggy,

That is the solution. To multiplex the phase voltage it seems to be necessary to enable one trigger generator and to set the

PTUC_PTULDOK. Setting PMFENCA_GLDOKA is not necessary.

Regards Axel

0 Kudos

632 Views
axhubner
Contributor II

Can someone help me regarding this topic?

0 Kudos