Jump to content
duyk0110

I2C Device at any address LM4F120

Recommended Posts

Hey guys.

I'm learning I2C protocol and practicing with LM4F120 board, I'm using DS1307 as the I2C device. I tried to scan for the I2C device first but found I2C device at any address.

I did checked my wire connection, my I2C setModule(), etc but still.

This does not happen with Arduino

Please help me out. Thank you

 

Here's the code. I use Energia.

i2c_scanner.ino

Share this post


Link to post
Share on other sites

First of all, welcome to the forum.

 

Are you using pull up resistors on the SDA and SCL lines?  If so, have you looked at the output with a logic analyzer or scope to ensure that the data is actually being sent from your launchpad? If it is being sent, do the packets look as they should?  You may also want to verify that you are using the correct I2C module pins (pins 9 and 10 for I2C module 1).

Share this post


Link to post
Share on other sites

@@Rei Vilo there's the VBUS pin on the LM4F120 which is 5V according to the user manual

@@dubnet yes, there's a 10k res on each SDA and SCL line. But I did not check the output so I'm not sure about the data being sent

 

I think it's the board that need some adjustments. As I mentioned earlier the Arduino worked fine. Arduino has only 1 I2C port. The Launchpad has 4. So that might need some closer configuration for the Launchpad's port?

Share this post


Link to post
Share on other sites

First, you will need to address the voltage differential between the two devices.  @@Rei Vilo 's second link above has some really good info on this.

 

Also, 10K my be too large for the pull ups but you will need to address the voltage differential before you can experiment with the values.

Share this post


Link to post
Share on other sites

hi - although I'm a bit late to this thread...

 

 

Regarding +5 volt operation on the LM4F120 I/O pins...    Specifically the LM4F on the 'old' Stellaris Launchpad.....

 

I have followed the data sheet explicitly where it states that certain of the I/O pins are 5volt tolerant on input. I have not damaged anything by reading 5volt input signals to the chip.  I cannot measure anything to confirm it is true, however; I just trusted the data sheet.

 

The data sheet I'm using is  :   DS-LM4F120H5QR-13200.2535  SPMS294G, starting in Chapter 10.

 

And, in section 10.1 :

All GPIO signals are 5-V tolerant when configured as inputs
except for PD4, PD5, PB0 and PB1, which are limited to 3.6 V

 

I'd be very curious if someone else has successfully used this for I2C which uses pull-up resistors (+-3 K ohms) to a +5volt bus.

 

 

Cheers..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×