Sunteți pe pagina 1din 3

25/04/12

eZ430 - RF2500 I2C NOT WORKING - MSP430 Ultra-Low Power 16-bit Microcontroller …

QuestaèlacopiacachediGoogledihttp://e2e.ti.com/thread/534102.aspx.Èun'istantaneadellapaginavisualizzatail21apr201208:33:07GMT.Nel

frattempolapaginacorrentepotrebbeesserestatamodificata.Ulterioriinformazioni

Versionesolotesto

Ulterioriinformazioni Versionesolotesto Samples & Purchase Cart | Contact Us |
Samples & Purchase Cart
Samples & Purchase Cart

Samples & Purchase Cart

|

|

Contact Us

Contact Us

|

|

TI Worldwide : United States

TI Worldwide: United States

|

|

my.TI Login

my.TI Login

Samples & Purchase Cart | Contact Us | TI Worldwide : United States | my.TI Login
Samples & Purchase Cart | Contact Us | TI Worldwide : United States | my.TI Login
Samples & Purchase Cart | Contact Us | TI Worldwide : United States | my.TI Login
Samples & Purchase Cart | Contact Us | TI Worldwide : United States | my.TI Login
Samples & Purchase Cart | Contact Us | TI Worldwide : United States | my.TI Login

New Post

Search by part number or keyword

All Searches| my.TI Login New Post Search by part number or keyword TI Home > TI E2E

TI Home > TI E2E Community > Support Forums > Microcontrollers > MSP430™16-bit Ultra-Low Power MCUs > MSP430 Ultra-Low Power 16-bit Microcontroller Forum > eZ430 - RF2500 I2C NOT WORKING

TIE2E™Community

> eZ430 - RF2500 I2C NOT WORKING TIE2E™Community Join or Sign In with my.TI Login Details

Join or Sign In with my.TI Login

Details 123 Views Reply 1 Subscribers 2
Details
123 Views
Reply
1
Subscribers
2

Search Community

GO

GO

 
Reply 1 Subscribers 2 Search Community GO   Everything This Forum Advanced Search 155 days old

Everything

This Forum

Advanced Search

155 days oldGO   Everything This Forum Advanced Search Options Subscribe via RSS Send to friend Tags ADC10

Options

Subscribe via RSSEverything This Forum Advanced Search 155 days old Options Send to friend Tags ADC10 BSL CC430

Send to friendForum Advanced Search 155 days old Options Subscribe via RSS Tags ADC10 BSL CC430 CCE CCS

Search 155 days old Options Subscribe via RSS Send to friend Tags ADC10 BSL CC430 CCE

Tags

ADC10155 days old Options Subscribe via RSS Send to friend Tags BSL CC430 CCE CCS ez430

BSLdays old Options Subscribe via RSS Send to friend Tags ADC10 CC430 CCE CCS ez430 ez430-RF2500

CC430old Options Subscribe via RSS Send to friend Tags ADC10 BSL CCE CCS ez430 ez430-RF2500 Flash

CCESubscribe via RSS Send to friend Tags ADC10 BSL CC430 CCS ez430 ez430-RF2500 Flash I2C IAR

CCSSubscribe via RSS Send to friend Tags ADC10 BSL CC430 CCE ez430 ez430-RF2500 Flash I2C IAR

ez430via RSS Send to friend Tags ADC10 BSL CC430 CCE CCS ez430-RF2500 Flash I2C IAR launchpad

ez430-RF2500via RSS Send to friend Tags ADC10 BSL CC430 CCE CCS ez430 Flash I2C IAR launchpad

Flashto friend Tags ADC10 BSL CC430 CCE CCS ez430 ez430-RF2500 I2C IAR launchpad MCU microcontroller Microcontrollers

I2Cfriend Tags ADC10 BSL CC430 CCE CCS ez430 ez430-RF2500 Flash IAR launchpad MCU microcontroller Microcontrollers msp

IARTags ADC10 BSL CC430 CCE CCS ez430 ez430-RF2500 Flash I2C launchpad MCU microcontroller Microcontrollers msp 430

launchpadADC10 BSL CC430 CCE CCS ez430 ez430-RF2500 Flash I2C IAR MCU microcontroller Microcontrollers msp 430 MSP430

MCUBSL CC430 CCE CCS ez430 ez430-RF2500 Flash I2C IAR launchpad microcontroller Microcontrollers msp 430 MSP430 MSP430

