1
\$\begingroup\$

I am working on a project that uses msp430G2553 as the main microcontroller. I bought an LCD from here https://www.adafruit.com/product/2088 but its libraries are all written for Arduino. Has anyone had the experience of rewriting the Arduino library code to adapt to msp430? Or more generally, how should I modify the libraries to adapt to msp430? Thank you very much!

\$\endgroup\$
2
  • \$\begingroup\$ This is difficult thing to answer because it depends in the quality of code of the library, if the library is high quality code and layered properly you would only have to modified to bottom layer of the code dealing with the physical interface to the LCD. If the code if not very well layered you might rewrite several parts or all of the library. \$\endgroup\$ – Kvegaoro Apr 18 '17 at 18:14
  • 3
    \$\begingroup\$ Have you tried using Energia yet? \$\endgroup\$ – Ignacio Vazquez-Abrams Apr 18 '17 at 19:13
1
\$\begingroup\$

The device you point to has a 4-wire serial interface. There is bound to be a library for MSP430 to deal with that (and SPI is the easiest interface to bit-bang, if it comes down to that).

In general, porting a small library to another platform is not too much of a problem for someone who understands both platforms. If you don't understand either platform, it will be very difficult. If you understand one platform, it will be less difficult (knowing the target platform will probably ease the way more than knowing the original platform), and knowing both platforms well will make the job go quickest.

Adafruit says:

The code is written for Arduino but can be easily ported to your favorite microcontroller!

This leads me to believe that the code may be well-documented enough for you to follow. They didn't say "any" microcontroller, they said "your favorite". Knowing and understanding the platform you're programming on goes without saying.

Depending on why you're taking this on, and how well you know the MSP430 (I'm guessing not very well) sticking to a 430 platform where you can use Arduino code, as Ignacio suggested in comment to your question, is probably your best bet.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.