Jump to content

  • Log In with Google      Sign In   
  • Create Account

Photo

MSPhere - Arduino-like framework of functions for the MSP430


  • Please log in to reply
37 replies to this topic

#1 gatesphere

gatesphere

    Level 3

  • Members
  • 430 posts

Posted 25 August 2010 - 06:23 AM

Hello all,

If you've been reading my posts, you might have heard me mention a framework I've been working on for the MSP430 to bring the Arduino functions and programming paradigm to the MSP430--in particular the LaunchPad and compatible devices. Note that this is not a direct port of the Arduino libraries, but original work with a few code snippets whose basic functionality is the same on both architectures littered in.

Well, I've made some progress, and thought I'd start this thread about it. I will update this first post as time goes on, linking all of my blog articles to this post, and eventually my code.

Current news is on my blog as always, but here's a post list:
Introductory post - in which I detail the first steps of my work, potential future trajectory, and explain the name a bit. (Thanks NJC!)
Update 1 - in which I announce the wiki and homepage for the framework.
Update 2 - in which I lay bare my progress towards an initial release.

Anyone is welcome to contribute anything they wish, and it will be released under the GNU GPLv3 when it's been completed a bit more.

EDIT 26August2010: I have started a wiki section for this framework. It is available here.
EDIT 31August2010: I have posted a small homepage for the framework. It contains useful links. It is available here.
EDIT 08September2010: I have posted an update to the blog enumerating how far I've come with it, and which hurdles lie ahead before an initial release. Link above, see "Update 2".
  • bluehash likes this
MSPhere - a framework of functions for rapid prototyping with the LaunchPad platform
My other pages: home page/portfolio || development blog

#2 jsolarski

jsolarski

    Level 3

  • Members
  • 525 posts
  • LocationChicago IL

Posted 25 August 2010 - 07:20 AM

I would love to see the header files you have created. And i may have some more functions once i finish a servo interface and figure a way to do Software PWM, I have a few odds and ends that hopefully will be finished soon.
and Math functions always seem to take a good chunk of memory from what i have seen, so maybe separate out the math functions and put them in a separate Header

#3 bluehash

bluehash

    Site Admin

  • Administrators
  • 5,308 posts

Posted 25 August 2010 - 12:05 PM

Current news is on my blog as always, but here's a post list:
Introductory post - in which I detail the first steps of my work, potential future trajectory, and explain the name a bit. (Thanks NJC!)


This is really good news. I'll update the main blog later today. Let us know when you are ready with your first release.

Stellarisiti - Join the new Tiva-C/Stellaris ARM Forums discussing Tiva-C(Stellaris) Microcontrollers.

C2kCentral - C2000 News, Projects and Forums
43oh - MSP430 Discussion, News, Projects and Hacks
MachineGrid - Robots, Hacks and Technology!


#4 Sean

Sean

    Member

  • Members
  • PipPip
  • 14 posts

Posted 25 August 2010 - 12:27 PM

Please don't, I think it would take away too much from the learning experience.
I want your/others knowledge on how to do something, not code that just does it.
I like seeing the individual projects/tutorials/blogs/detailed code.
I'd like to see a more centralized community based wiki of that with tutorials/projects/howtos/codebase where the author can detail & explain how to do something and/or how their project/code works, with a q&a section for the community to ask questions/fill in missing gaps/refer to other pages/tutorials, at least that's what I was kind of hoping for when I ordered my launchpads. It can start as a simple searchable archive of the projects that are put on the front page, to preserve them.

There's also the arduino, amicus 18, 18fx550(pinguino/cui/bitwacker/etc), etc,
Can this just be the msp430 that we can take what we learn to the next platform instead of waiting/begging for someone to write a new/similar framework for?
(please delete if double posted)

#5 gatesphere

gatesphere

    Level 3

  • Members
  • 430 posts

Posted 25 August 2010 - 02:50 PM

@Sean: This isn't being written in the attempt to destroy original coding efforts. I myself will probably never use this framework for my own purposes. I just want to help others along who are having problems. It's way too much overhead to be practical as anything other than an introduction, at least concerning the low-end chips we have now. And it's going to be open source, so the people who want to learn from it will be able to open it up and figure out how the code is working.

@bluehash: Sweet! I was kind of hoping I'd be featured :) Don't expect a release too soon though, classes are starting up again on Monday, which means I'll have next to zero free time. But I'll work on it when I have the chance.

