Jump to content
43oh

Can I use libraries written for Arduino with Energia?


Recommended Posts

Hello,

 

I got a graphics library from

 

http://www.henningkarlsen.com/electronics/library.php?id=51

 

and tried to install it with Energia

but I could not compile any sample program (msp430 board nor Stellaris).

 

Either installing original libraries from Arduino (there it works fine) isnt possible at all ??!?!??

or there is a problem with paths cause libraries at Arduino have to be

installed in another directory (i.e. c:\Arduino\libraries  vs.  c:\Energia\hardware\msp430\libraries)

than in Energia.

 

Trying to use that graphic library I allways get errors like that:

 

"bitmapdattype is not declared".

 

Its also tracking attention that it shows strange combinations of slash and backslash

in the path of the UTFT.h file like this:

 

c:\energia\hardware\msp430\libraries\UTFT /UTFT.h

 

Can anybody help?

 

Thanks a lot (I'm new with that kind of stuff)

Link to post
Share on other sites

Running Arduino libraries on MSP430 or Stellaris will work as long as the libraries do not use anything specific to the chip. e.g. if a library used AVR specific registers then it won't run on the MSP430. If the library however uses only Arduino API's then there is a good chance that it will run on MSP430 or Stellaris without problems.

 

This library is written to run on multiple platforms and abstracted through a HAL (Hardware Abstraction Layer) for each specific chip. Unfortunately there is no abstraction layer for the MSP430 or Stellaris and you would have to write one yourself.

Link to post
Share on other sites

Hello,

 

I was wondering about this quesiton as well -- there's this LED Control library I'd like to use: http://playground.arduino.cc/Main/LedControl for an LED Matrix. It provides some demo code as well and I've changed the pins to match with MSP430's, but I can't seem to get anything to light on the matrix. It'd be cool if I could even get one to light, just so I know it works. Looking over the code, it doesn't seem like there are any specific chip references that I would need to change, but since I'm just starting out experimenting with Energia and LaunchPad myself, I really am not sure what the issue is.

 

I'd appreciate any insight on this. Thanks for your help.

Link to post
Share on other sites

Yeah, it'd be great if this library can actually work out.

 

The code for lighting one LED should be relatively simple using the library, but not seeing any results (basically for anything from the library).  Just as a quick reference here's the short code:

 

#include <LedControl.h>

LedControl lc=LedControl(P1_7, P1_5, P2_7, 1);

 

void setup(){

lc.shutdown(0,false);
  /* Set the brightness to a medium values */
  lc.setIntensity(0,8);
  /* and clear the display */
  lc.clearDisplay(0);

}
 

void loop(){
 //turn on one LED
  lc.setLed(0,2,5,true);

}

 

Any suggestions on tracking the problem? I keep looking over the library and trying to see what might be specific for Arduino, but with my limited knowledge it seems that the library should work out..

Link to post
Share on other sites

Hello,

 

I was wondering about this quesiton as well -- there's this LED Control library I'd like to use: http://playground.arduino.cc/Main/LedControl for an LED Matrix. It provides some demo code as well and I've changed the pins to match with MSP430's, but I can't seem to get anything to light on the matrix. It'd be cool if I could even get one to light, just so I know it works. Looking over the code, it doesn't seem like there are any specific chip references that I would need to change, but since I'm just starting out experimenting with Energia and LaunchPad myself, I really am not sure what the issue is.

 

I'd appreciate any insight on this. Thanks for your help.

That library is designed around the MAX7219/22 which are 5v devices. Although many 5v devices will accept 3.3v logic inputs, the data sheet for the 7219/22 says they require 3.5v for a high input. Even on the maximum 3.6v VCC the 430 can't drive its outputs that high, so you will need some form of buffer to turn the 3v logic into 5v logic. One option might be using a cd4050 buffer.
Link to post
Share on other sites
  • 6 months later...

That library is designed around the MAX7219/22 which are 5v devices. Although many 5v devices will accept 3.3v logic inputs, the data sheet for the 7219/22 says they require 3.5v for a high input. Even on the maximum 3.6v VCC the 430 can't drive its outputs that high, so you will need some form of buffer to turn the 3v logic into 5v logic. One option might be using a cd4050 buffer.

 

What if you  use an AS1106? This chip is pin and command compatible with MAX7219/21 but can operate at 3.3V (from 2.7 to 5.5).

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...