microcontrollerCC430 CCE CCS ez430 ez430-RF2500 Flash I2C IAR launchpad MCU Microcontrollers msp 430 MSP430 MSP430 microcontroller

Microcontrollersez430-RF2500 Flash I2C IAR launchpad MCU microcontroller msp 430 MSP430 MSP430 microcontroller MSP430F2274

msp 430Flash I2C IAR launchpad MCU microcontroller Microcontrollers MSP430 MSP430 microcontroller MSP430F2274 MSP430F5438

MSP430IAR launchpad MCU microcontroller Microcontrollers msp 430 MSP430 microcontroller MSP430F2274 MSP430F5438 MSP430F5xxx

MSP430 microcontrollerMCU microcontroller Microcontrollers msp 430 MSP430 MSP430F2274 MSP430F5438 MSP430F5xxx MSP430x2xx SPI UART USB

MSP430F2274Microcontrollers msp 430 MSP430 MSP430 microcontroller MSP430F5438 MSP430F5xxx MSP430x2xx SPI UART USB USCI

MSP430F5438msp 430 MSP430 MSP430 microcontroller MSP430F2274 MSP430F5xxx MSP430x2xx SPI UART USB USCI

MSP430F5xxx430 MSP430 MSP430 microcontroller MSP430F2274 MSP430F5438 MSP430x2xx SPI UART USB USCI

MSP430x2xxMSP430 microcontroller MSP430F2274 MSP430F5438 MSP430F5xxx SPI UART USB USCI MSP430™16­bitUltra­LowPowerMCUs

SPIMSP430F2274 MSP430F5438 MSP430F5xxx MSP430x2xx UART USB USCI MSP430™16­bitUltra­LowPowerMCUs Welcome to

UARTMSP430F2274 MSP430F5438 MSP430F5xxx MSP430x2xx SPI USB USCI MSP430™16­bitUltra­LowPowerMCUs Welcome to the

USBMSP430F2274 MSP430F5438 MSP430F5xxx MSP430x2xx SPI UART USCI MSP430™16­bitUltra­LowPowerMCUs Welcome to the

USCIMSP430F2274 MSP430F5438 MSP430F5xxx MSP430x2xx SPI UART USB MSP430™16­bitUltra­LowPowerMCUs Welcome to the

MSP430F5438 MSP430F5xxx MSP430x2xx SPI UART USB USCI MSP430™16­bitUltra­LowPowerMCUs Welcome to the

MSP430™16­bitUltra­LowPowerMCUs

Welcome to the MSP430™16-bit Ultra-Low Power MCUs Section of the TI E2E Support Community. Ask questions, share knowledge, explore ideas, and help solve problems with fellow engineers. To post a question, click on the forum tab then "New Post".

Discussion on MSP430™16-bit Ultra-Low Power Microcontrollers.

25/04/12

eZ430 - RF2500 I2C NOT WORKING - MSP430 Ultra-Low Power 16-bit Microcontroller …

 
 
Get this RSS feed

Get this RSS feed

 

Home

eZ430­RF2500I2CNOTWORKING

Announcements

 
 

Forum rated by 0 users

 
2 Followers

2

Followers

 

Reply |

Reply | 1 Design Notes

1

Design Notes

 
Po sted by Nelson Pina on 18 Nov 2011 12:21 PM Prodigy 10 Points

Posted by Nelson Pina on 18 Nov 2011 12:21 PM

Po sted by Nelson Pina on 18 Nov 2011 12:21 PM Prodigy 10 Points

Prodigy 10 Points

Hello everyone,

I'm using the eZ430 - RF2500 development kit, and i need to interface one Humidity sensor (SHT25) with the MSP430F2274.

 

I'm trying for 2 weeks now, and I'm not able to communicate with the sensor. The same sensor works fine with Renesas micro controller, so the problem is really with the MSP430F2274 micro.

I have the 2 pull-up resistors (10K Ohm), and I always get trapped in the cycle that verifies the ACK of the START CONDITION. Another thing that i notice is that the SCL and the SDA lines are not with the same tension, SCL with 2.9V and SDA with 1.9V. Before the START they should be booth in hight level right?

 

My code is simple this for trying to get the ACK from the sensor, and i never pass the "while(UCB0CTL1&UCTXSTT);" condition, the sensor never send the ACK:

 

voidmain(void)

