• 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 » Interface » /etc... Interface » Other Interface Forum » LMP91000 I2C and PIC Microcontroller
Share
/etc... Interface
  • Forums
Options
  • Subscribe via RSS

Check out
Analog Wire blog

  • $core_v2_blog.Current.Name

    RS-485 - Who says you can't teach an old dog new tricks?

    Posted 3 days ago
    by Neel Seshan
    Would you agree that RS-485 has turned out to be one of the most versatile communication standards when it comes to industrial...
  • $core_v2_blog.Current.Name

    Filter for thought

    Posted 4 days ago
    by Soufiane Bendaoud
    Have you ever wondered how engineers designed active filters before the birth of software? They were able to do it using nomographs...

LMP91000 I2C and PIC Microcontroller

LMP91000 I2C and PIC Microcontroller

This question is not answered
Darren Valantine
Posted by Darren Valantine
on Mar 19 2012 13:46 PM
Prodigy10 points

I am trying to interface the LMP 91000 evaluation board with a Microchip 16F877 microcontoller.

I have tried the built-in I2C functions but can not get an Ack for the 9th bit. Using a scope the SDA line stays around 1.8V for the Ack bit.

I have also tried programming the MENB, SDA and SCL directly, here the SDA stays low when I convert the PIN from output to input until the SCL line drops for the 9th bit then the SDA line climbs anywhere from 1 V to 5V for around 9 micro-seconds. (see scope picture for fixed unti addr 1001000+0 for a write)

Is this an Ack or Nack response? From the timings section the ACK is valid from the drop of the SCL line for a max of 3.45 us (does not specifiy a min time).

LMP91000
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • juan camarasa
    Posted by juan camarasa
    on Mar 23 2012 15:15 PM
    Prodigy215 points

    Hi Darren,

    i try to do the same, but i use the msp430f2274 with LMP 91000. http://www.ti.com/product/LMP91000#technicaldocuments

    In two msp430f2274 the i2c code it working  but when i connet the lmp91000 i can't see the Ack or Nack response.

    this is parts of the code

    ......
    while(1){
     
        // minb ____                                                         ________ P1OUT = 0x01;
        //                   |_________________________|                   P1OUT &=~0x01;
     
            switch(i) {
              
        case 1://  (direc) lock=0x01, (data)  unlock=0x00
              P1OUT &=~0x01;
              
              address=0x48;
              MSData=0x01;
           
              Setup_TX();
              RPT_Flag = 1;
              Transmit();
              while (UCB0CTL1 & UCTXSTP);             // Ensure stop condition got sent
             
              //Receive process
              Setup_RX();
              Receive();
              RXdato[0]=UCB0RXBUF;
              while (UCB0CTL1 & UCTXSTP);             // Ensure stop condition got sent
              i=i+1;
              P1OUT = 0x01;
              break;
              
       case 2: // TIACN =0X10, data=18 ( GAIN=110=>120K , Rload=00=>10 ohm)
         
              P1OUT &=~0x01;
              
              address=0x48;
              MSData=0x00;
              
              Setup_TX();
              RPT_Flag = 1;
              Transmit();
              while (UCB0CTL1 & UCTXSTP);             // Ensure stop condition got sent
            
              //Receive process
              Setup_RX();
              Receive();
              RXdato[1]=UCB0RXBUF;
              while (UCB0CTL1 & UCTXSTP);             // Ensure stop condition got sent
              i=i+1;    
              P1OUT = 0x01;
              
              break;

    .....................................

    //***********************************SETUP TX + TRANSMIT **************
    }

    void Setup_TX(void){
     // _DINT();
      RX = 0;
      IE2 &= ~UCB0RXIE;
      while (UCB0CTL1 & UCTXSTP);               // Ensure stop condition got sent// Disable RX interrupt
      UCB0CTL1 |= UCSWRST;                      // Enable SW reset
      UCB0CTL0 = UCMST + UCMODE_3 + UCSYNC;     // I2C Master, synchronous mode
      UCB0CTL1 = UCSSEL_2 + UCSWRST;            // Use SMCLK, keep SW reset
      UCB0BR0 = 12;                             // fSCL = SMCLK/12 = ~100kHz
      UCB0BR1 = 0;
      UCB0I2CSA = address;                         // Slave Address is 048h
      UCB0CTL1 &= ~UCSWRST;                     // Clear SW reset, resume operation
      IE2 |= UCB0TXIE;                          // Enable TX interrupt
    }
     
    void Transmit(void){
        PTxData = &MSData;                      // TX array start address
        TXByteCtr = NUM_BYTES_TX;                  // Load TX byte counter
        while (UCB0CTL1 & UCTXSTP);             // Ensure stop condition got sent
        UCB0CTL1 |= UCTR + UCTXSTT;             // I2C TX, start condition
        __bis_SR_register(CPUOFF + GIE);        // Enter LPM0 w/ interrupts
        }

    //*********************************** SETUP RX + RECEIVE **************

    void Setup_RX(void){
      _DINT();
      RX = 1;
      IE2 &= ~UCB0TXIE;
      UCB0CTL1 |= UCSWRST;                                                 // Enable SW reset
      UCB0CTL0 = UCMST + UCMODE_3 + UCSYNC;         // I2C Master, synchronous mode
      UCB0CTL1 = UCSSEL_2 + UCSWRST;                       // Use SMCLK, keep SW reset
      UCB0BR0 = 12;                                                          // fSCL = SMCLK/12 = ~100kHz
      UCB0BR1 = 0;
      UCB0I2CSA = address;                                                 // Slave Address is 048h
      UCB0CTL1 &= ~UCSWRST;                                     // Clear SW reset, resume operation
      IE2 |= UCB0RXIE;                                                  // Enable RX interrupt
    }

    void Receive(void){
        PRxData = (unsigned char *)RxBuffer;    // Start of RX buffer
        RXByteCtr = NUM_BYTES_RX-1;              // Load RX byte counter
        while (UCB0CTL1 & UCTXSTP);             // Ensure stop condition got sent
        UCB0CTL1 |= UCTXSTT;                    // I2C start condition
        __bis_SR_register(CPUOFF + GIE);        // Enter LPM0 w/ interrupts
    }

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

    If anyone has an idea of what the problem could be I would really apreciate it.

     

    Thanks,

    Juan



    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Domenico Granozio
    Posted by Domenico Granozio
    on Apr 17 2012 09:02 AM
    Intellectual970 points

    Hi Darren,

    the LMP91000 eval board is provided wiht a I2C level shift. So if you do not receive any ACK or NACK the reaosn is that the Level Shift is not biased.

    In order to make it working  apply to the GPSI16.13 pin the same voltage you have applied to the VDD pin of the LMP91000.

    Please refer to the conenction diagram in page 6 of the Application NOTE AN-2230 (http://www.ti.com/lit/an/snaa138a/snaa138a.pdf)

    Best regards,

    Domenico

     

    Darren Valantine

    I am trying to interface the LMP 91000 evaluation board with a Microchip 16F877 microcontoller.

    I have tried the built-in I2C functions but can not get an Ack for the 9th bit. Using a scope the SDA line stays around 1.8V for the Ack bit.

    I have also tried programming the MENB, SDA and SCL directly, here the SDA stays low when I convert the PIN from output to input until the SCL line drops for the 9th bit then the SDA line climbs anywhere from 1 V to 5V for around 9 micro-seconds. (see scope picture for fixed unti addr 1001000+0 for a write)

    Is this an Ack or Nack response? From the timings section the ACK is valid from the drop of the SCL line for a max of 3.45 us (does not specifiy a min time).

    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