• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Data Converters » Precision Data Converters » Precision Data Converters Forum » Unable to read the ADC register values of LMC90100
Share
Precision Data Converters
  • Forum
  • Files
  • E2E Wiki
Options
  • Subscribe via RSS
Check out
The Signal blog
  • $core_v2_blog.Current.Name

    Pop Quiz!

    Posted 2 days ago
    by Bruce Trump
    Put away your books and take out a sheet of paper. Each question...
  • $core_v2_blog.Current.Name

    Settling Time

    Posted 8 days ago
    by Bruce Trump
    Settling time is the time required for an op amp to respond to...
  • $core_v2_blog.Current.Name

    Slew Rate—the op amp speed limit

    Posted 16 days ago
    by Bruce Trump
    Slewing behavior of op amps is often misunderstood. It’s...

Unable to read the ADC register values of LMC90100

Unable to read the ADC register values of LMC90100

This question is not answered
Arun Luthra1
Posted by Arun Luthra1
on Dec 19 2012 07:06 AM
Prodigy40 points

Hi to all,

            I am working with the LMP90100 multi-channel ADC. I do the inferface with pic controller communication is working fine i am getting the default values from register and Displaying in LCD giving the exect values mention in the datasheet but when i am  trying to get/read the value from the ADC register we are getting the erratic values.

please help us out where i doing wrong below is my program :-

void main()
{


unsigned char Cont=0,port_data=0;
MCU_Init();
Int_Lcoal_Variable=0;
Lcd_Out(2,1,"Testing");
Spi_Init();
Delay_100ms();
LM_90100_Init();


//Power Config
LM90100_Spi_Read_Write_Single_Value(TI_LMP90100_PWRCN_REG,0); //Active Mode


//AUXCN
LM90100_Spi_Read_Write_Single_Value(TI_LMP90100_ADC_AUXCN_REG,0x0A); //Config AuxChannel

//Channel Config
LM90100_Spi_Read_Write_Single_Value(TI_LMP90100_CH0_CONFIG_REG,0x41); //Config Channel Zero
LM90100_Spi_Read_Write_Single_Value(TI_LMP90100_CH1_CONFIG_REG,0x41); //Config Channel One

LM90100_Spi_Read_Write_Single_Value(TI_LMP90100_BGCALCN_REG,0x00); //Confif TI_LMP90100_BGCALCN_REG

//Channel Input
LM90100_Spi_Read_Write_Single_Value(TI_LMP90100_CH0_INPUTCN_REG,0x41); //Confif TI_LMP90100_CH0_INPUTCN_REG
//LM90100_Spi_Read_Write_Single_Value(TI_LMP90100_CH1_INPUTCN_REG,0x41);


LM90100_Spi_Read_Write_Single_Value(TI_LMP90100_ADC_RESTART_REG,1); //REset the ADC Register

while(1)
{

LM90100_Spi_Read_Write_Single_Value(TI_LMP90100_CH_SCAN_REG,0x00);
LM_90100_Spi_Writing_Address_Data(TI_LMP90100_CH_STS_REG,LM90100_Read_Ptr,1,SPI_READ);

//Storing the CH_STS_REG Value to the LM90100_Read_Ptr
if(*LM90100_Read_Ptr<0xff) //Checking the CH_STS_REG Status
{

LM_90100_Spi_Writing_Address_Data(TI_LMP90100_ADC_DOUT2_REG,LM90100_Read_Ptr,3,SPI_READ);
Display_Int2Float(1,1,*LM90100_Read_Ptr,_One_Degree,0); ///Reading the Upper register value
Display_Int2Float(2,1,*(LM90100_Read_Ptr+1),_One_Degree,0); ///Reading the Middle register value
Display_Int2Float(2,10,*(LM90100_Read_Ptr+2),_One_Degree,0); ///Reading the Lower register value
Display_Int2Float(1,10,Cont++,_One_Degree,0); //Just to know where the programm is comming to this while loop or not.
port_data=~port_data;
LM90100_Spi_Read_Write_Single_Value(TI_LMP90100_GPIO_DAT_REG,port_data); // Complimenting the GPIO ports this is also WORKING we had testing using the multimeter.

          Delay_ms(1000);
}

}  

}

Thanks & Regards

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Tom Hendrick
    Posted by Tom Hendrick
    on Dec 19 2012 19:19 PM
    Guru86375 points

    Hi Arun,

    Would it be possible for you to provide a schematic or possibly describe you hardware setup for us?

     

    Regards,

    Tom

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Arun Luthra1
    Posted by Arun Luthra1
    on Dec 20 2012 09:30 AM
    Prodigy40 points

    Hi tom,

      Thanks for your replay !

      we are using LMP90100 Evaluation board, so as per the datasheet we had done the same connection. Evening when we connect with SPIO-4 digital controller board the temperature is showing on the PC. Now we just remove the SPIO-4 Board and give the SIP connection to our micro-controller board. I hope i answer your quotation.

    Now my major concern is step before init the ADC what we are doing is right or not?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Arun Luthra1
    Posted by Arun Luthra1
    on Dec 27 2012 06:09 AM
    Prodigy40 points

    Hi Tom,

    We are using EVM directly as our set-up. We're connecting the SPI signals from LMP90100 board to our microcontroller.  Connections seem to be fine since we are able to see voltage levels at GPIO pins of LMP90100 board.

    However, we are not able to read data from ADC registers. We are concerned whether our initialization for the ADC is okay. Here's the excerpt from the code section -

    LM90100_Spi_Read_Write_Single_Value(TI_LMP90100_PWRCN_REG,0); //Active Mode

    //LM_90100_Spi_Writing_Address_Data(TI_LMP90100_CH_STS_REG,LM90100_Read_Ptr,1,SPI_READ); //Power Mode Control and Status
    //AUXCN
    LM90100_Spi_Read_Write_Single_Value(TI_LMP90100_ADC_AUXCN_REG,0x0A); //Config AuxChannel

    //Channel Config
    LM90100_Spi_Read_Write_Single_Value(TI_LMP90100_CH0_CONFIG_REG,0x41); //Config Channel Zero
    LM90100_Spi_Read_Write_Single_Value(TI_LMP90100_CH1_CONFIG_REG,0x41); //Config Channel One

    LM90100_Spi_Read_Write_Single_Value(TI_LMP90100_BGCALCN_REG,0x00); //Confif TI_LMP90100_BGCALCN_REG

    //Channel Input
    LM90100_Spi_Read_Write_Single_Value(TI_LMP90100_CH0_INPUTCN_REG,0x41); //Confif TI_LMP90100_CH0_INPUTCN_REG
    //LM90100_Spi_Read_Write_Single_Value(TI_LMP90100_CH1_INPUTCN_REG,0x41);

    //
    LM90100_Spi_Read_Write_Single_Value(TI_LMP90100_ADC_RESTART_REG,1); //REset the ADC Register
    // LM90100_Spi_Read_Write_Single_Value(TI_LMP90100_CH_SCAN_REG,0x70);
    lcd_cmd(_LCD_CLEAR);

    Please let us know if we above routine is okay.  After initialization, we are reading the registers of LMP90100, but nothing comes up.

    Appreciate your time and help.

    Regards,

    Arun Luthra

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Murali Srinivasa
    Posted by Murali Srinivasa
    on Dec 28 2012 06:49 AM
    Intellectual1065 points

    Hi Arun,

     LM90100_Spi_Read_Write_Single_Value(TI_LMP90100_CH_SCAN_REG,0x70); doesn't match with your first post and the latest and since this is related to configuration you can have this done outside the while loop.

    Can you confirm if DRDYB is pulsing ? You can bring out DRDYB on D6 and monitor it.

    Also, have you tested the function used for ADC data read on other registers? Please make sure there is no problem with read function.

    Regards,
    Murali 

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Murali Srinivasa
    Posted by Murali Srinivasa
    on Dec 28 2012 07:23 AM
    Intellectual1065 points

    Hi Arun,

    What is the reference resistor value that is used to generate reference ? I see that you are using Vref 2 which is muxed on Vin6 and Vin7.

    Regards,
    Murali 

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Arun Luthra1
    Posted by Arun Luthra1
    on Dec 28 2012 23:11 PM
    Prodigy40 points

    Hi Murali,

          Thanks for your replay!

          1. Related to the CH_SCAN_REG in my first post we had given the default as per mention the datasheet of LMP90100. After we are not getting the result we had just write 0x70 into  CH_SCAN_REG for ScanMode1 : One or more Channels single scan. Yes you are right we should not write this instruction into the while loop.

       2.  Related to the pulsing of DRDYB we had made the D6 as general purpose IO pin and we are toggling the D6 before reading the ADC.   

      3. We write to the PWRCN : Power control and status register and then read the value we are getting the same  result which confirm that our read function is working fine. 

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use