@jsolarski: There are currently three modules in the framework: msphere.h, msphere_digital_io.h, and msphere_math.h. Your functions will be warmly welcomed once you have them written up. You just supply the code, and I'll format them to work with MSPhere :)
MSPhere - a framework of functions for rapid prototyping with the LaunchPad platform
My other pages: home page/portfolio || development blog

#6 Sean

Sean

    Member

  • Members
  • PipPip
  • 14 posts

Posted 25 August 2010 - 06:22 PM

That's the problem though it will create a user base who's knowledge centers around how to use your framework and not on the effort/knowledge that you put into creating that framework.
I like the direction that is currently happening where larger projects are being broken down into basic steps/tutorials, most of that will stop and instead start to center around using/learning your framework.

#7 gatesphere

gatesphere

    Level 3

  • Members
  • 430 posts

Posted 25 August 2010 - 07:16 PM

If you don't want to use it, then don't. I'm not going to. I'm not going to encourage it's use either. It's simply going to be an open source collection of functions which people can use if they need to, or modify to fit their needs. I'm sorry if you don't like the idea, but it's not like I'm trying to force it upon the community as a whole. It's just an option, to be there if they want to use it. I don't honestly see a large community forming around this framework compared to coding with straight C code. With tutorials like NJC's and beretta's, straight C is very accessible, and much more robust than this framework will ever be.
MSPhere - a framework of functions for rapid prototyping with the LaunchPad platform
My other pages: home page/portfolio || development blog

#8 bluehash

bluehash

    Site Admin

  • Administrators
  • 5,308 posts

Posted 25 August 2010 - 07:39 PM

To be honest, having a library always helps. This helps me getting on with what I really want to do. Then again, if I really want to know the chip, I start from ground up, putting breakpoints in the library as I go and develop my own.

If there is a library already available, my first step will be to use it.

Stellarisiti - Join the new Tiva-C/Stellaris ARM Forums discussing Tiva-C(Stellaris) Microcontrollers.

C2kCentral - C2000 News, Projects and Forums
43oh - MSP430 Discussion, News, Projects and Hacks
MachineGrid - Robots, Hacks and Technology!


#9 GeekDoc

GeekDoc

    Level 4

  • Administrators
  • 1,392 posts
  • LocationO'Fallon, Illinois (St. Louis Metro area)
  • Sparkfun Wishlist


Posted 25 August 2010 - 07:45 PM

@gatesphere:

Any idea will have those who oppose it and those who support it. C'est la guerre. I support your idea and efforts. Options (in my opinion) are good.

I understand @Sean's point. But, even in the high-level languages, I often skip the highly-abstracted constructs and get to the basics, just so I know exactly where I'm going. Still, it's nice to have the option to do things "the easy way" when I just want to put something together quickly.

-Doc
Public Service Announcement: I am a microcontroller / electronics noob! I should usually be quietly ignored or patiently instructed.
http://blog.DocsTech.net

#10 gatesphere

gatesphere

    Level 3

  • Members
  • 430 posts

Posted 26 August 2010 - 05:10 AM

Update:
I have set up a wiki for my projects, and included a section on MSPhere. It is editable by registered users, so hopefully it can become a small community resource once it's released. Check it out here. I'll edit the first post to include this link.
MSPhere - a framework of functions for rapid prototyping with the LaunchPad platform
My other pages: home page/portfolio || development blog

#11 NJC

NJC

    Level 1

  • Members
  • 109 posts

Posted 26 August 2010 - 09:55 AM

That's the problem though it will create a user base who's knowledge centers around how to use your framework and not on the effort/knowledge that you put into creating that framework.
I like the direction that is currently happening where larger projects are being broken down into basic steps/tutorials, most of that will stop and instead start to center around using/learning your framework.


The way I see it, is that gatesphere's libraries will be for people who really can't follow c code even when reading tutorials. The Arduino brought microcomputers to this type of person, which is great. I would view his library as a tool, even professionals might use it if they are looking to get something together quickly. I might use a few functions here or there, there are certain things where ease of use is more important than efficiency. Also, because of what the MSP430 is (something that is not only in the hobby community but also in academia and the industry), I think that most knowledge centers will always stick to C. Don't forget, even C is a high level tool compared to the alternative, there are some things that still MUST be done in asm, even though it is not fun and not used often anymore.

-NJC
_________________________
http://msp430launchpad.com
http://msp430launchpad.com - a blog for getting started with the MSP430.

#12 Sean

Sean

    Member

  • Members
  • PipPip
  • 14 posts

Posted 26 August 2010 - 12:28 PM

