Does anyone have Hack a Day's "Getting Started" example code?

31 views
Skip to first unread message

Dave

unread,
Oct 16, 2010, 9:49:47 AM10/16/10
to TI Launchpad
I've been getting up and running with the Launchpad under Linux via
Hack a Day's nice article, but unfortunately their example code 404s
on me. Does anyone here have their code?

simpleavr

unread,
Oct 16, 2010, 6:27:23 PM10/16/10
to TI Launchpad
that tar file is just a blinky application.

you can download full examples from ti http://www.ti.com/lit/zip/slac080

and change a few lines to make it work under mspgcc

if you download examples from ti and try to build them, you will get
errors caused by different header files, macros, etc. most simple
examples can be converted easily so that gcc can build them. the most
noticable problem is how the interrupt handlers are written.

in CCS they are as such

pragma vector=PORT1_VECTOR
__interrupt void PORT1_ISR(void)


and you need to change them to this, plus adding one header file

#include "signal.h"
.
.
interrupt (PORT1_VECTOR) PORT1_ISR(void)


there may be other macros missing in gcc in more complex examples, you
will need to find or create substitutes for them.

i also had a script to convert most examples so that they can build w/
mspgcc


see my page here, scroll down to the "converting CCS examples for GCC"
section, u can cut and paste a small perl script that converts the
examples for u.

http://www.simpleavr.com/msp430-projects/launchpad-shield

Kevin Mark

unread,
Oct 17, 2010, 7:18:55 AM10/17/10
to ti-lau...@googlegroups.com
Yeah, I created a simple shell scipt to do that conversion, also.
I think a better solution is to create a file that can work with gcc as well as
the other compilers. I saw one example.

--
| .''`. == Debian GNU/Linux ==.| http://kevix.myopenid.com......|
| : :' : The Universal OS....| mysite.verizon.net/kevin.mark/.|
| `. `' http://www.debian.org/.| http://counter.li.org [#238656]|
|___`-____Unless I ask to be CCd,.assume I am subscribed._________|

Rogan Dawes

unread,
Oct 17, 2010, 11:41:19 AM10/17/10
to TI Launchpad


On Oct 17, 1:18 pm, Kevin Mark <kevin.m...@verizon.net> wrote:
> > in CCS they are as such
>
> > pragma vector=PORT1_VECTOR
> > __interrupt void PORT1_ISR(void)
>
> > and you need to change them to this, plus adding one header file
>
> > #include "signal.h"
> > .
> > .
> > interrupt (PORT1_VECTOR) PORT1_ISR(void)
>
> > there may be other macros missing in gcc in more complex examples, you
> > will need to find or create substitutes for them.

> Yeah, I created a simple shell scipt to do that conversion, also.
> I think a better solution is to create a file that can work with gcc as well as
> the other compilers. I saw one example.

You could define a header file with a suitable macro that detects
defines specific to GCC or IAR/CSS, and defines appropriate interrupt
macros. e.g.

#define INTERRUPT(x,y) pragma vector=x __interrupt void y(void)

for CCS/IAR

and

#define INTERRUPT(x,y) interrupt (x) y(void)

for GCC

or something along those lines :-) (/me is not a cpp expert)

Worth trying, I guess.

Rogan

Kevin Mark

unread,
Oct 17, 2010, 2:09:33 PM10/17/10
to ti-lau...@googlegroups.com

well, something like that. I would appreciate if the TI examples included them.

gatesphere

unread,
Oct 17, 2010, 2:35:54 PM10/17/10
to ti-lau...@googlegroups.com
On 10/17/2010 2:09 PM, Kevin Mark wrote:
> well, something like that. I would appreciate if the TI examples included them.
Well, that'd be expecting TI to support tools that directly undermine
the profitability of their own and that of their distributors (IAR). TI
is a company out to make money, after all, just like any other.

Just my 2 cents.
-->gatesphere/suspended-chord

Reply all
Reply to author
Forward
0 new messages