k53 OPAMP Inputs

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

k53 OPAMP Inputs

1,067 Views
MatthewScott_DE
Contributor II

I am trying to use the internal mux on the k53 to switch in two different inputs for signal conditioning before sampling but I can only get one signal to work.

I am using the k53 Tower board and the OPAMP1 module inside the processor, with processor expert used for initialization.  OPAMP1 is configured for High-speed, Inverting PGA, with a gain of -1.  The Positive input is set to OP1_DP1 (a.k.a. OPAMP0_Output) for my reference voltage and the output is set to the OP1_Out pin.  I am trying to switch my negative input between OP1_DM1 and OP1_DM2 (a.k.a. TRI0_Out) by writing to the OPAMP1_C2 register.  I can get the OP1_DM1 to output but when I set the module to look at the other input the output simply goes to the positive input voltage.  Below is my code, written for MQXLite.

while(1) {

  if(0x11 == OPAMP1_C2){

  Bit1_NegVal(Bit1_DeviceData);  // Signal begining of input change

  OPAMP1_C2 = 0x12; // Switch Input to OP1_DM2

  }

  else{

  Bit1_NegVal(Bit1_DeviceData); // Signal begining of input change

  OPAMP1_C2 = 0x11; // Switch Input to OP1_DM1

  }

  _time_delay_ticks(1);

    counter++;

  }

I have also tried using DAC0_Out as my second input and I get the same result.  I have also tried disabling the OPAMP, by zeroing out OPAMP1_C0, before making the change to OPAMP1_C2 and then re enabling the module again.  Has anyone run into this issue before?

Labels (1)
Tags (2)
4 Replies

782 Views
MatthewScott_DE
Contributor II

Got an answer from support again,

"

Please accept my apologies for the late response.

If you want to use different input for the OPAMP you only need to set the correct input on the OPAMP1_C2 register, I make a simple modification on the AN4508SW and I add

OPAMP1_C2 = (OPAMP_C2_AMPPSEL(7) | OPAMP_C2_AMPNSEL(7)); vfnThermistor_measuring(); in order to change the input for the OPAMP1 It works without problem. You do not need to disable the OPAMP Please check that the analog input is on the correct range.

I hope this will help you.

  Please let me know if you have more questions Have a good day.

"


I modified my code to use the bitmasks like he suggested:

while(1) {

    if((OPAMP_C2_AMPPSEL(1)|OPAMP_C2_AMPNSEL(1)) == OPAMP1_C2){

    Bit1_NegVal(Bit1_DeviceData);  // Signal beginning of input change

    OPAMP1_C2 = (OPAMP_C2_AMPPSEL(1)|OPAMP_C2_AMPNSEL(2)); // Switch Input to OP1_DM2

    }

    else{

    Bit1_NegVal(Bit1_DeviceData); // Signal beginning of input change

    OPAMP1_C2 = (OPAMP_C2_AMPPSEL(1)|OPAMP_C2_AMPNSEL(1)); // Switch Input to OP1_DM1

    }

    _time_delay_ticks(1);

    counter++;

  }


Unfortunately, I get the same result that I did when I hard-coded the register values.  I know my signals are in the correct range, I have swapped them back and forth and continue to get only one real signal to come out.  I don't think I am going to spend anymore time on this since i decided my design will uses external muxes for more flexibility anyway.  It was a nice dream though.

0 Kudos

782 Views
MatthewScott_DE
Contributor II

Just heard this morning that they are contacting the developer team to get an answer on this.

I have pretty much decided to use external muxes at this point for my signal routing on this project.  But I may still use this feature in the future if it does work.

I will update again when I hear anything.

782 Views
MatthewScott_DE
Contributor II

I sent this same question into Freescale Support on March 13th.  On the 15th I got a replay that my question was a bit confusing and referenced the app note dealing with the k53 amplifiers (AN4508)

I replied and told them

"

I am familiar with the app note you mentioned.  It discussing using the opamps with one of the inputs that I could get working, OP1_DP0.

My goal is to use several of the Opamp inputs and switch in different signals using the input mux. I intend to look at 6 different signals on my actual application using both Opamps on the k53.

"

I will update when I get a more solid answer.

0 Kudos

782 Views
Monica
Senior Contributor III

Matt,

thanks for making it public here, too.

We will be waiting for the response.

Regards.

0 Kudos