I'm not against it completely, I just think simplifying the msp430 this early is a bad idea and will create an initial user base that doesn't know how to actually use the chip or write code,
and that you guys with the knowledge to help/teach us will simply add what you want out of it and move on to your other projects, leaving your libraries behind but not your knowledge of how the code works outside of the libraries.

I don't like being stuck in the middle, using arduino-like libraries is too simplistic and teaches very little, and the code behind them is too complex branching out into more and more of the libraries' functions from inside the libraries and then trying to make sense of enough of it to write a simple standalone function/program.

If you guys with programming knowledge/experience will make the effort to continue writing your tutorials, breaking down your projects into steps, and standalone code examples without using the libraries, then I'm all for having them available. I just want the opportunity to learn from you guys before being crippled trying to learn from users that you create who only understand how to use your libraries and not the code behind then.

#13 gatesphere

gatesphere

    Level 3

  • Members
  • 430 posts

Posted 26 August 2010 - 03:27 PM

Well, I do intend to have each library to have full documentation on the wiki, with an explanation of the code for each function. In fact, I intend to reject libraries that don't come with proper documentation. I don't want to let this framework get in the way of getting to the "base metal". I want this to become an entry point of sorts to getting there. Each module will have it's own page on the wiki with the code for each function, and a thorough explanation of the code.

Is that what you're worried about?
MSPhere - a framework of functions for rapid prototyping with the LaunchPad platform
My other pages: home page/portfolio || development blog

#14 mavis311

mavis311

    Member

  • Members
  • PipPip
  • 16 posts

Posted 26 August 2010 - 07:22 PM

Wow. I've been trying to keep my two cents to myself, but after a few days of seeing updates in this thread I just can't anymore.

If someone creates a library that simplifies things for the amateur programmer, how is that a bad thing? Sean, I understand your stance, but you seem to have forgotten that there isn't (and never will be) legislation or armed guards to force people to learn all the low level stuff about a thing. For example: to drive a car, must I be forced by the auto industry or the government to know what pistons are or how many camshafts are in my car's engine?

Some, like myself, have an intense interest in the low level stuff and truly enjoy learning it. But I'm afraid that we are in the minority -- especially when you broaden your view and consider things like PC programming. How many people do you think program for MS Windows using assembly? I don't know, but I'd wager that the number is quite small relative to the number of people who are using Python or Java or C#/VB.NET. Complex systems like Windows/MacOS/Your-favorite-or-otherwise-most-frequently-used-gui-here have created multiple layers of abstraction and dependence for the programmer. When you write code to create a new window under Windows, you don't have to manually draw the window every time the screen refreshes, all of that is handled for you so that you can concentrate on the things that you are trying to accomplish with the window in the first place.

Now, while the msp430 isn't terribly complicated, having a useful library available for beginning programmers can only increase overall interest in the platform and encourage people who would otherwise have considered the task to complex for them to bother with. The most polite way I can describe your attitude regarding this matter is with the word "purist." Not always a bad thing, but I can't help drawing a comparison with certain other people with a similar purist attitude, some of them were known as Nazi's.

Please don't, I think it would take away too much from the learning experience.

You choose your own learning experience. No one will ever force you or anyone else to use a library to program the msp430.

I want your/others knowledge on how to do something, not code that just does it.

Just because you want something, you are not entitled to it. I see this attitude everywhere I go, especially in the United States, and it makes me sick.

Why don't you just download TI's documentation and create your own tutorials? You'll learn so much more in the process than you would picking the brains of others and we won't have to be exposed to your intolerance. A win/win situation if ever I've seen one.


#15 GeekDoc

GeekDoc

    Level 4

  • Administrators
  • 1,392 posts
  • LocationO'Fallon, Illinois (St. Louis Metro area)
  • Sparkfun Wishlist


Posted 26 August 2010 - 09:21 PM

If someone creates a library that simplifies things for the amateur programmer, how is that a bad thing?

Case in point:
Android apps are written in Java. You can go very "down-in-the-weeds" with Java, or use any number of frameworks that abstract and simplify different functions.

To the extreme: Have you seen Google's App Inventor? It's a graphical programming environment where you drag, drop, and 'snap together' different elements and functions to create your application.
Posted Image

Does this mean all developers will now use App Inventor? Not in the least. But it lowers the bar for someone who wants to dip their toe in the programming waters, and that increases interest in the Android platform, which is what Google wants.

-Doc
Public Service Announcement: I am a microcontroller / electronics noob! I should usually be quietly ignored or patiently instructed.
http://blog.DocsTech.net

#16 gatesphere

gatesphere

    Level 3

  • Members
  • 430 posts

Posted 27 August 2010 - 02:12 AM

As initiator of this framework and this thread, I would like to make a motion to end all of the silly bickering this thread currently contains. It's not good for anyone or anything, and I'm sorry for being a bit too hasty to snap at the bit myself. So, I suggest we just turn this back into a feedback and updates thread. I welcome any comments/criticism about the framework itself and it's use, and from this point forward I will (and would like to encourage everyone else to) take it for what it is.

Again, I apologize for my reactions. But I would like to see this thing forward.

Thanks for reading,
-->suspended-chord/gatesphere
MSPhere - a framework of functions for rapid prototyping with the LaunchPad platform
My other pages: home page/portfolio || development blog

#17 Sean

Sean

    Member

  • Members
  • PipPip
  • 14 posts

Posted 27 August 2010 - 04:39 AM

All I meant to say was: I know you more experienced guys won't be on the same page/book as us beginners with this chip for very long, but while you are I hope some of you will leave behind enough bits & pieces of your knowledge at a basic level that focus on the chip without extra layers/knowledge barriers, so those of us without any experience can pickup enough from you to get started and learn the rest ourselves.

I'm not sure ti's examples/documents are the best to learn from. I think I'd be trying to get the launchpad genie to come out.
I know I can release the smoke, but I'll need some help with the genie.

#18 gatesphere

gatesphere

    Level 3

  • Members
  • 430 posts

Posted 27 August 2010 - 04:48 AM

Well, I'm actually a beginner with the MSP430 myself. In fact, I just got into microcontrollers in general this summer. So I am where you are, and I probably will be for a long time. I'm actually writing this as a way to teach myself bitshifting and all of that good stuff so that I have the knowledge to write the code you are talking about, without the crutch of this library.

Also, I'm working on the documentation at the moment. I think it's quite thorough at the moment, considering how small the library is so far. Feel free to check it out: http://wiki.suspende... ... ka=MSPhere
MSPhere - a framework of functions for rapid prototyping with the LaunchPad platform
My other pages: home page/portfolio || development blog

#19 mavis311

mavis311

    Member

  • Members
  • PipPip
  • 16 posts

Posted 27 August 2010 - 04:57 AM

Well, I'm actually a beginner with the MSP430 myself. In fact, I just got into microcontrollers in general this summer. So I am where you are, and I probably will be for a long time. I'm actually writing this as a way to teach myself bitshifting and all of that good stuff so that I have the knowledge to write the code you are talking about, without the crutch of this library.


Same here. I've also entertained thoughts of creating library during the learning process but I don't yet have enough experience to know what material would be suitable. The MSP430 is the first opportunity I've had to program a uc and I'm loving the experience.

#20 Sean

Sean

    Member

  • Members
  • PipPip
  • 14 posts

Posted 27 August 2010 - 01:10 PM

" // pins 0-7 are P1.0-P1.7, pins 8-16 are P2.0-P2.7"
This won't work properly without first converting into hex, or decimal representation of binary, unless I missed that part, also pin 2.7 needs to have P2SEL cleared when used as an input (footnote@p6).

I think you're missing a primer on pin usage, I just wrote this, its not complete, might not be completely accurate, and public domain in its current form.
The pins of the msp430 are grouped into groups of up to 8 pins, a group of pins is called a port, for the value line it has 10 pins and 2 ports.
Inside each port the pins are controlled by various 8-bit status registers.
Binary representation of an 8-bit status register: 0000000, each placeholder represents one bit, each bit represents a pin, each bit can be either 0(LOW) or 1(HIGH)

These are just a few of the port status registers:
PxDIR used to set the pin as input(0) or output(1)
PxOUT used to set the pin as off(0), or on(1)
PxSEL used to set the pin to normal mode(0) or to use the pins internal function(1)
*replace x with the port number

common methods used to change the pin bits.
=  used to sets the entire register to the value you specify
|= used to set only the bits you specify to 1(HIGH)
&= ~ used to clear only the bits you specify to 0(LOW)
^=   used to alternate between 1(HIGH)/0(LOW) of the bits you specify

various formats of values used to represent the bits:
0x00-0xFF 
0-255: decimal representation of binary/hex value.
BIT0-BITF
I wish I saw this earlier: http://justinstech.o... ... ng-part-1/
I wouldn't have had so much trouble figuring out some of the stuff myself.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users