This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MADC conversion (TPS65950)

I am attempting to use the Monitoring ADC functionality and am having problems. We are using ADCIN2 and there is a correct voltage being applied to the adcin2 pin. For the MADC conversion process I am attempting to use the Software conversion request SW1. We have the startadc pin tied low, since we are not using the Hardware conversion request. The MADC clocks seem to be in the correct states and 26MHz is being provided.Here is the sequence of register writes that I perform.

setting the MADCON bit in the CTRL1 register to 1

setting the CH2 bit in the SW1SELECT_LSB register to 1

setting the CH2 bit in the SW1AVERAGE_LSB register to 1 (I have tried it with and without averaging)

setting the SW1 bit in the CTRL_SW1 register to 1

I am monitoring the EOC_SW1 bit in the CTRL_SW1 to see when the conversion is complete.

Reading the GPCH2_LSB and GPCH2_MSB registers for the results.

the results registers are always empty.

and it seems that the EOC_SW1 bit is 0 all the time, it is stuck in "conversion in progress" and never completing the conversion.

I am not using any interrupts to determine when a conversion is complete, my understanding is that interrupts are there to use but not required.

  • Hi,

    Please read the value of GPBR1 when you are doing this conversion.

    I think it may be 0x00. Please set it to 0x90 and do the same steps you have. It should work. Let me know if you have any problems.

     

    Regards,

    Gandhar.

     

  • before I set madcon to 1, I set GPBR1 to 0x90.  this had no effect on the results registers.  I had looked at this before and the documentation says that is the default setting so that is why I didn't set that registers before.  But it did not seem to do anything.

    so the CTRL_SW1 register is continuously reporting a value of 0xDD.  which means busy and conversion in progess.

    Any other suggestions?

     

     

     

  • Should I only have to set the channel bit in SW1SELECT_LSB register one time or each time before I start another conversion.

    I am doing the process described above once a minute.

    If I want to performa conversion once every second do I need to set the SW bit in the CTRL_SW1 register every time I want to performa conversion?

    What can prevent the conversion from completing? (the EOC_SW1 bit is 0 and the BUSY bit is 1, in the CTRL_SW1 register)?

     

     

  • Hi,

    Conversion takes few milli-seconds. The device shouldnt show BUSY status. Are you selecting CH2 in SW1SELECT_LSB and SW1SELECT_MSB?

    I do not see any problems in the steps (also refer section 9.4.3.2 in TRM)  you are using and I am not sure why you would see the BUSY status. Can you probe INT1 pin to see if you at least see an interrupt after conversion is completed.

    In case you have some pending interrupt the device may not be behaving properly.

    Are all internal power domains - VINTANA1, VINTANA2 and VINTDIG active? Does the device function normal for other modules - audio, power, etc. I am trying to understand if this is the problem with the device or just the MADC module.

     

    Regards,

    Gandhar.

     

     

  • I am selecting CH2 in SW1SELECT_LSB, the SW1SELECT_MSB is for channels CH8-CH15.  I am only working with CH2.

    I have read section 9.4.3.2 and am doing thoughs steps.  I did not setup any interrupts, so INT1 would not interrupt, correct?  In the section you mentioned number 8 says:

    "8. If the MADC_IMR1 SW1_IMR1 bit is set to 0, at the end of the conversion sequence, the MADC SIH sends a MADC_INT1_n signal to the PIH.  The PIH sends the interrupt (INT1) to the host processor."

    I am not setting the SW1_IMR1 bit to 0.  It does not say setting up the interrupt is required to get the conversion results.  I am just monitoring the EOC_SW1 bit in the CTRL_SW1 register.  While conversion is in progress, the CTRL_SW1 EOC_SW1 bit is set to 0.  So this bit is never going back to 1.

    the device works fine for the LED Drivers and PWM Generators, I am changing LEDB.  Also I am able to power down the omap and enable the 8 second power up in the Resets and Power Management section.

    I will check into - VINTANA1, VINTANA2 and VINTDIG being active.

    I am performing the sequence I described in the beginning of this discussion.  I am doing that sequence once every 30 seconds or so.

  • The values of

    VINTANA1_DEV_GRP , VINTANA2_DEV_GRP and

    VINTDIG_DEV_GRP

     

     

     

    belongs to P1 and P2 Device groups and the state is active.

  • my last response did not seem complete.  for the VINTANA1,VINTANA2 and the VINTDIG, the GRP registers were set to EE which is active I beleive.

  • Hi,

    Yes, it looks like the internal LDOs are active.

    I have no idea why you would run into this error. Is it possible to try some other ADC input? I hope you have test points on the board for other ADCs. If you can do this then it will tell us if something is wrong with ADCIN2 on your board.

    I cannot think of any other suggestions.

     

    Regards,

    Gandhar.

     

  • As a sanity check I used ADCIN2 on my test board with the following settings and had no problems reading the correct value.

    Write MADC registers:
    CTRL1 (0x0)  0x01
    SW1SELECT_LSB (0x6)  0x04
    CTRL_SW1(0x12)  0x20

     

    Read MADC registers:
    GPCH2_LSB and GPCH2_MSB

    It will help if you can check other ADC inputs or ensure that the software does nothing prior to this test. Also, I wrote GPBR1=0x00 and did this test and I was not able to write to the CTRL_SW1 register. I read back 0xDD.

    If the clock is not set right then MADC will not behave correctly.

     

    Regards,

    Gandhar.

     

     

     

     

     

  • I can read the adc results registers.  It was the clocks not being setup correctly. When I origonally wrote to the GPRI register I had the wrong I2C Address group, I thought it was in the same group as the adc stuff.  So when I changed that and it actually wrote a 90 to the register I started getting data out. 

    Thanks for the support