Pages: 1 [2] 3   Go Down
Author Topic: Writing Code in the Arduino IDE, need help porting to C  (Read 1929 times)
0 Members and 1 Guest are viewing this topic.
Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1001
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

so say I wanted to include tlc_fades.h from the TLC5940 Library from the arduino platform, I could just boom boom copy paste?
Logged

Accelerate to 88 miles per hour.

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You could try, but I doubt it would work. The line ...

Code:
#include <avr/interrupt.h>

certainly wouldn't work.

I don't understand why you are asking Arduino users how to port a library to another architecture. You should be asking other MSP430 users if they have a library that does what you want.
Logged

Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1001
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well the code is written for the arduino.  Was thinking that maybe i could get something out of asking people here because they would understand how the library is written and why its written that so that i could decipher the arduino library and maybe be able to piece together what i need for the other platform b/c i don't know what the library for the arduino consists of right now.
Logged

Accelerate to 88 miles per hour.

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 291
Posts: 25874
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
i don't know what the library for the arduino consists of right now.
But you have the source
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1001
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have it but I don't understand it.

I don't get what all the #'s are for
What does #endif mean?

Is there a webpage that explains it all?
Logged

Accelerate to 88 miles per hour.

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 291
Posts: 25874
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you don't understand basic preprocessor constructs, there is very little chance of you translating or porting these libraries.
Get hold of a copy of K&R.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

0
Offline Offline
God Member
*****
Karma: 2
Posts: 596
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Is there a webpage that explains it all?

The title would be "C language in a web page". Not likely...
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Google "TLC5940 MSP430". There are about 4000 matches. Follow them.

Quote
OOOOhhhkay so they have already done the conversion work it just doesn't seem to be in as nice a package as the library for the arduino.

I'm not sure what your motivation here is, apart from boredom maybe.

The MSP430 isn't a lot cheaper than the Atmega, for the simple reason that the Atmega itself only costs around $5 (and that is in single units of one of their more powerful processors). So the most you could save is $5.

The Atmega can run with very low power consumption, less than a battery loses a day anyway due to self-discharge.

And you admit that the Arduino has a "nice" package.

Quote
What does #endif mean?

You don't seem to be all that familiar with C programming.

So why do you want to do this? Is this a school project? Has the teacher told you to do it?
Logged

Leighton Buzzard, UK
Offline Offline
Edison Member
*
Karma: 21
Posts: 1339
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

is there the distinct whiff of troll around these parts?

been following the thread and it do seem so to me!
Logged

there are only 10 types of people
them that understands binary
and them that doesn't

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

/agree
Logged

Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1001
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

No i'm not trolling at all.

I'm a beginner to standalone microcontrollers and the launchpad was very friendly to beginners like me to microcontrollers.
I am not familiar with C, you are right.  My motivation is to make something sweet just like everybody else, but that shouldn't matter. I'm here cause i need help.
Logged

Accelerate to 88 miles per hour.

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

OK, great. We are all trying to help here.

But what I don't get is, you have a MSP430 launchpad, and you want to interface it to TLC5940, right?

Well why ask on the Arduino forum? That's like asking on an Apple web site how to get Windows to work.

We don't know the answer, and the people on the MSP430 forum probably will.

As for "how do I convert the Arduino libraries?", well I wouldn't personally want to convert them all to another platform. You would need very in-depth knowledge of how the Atmega works (at the hardware level) to understand a lot of what the libraries are doing, and also in-depth knowledge of how the MSP430 works as well.
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 124
Posts: 6653
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A couple of people (including myself) have done "some" work in porting the Arduino libraries to MSP430, back when there was so much excitement about the $5 LaunchPad that you could get (eventually.)  It turns out to be pretty difficult to get very far, because you run into serious limitations very quickly (The original Launchpad has 1/16th the memory of an Uno and is only capable of one hardware PWM output.)

Still, I created a deeply philosophical and wildly entertaining set of blog posts on the subject that I'm sure you'll find fascinating:  http://www.element14.com/community/people/WestfW/blog  :-;
« Last Edit: January 31, 2012, 11:45:21 pm by westfw » Logged

Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1001
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well it isnt that complicated of a program, All i need is the microcontroller to send the data the to TLC5940 PWM Driver.
Logged

Accelerate to 88 miles per hour.

0
Offline Offline
God Member
*****
Karma: 2
Posts: 596
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

According to this page

http://www.arduino.cc/playground/Learning/TLC5940

it's not exactly a trivial task to drive a tlc5940...
Logged

Pages: 1 [2] 3   Go Up
Jump to: