AnsweredAssumed Answered

k53 OPAMP Inputs

Question asked by Matt Scott on Mar 12, 2013
Latest reply on Mar 22, 2013 by Matt Scott

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?

Outcomes