Jump to content
43oh

I2C channels in Stellaris


Recommended Posts

As known LM4F120H5QR has 4 channel I2C.

How to set channel number when writing sketch for Energia?

 

I tried to find Wire.c for lm4f to look at realization, but without success.

 

Need for interface betwwen LM4F and BMP085. For MSP430 work fine.

 

Sorry my terrible English  :huh:

Link to post
Share on other sites

Use `setModule()` as described in https://github.com/energia/Energia/blob/master/hardware/lm4f/libraries/Wire/Wire.cpp#L599


 

void setup() { 
  Wire.setModule(3); 
  Wire.begin(); 
  ... 
}

Similar logic applies for UART and SPI.

 

As an alternative, declare the variable as in https://github.com/energia/Energia/blob/master/hardware/lm4f/libraries/Wire/Wire.cpp#L161

 

TwoWire Wire2(2);
Link to post
Share on other sites
  • 1 month later...

Is there any RTC liberary for Energia. so i can use to read and Write RTC date and time.

 

please let me know how I2c address being specified

 

 

 

 

 

 

Use `setModule()` as described in https://github.com/energia/Energia/blob/master/hardware/lm4f/libraries/Wire/Wire.cpp#L599

 

void setup() { 
  Wire.setModule(3); 
  Wire.begin(); 
  ... 
}

Similar logic applies for UART and SPI.

 

As an alternative, declare the variable as in https://github.com/energia/Energia/blob/master/hardware/lm4f/libraries/Wire/Wire.cpp#L161

 

TwoWire Wire2(2);

 

Link to post
Share on other sites
  • 1 year later...

hibRTC.ino.zip

 

Hi,

 

The libraries suggested are for tm4c1294 and should be used only with this micro controller. This is due to a special hardware (new), implemented in micro and which departs that one used in tm4C123.

As noted, there is a bug in driverlib when you need to use the year and day of the week. The attached file highlight the place where the bug is and shows a correction:

 

 

 

Link to post
Share on other sites
  • 2 weeks later...

attachicon.gifhibRTC.ino.zip

 

Hi,

 

The libraries suggested are for tm4c1294 and should be used only with this micro controller. This is due to a special hardware (new), implemented in micro and which departs that one used in tm4C123.

As noted, there is a bug in driverlib when you need to use the year and day of the week. The attached file highlight the place where the bug is and shows a correction:

 

i´m sorry i will update this to tm4c123 but i haven't realy had time. Gona try next week.

 

It's a simple tweak so maybe if i get to anoyed at my exams i'll do it today 

 

ps: you haven't attatched any file for the bug

Link to post
Share on other sites

Hi L.R.A,

The bug refers only on "calendar" mode on 129 micro controller. TM4C123 does not need that, because the calendar register does not exist there, so you do not need to modify something.

As for "file for the bug" - yes I did not filed it - the bug is described in hibRTC.ino file, at the beginning - I used your file and just made modifications/updates and checked it out. 

Regards,

L

Link to post
Share on other sites

Hi L.R.A,

The bug refers only on "calendar" mode on 129 micro controller. TM4C123 does not need that, because the calendar register does not exist there, so you do not need to modify something.

As for "file for the bug" - yes I did not filed it - the bug is described in hibRTC.ino file, at the beginning - I used your file and just made modifications/updates and checked it out. 

Regards,

L

 

Yes i know that TM4C123 doesn't have it :P

 

got to see that update the file in the libraries to fix that bug

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...