{

WDTCTL=WDTPW+WDTHOLD;

 

BCSCTL1=CALBC1_8MHZ;

DCOCTL=CALDCO_8MHZ;

/*ConfigureI2C*/

 

P3DIR|=0x0F;

P3SEL|=BIT2|BIT1

 

UCB0CTL1|=UCSWRST

UCB0CTL0=UCMST+UCMODE_3+UCSYNC;

UCB0CTL1=UCSSEL_2+UCSWRST;

UCB0BR0=0x50

 

UCB0BR1=0;

UCB0I2CSA=0x80;

 

UCB0CTL1&=~UCSWRST;

IE2=UCB0TXIE+UCB0RXIE;

/*TransmitData*/

UCB0CTL1|=UCTR;

UCB0CTL1|=UCTXSTT;

while(UCB0CTL1&UCTXSTT);

UCB0TXBUF=0xFF;

while(UCB0TXIFG==0);

UCB0CTL1|=UCTXSTP;

}

If anyone can please analyse this and help me I will be very thankful,

 
 

Best Regards,

Nelson Pina

I2C, MSP430 microcontroller, MSP430F2274, msp 430

 
 
Reply

Reply

25/04/12

eZ430 - RF2500 I2C NOT WORKING - MSP430 Ultra-Low Power 16-bit Microcontroller …

WORKING - MSP430 Ultra-Low Power 16-bit Microcontroller … {0} All Replies Po sted by Jens-Michael Gross
{0} All Replies
{0}
All Replies
Ultra-Low Power 16-bit Microcontroller … {0} All Replies Po sted by Jens-Michael Gross replied on 21
Po sted by Jens-Michael Gross replied on 21 Nov 2011 7:49 AM Guru 82385 Points

Posted by Jens-Michael Gross replied on 21 Nov 2011 7:49 AM

Po sted by Jens-Michael Gross replied on 21 Nov 2011 7:49 AM

Guru 82385 Points

 
  Nelson Pina:

Nelson Pina:

never pass the "while(UCB0CTL1&UCTXSTT);" condition, the sensor never send the ACK:

 

If the slave doesn't ACK, the USCI will continue, clear UCSTT and set UCNACKIFG.

If UCSTT doesn't get cleared, there is only one reason: the I2C clock is suspended for some reason. Ther eare two possible resones: 1) the clock source of the USCI is not running (e.g. SMCLK is stopped) or 2) the I2C SCL lien is held low (clock stretching). If SCL is low, this may be because of a missing pullup, a port pin misconfiguration or because the slave holds it low (e.g. because it is not ready yet for the transfer, 'hold master' feature of some slaves, generally called 'clock stretching').

 

Pullups are there, as you say, port configuration looks right (P3.1/P3.2). SMCLK should be running from DCO (8MHz), I2C clock is 100MHz then.

 

There is, however, something completely different:

 

You set UCB0TXIE and UCB0RXIE. THis measn, when TXBUF is empty or RXBUF is full an interrupt is triggered. Yet you don't seem to have an ISR nor do you need one (you do the job in polling mode).

 

So the moment you set UCSTT, UCB0TXIFG is set and an itnerrupt is triggered. A breakpooint on teh while loop will be triggered because it is triggered the very moment UCSTT is set and the interrupt occurs. But then the ISR is called, the processor jumps into the wild (there is no ISR), and the while is never executed at all. Instead the MSP will eventually reset due to vacant memory violation or such.

In addition, the next while is a NOP. UCB0TXIFG is a constant and has a value <>0, the the while will always immediately end.

 

The correct loop test is while(!(IFG2&UCB0TXIFG)); However, in your test code, UCTXBUF is almost instantly empty agian after you pushed 0xff to it, because you wait for UCSTT beign clear before you write to it, so its content can immediately be forwarded to the output shift register. So the while loop will exit anyway (even if the correct one is used) in this case, and the code would work. But you'd run into trouble when you try to expand it later.

Before posting bug reports or ask for help, do at least quick scan over this article about reporting bugs. Its content applies to any kind of problem reporting. If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then 'start conversation'. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too.

 
   
   
   
 
rated by 0 users

rated by 0 users

it (or contribute to it) too.     rated by 0 users   Reply {0} Jens-Michael
 
  Reply

Reply

{0}

{0}

Jens-Michael Gross

Jens-Michael Gross

Answered (Not Verified)

Answered (Not Verified)

Page 1 of 1 (2 items)

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.

Products | Applications | Design Support | Sample & Buy

| Applications | Design Support | Sample & Buy TI Worldwide | About TI | Contact

TI Worldwide | About TI | Contact Us | Investor Relations | Press Center | Corporate Citizenship | Careers | Tags | my.TI Login | All Searches | Site Map

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