Jump to content
johng

Porting Arduino Library

Recommended Posts

Hello All,

I'm an electronics engineering student and I know little about programming.I was using arduino and I want to use TI MCU's. So for that reason I'm recreating my arduino projects on energia (tried code composer studio but it is too complicated for me). Some of my projects worked well on energia and i didn't make any changes of my codes it was wonderful but my end term project didn't compiled because of the library that i'm using so  I'm trying to port a library from arduino to energia. The library that i'm trying to port is based on the SoftwareSerial library (formerly NewSoftSerial), authored by: ladyada (http://ladyada.net),Mikal Hart (http://www.arduiniana.org),Paul Stoffregen (http://www.pjrc.com),Garrett Mace (http://www.macetech.com), Brett Hagman (http://www.roguerobotics.com/) and it uses pin change interrupts. the library that i'm trying to port energia uses digitalPinToPCMSK and digitalPinToPCICR macros from the pins_arduino.h

I was successful running this library on arduino but i cannot get it to work on energia.

The error I'm gettin when i try to compile the code is;

error: 'digitalPinToPCICR' was not declared in this scope

'error: digitalPinToPCMSK' was not declared in this scope

it is going like this.

The library i want to port from arduino is Arduino-SDI-12 created by Kevin M. Smith,   S. Hicks and their team members the library is located at github (link: https://github.com/EnviroDIY/Arduino-SDI-12 ). 

What should I do to make it work? Any help will be appreciated.

Thanks in advance,

I'm using

  • LaunchPad MSP-EXP430G2 v1.5
  • MCU MSP430G2553
  • Windows 10 PC and Energia 1.6 10E18 IDE

Share this post


Link to post
Share on other sites
4 hours ago, johng said:

I'm using

  • LaunchPad MSP-EXP430G2 v1.5
  • MCU MSP430G2553
  • Windows 10 PC and Energia 1.6 10E18 IDE

Using the msp430g2553 is just an exercise in frustration if you want to do arduino stuff. It has a lot less memory than an atmega328p (2k) vs msp430g2553 (512b). It also has less flash (32k) vs (16k).  You would be better off getting one of the newer FRAM launchpads that aren't resource and peripheral deficient.

In addition, the Energia support for the launchpad g2 has been put on autopilot and never gets any fixes.

 

Share this post


Link to post
Share on other sites

Hello,

I would like to thank @Rei Vilo and @Rickta59 their valuable answers.

@Rei Vilo now I'm studying the resources that you shared. Thank you again.

 

13 hours ago, Rickta59 said:

Using the msp430g2553 is just an exercise in frustration if you want to do arduino stuff. It has a lot less memory than an atmega328p (2k) vs msp430g2553 (512b). It also has less flash (32k) vs (16k).  You would be better off getting one of the newer FRAM launchpads that aren't resource and peripheral deficient.

In addition, the Energia support for the launchpad g2 has been put on autopilot and never gets any fixes.

 

 

@Rickta59 the reason I chose the launchpad g2 is it was on sale and I thought it is a goodway to switch and learn MSP430 series. You said memory maybe not sufficient on msp430g2553 for my project on the arduino my sketch uses 15196 bytes of program storage space and global variables use 503 bytes of dynamic memory. Hence, msp430g2553 has 512byte ram and 16k flash i'm thinking my project would fit on to it. But my problem is not memory right now if I get the library work maybe I can reduce memory usage.

Does energia check memory allocation while it is compiling the program?

 

Share this post


Link to post
Share on other sites

Energia does some static analysis of the flash and ram size. The Energia/Arduino feature only warns you when you use > 70% of resources.  If you actually use too much flash or static ram the linker will spew an error.  However, this won't give you any indication at runtime that you have run out of ram. 

Share this post


Link to post
Share on other sites

@Rickta59 Thank you for your kind answer. Now I'm not getting any warning related to memory on IDE. I'm getting error related to pin change interrupt.

Now I'm looking for a solution how can I fix this issue. 

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

×