EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Basic compiler for MSP430

Started by Stephan Portier February 22, 2010
Stephan,

On the DSP side, several companies have implemented graphical "toolboxes"
that allow the user to drag-n-drop an icon to attach basic items such as
Timers, PWM, UART, Turn_Output_ON,Turn_Output_OFF, Read_DigitalInput,
ReadAnalogInput as well as canned PID loops etc.
The software also allows the user to interface custom Matlab routines with
the device.
There are also Time plots, XY plots, etc that allow output waveforms.

Although these modules are pumping assembly-code into the device, if you can
add basic-language utilities such as GoSub, GoTo, For/Next to your graphical
IDE then you may attract a new crowd of developers who may be intimidated by
the many registers and setup of these devices.

Best Regards,

Juan Carlos

On Sun, Feb 21, 2010 at 3:22 PM, Stephan Portier wrote:

> Hello,
>
> I wanted to ask users for something. Is there any interest in a basic
> compiler for msp430 series?
>
> I want to write a basic or Pascal compiler for this chip and wanted to know
> if users really have interest or no.
>
> Regards
>
>
>
>
>


Beginning Microcontrollers with the MSP430

If you read enough of these "Which programming language is best for X
microprocessor?" discussions, you just know some Forth zealot is going to
come along and throw his 2 cents in!

Well, I'm only too happy to oblige! The original question asked about a
Basic "compiler". However, it seems to me the only compelling reason to use
Basic is as an interpreter. Nobody can deny the appeal of instant feedback
that interpreters give you. And if you want an interpreter (*and* a
compiler), Forth is a much better language to use, especially in the
resource-limited environment of embedded micros.

I sent a message to the group just about exactly a year ago extolling the
virtues of CamelForth/430 written by Brad Rodriguez. See
http://tech.groups.yahoo.decenturl.com/camelforth-announcement (Message
#40340). Since that time it's been ported to the eZ430-RF2500 and recently a
native MSP430 assembler was added.

Check it out.

John


On Tue, 23 Feb 2010 22:04:07 -0000, John Porubek
wrote:

> Well, I'm only too happy to oblige! The original question asked about a
> Basic "compiler". However, it seems to me the only compelling reason to
> use Basic is as an interpreter. Nobody can deny the appeal of instant
> feedback that interpreters give you.

I wholeheartedly agree.

> And if you want an interpreter (*and* a compiler), Forth is a much better
> language to use, especially in the resource-limited environment of
> embedded micros.

I love Forth, the language. However, I can never see me writing anything
complex in Forth (stack gymnastics leave me cold). I first fell for Forth
when I saw:

: STAR 42 EMIT ;
: STARS 0 DO STAR LOOP ;

Sends shivers down my spine remembering that. Whatever you think of Chuck
now, there's no doubt that this particular language, and its initial
implementation, was a true stoke of genius. It's a shame all that is left
are embers.

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks V2 is out for LPC1700, LPC3100, LPC3200, SAM9, and more!
Stephan,

For those of us that cut our teeth on machine and assembly language -
you've got to be kidding ;) .

As an exercise in computer science, may be interesting. For instance,
how to map complex instructions into single-cycle instructions for the
microprocessor may be a great learning exercise; not to mention all of
the other issues pointed out in this thread.

If you want to do it - go for it. Nothing ventured, nothing gained.

Regards,
John Westmoreland

On 2/21/10, Stephan Portier wrote:
> Hello,
>
> I wanted to ask users for something. Is there any interest in a basic
> compiler for msp430 series?
>
> I want to write a basic or Pascal compiler for this chip and wanted to know
> if users really have interest or no.
>
> Regards
>
>

--
Sent from my mobile device
Very harsh reallity.

I prefer to surrender right now. Its not worth to spend nights of work on a
useless project.



regards

Stephan



De : m... [mailto:m...] De la part de
John Westmoreland
Envoy: mardi 23 frier 2010 23:53
: m...
Objet : Re: [msp430] Basic compiler for MSP430





Stephan,

For those of us that cut our teeth on machine and assembly language -
you've got to be kidding ;) .

As an exercise in computer science, may be interesting. For instance,
how to map complex instructions into single-cycle instructions for the
microprocessor may be a great learning exercise; not to mention all of
the other issues pointed out in this thread.

If you want to do it - go for it. Nothing ventured, nothing gained.

Regards,
John Westmoreland

On 2/21/10, Stephan Portier > wrote:
> Hello,
>
> I wanted to ask users for something. Is there any interest in a basic
> compiler for msp430 series?
>
> I want to write a basic or Pascal compiler for this chip and wanted to
know
> if users really have interest or no.
>
> Regards
>
>

--
Sent from my mobile device



On Wed, Feb 24, 2010 at 7:42 AM, Stephan Portier wrote:
> Very harsh reality.
>
> I prefer to surrender right now. Its not worth to spend nights of work on a
> useless project.
>

I would not think it is a useless project. As you have using PIC/AVR before
and indeed Commercial Basic has some following there. You can carve
a niche if you have a good product. It is not easy but there are users.

But whether the efforts are better spent elsewhere for you
is another question.

--
Xiaofan http://mcuee.blogspot.com
Stephan,

> Very harsh reallity.
>
> I prefer to surrender right now. It’s not worth to spend nights of work
> on a useless project.

Never class projects you love as "useless". They always serve a purpose.
How much you learn from your project is really up to you, it's a great way
to learn by experimenting. Christ, all this "you have to do it to
engineering standards" crap that's around really infuriates me. True
pioneers lead the way and do what they damn well like, they don't get
bound by the constraints imposed by others or wrapped up in what others
think of them. I've been spending my evenings on stuff I like recently,
working to 2 or 3 in the morning to get some things I like doing checked
into source control, as well as writing even more floating point code for
Cortex-M0 (it wasn't so bad) which contributes to our product. Sorry,
Cortex-M0 is a nice little processor, I'm sure TI have a watching brief,
and I it seems that MSP430 is being squeezed on all sides because it's
looking expensive compared to LPC1100 devices, and some MSP430s are just
bloody scarce...

Now, if you want to make a profitable business, it's a different matter.
It's good to do what you like anyway--then you won't mind the nights spent
building and nurturing it so much. Or find a rich wife to subsidise you.

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks V2 is out for LPC1700, LPC3100, LPC3200, SAM9, and more!
>Or find a rich wife to subsidise you.
>

This one is a good deal J



Stephan



De : m... [mailto:m...] De la part de Paul Curtis
Envoyé : mercredi 24 février 2010 01:02
À : m...
Objet : Re: [msp430] Basic compiler for MSP430





Stephan,

> Very harsh reallity.
>
> I prefer to surrender right now. It’s not worth to spend nights of work
> on a useless project.

Never class projects you love as "useless". They always serve a purpose.
How much you learn from your project is really up to you, it's a great way
to learn by experimenting. Christ, all this "you have to do it to
engineering standards" crap that's around really infuriates me. True
pioneers lead the way and do what they damn well like, they don't get
bound by the constraints imposed by others or wrapped up in what others
think of them. I've been spending my evenings on stuff I like recently,
working to 2 or 3 in the morning to get some things I like doing checked
into source control, as well as writing even more floating point code for
Cortex-M0 (it wasn't so bad) which contributes to our product. Sorry,
Cortex-M0 is a nice little processor, I'm sure TI have a watching brief,
and I it seems that MSP430 is being squeezed on all sides because it's
looking expensive compared to LPC1100 devices, and some MSP430s are just
bloody scarce...

Now, if you want to make a profitable business, it's a different matter.
It's good to do what you like anyway--then you won't mind the nights spent
building and nurturing it so much. Or find a rich wife to subsidise you.

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks V2 is out for LPC1700, LPC3100, LPC3200, SAM9, and more!



That's the spirit !

Juan Carlos
On Tue, Feb 23, 2010 at 7:01 PM, Paul Curtis wrote:

> Stephan,
> > Very harsh reallity.
> >
> > I prefer to surrender right now. Its not worth to spend nights of work
> > on a useless project.
>
> Never class projects you love as "useless". They always serve a purpose.
> How much you learn from your project is really up to you, it's a great way
> to learn by experimenting. Christ, all this "you have to do it to
> engineering standards" crap that's around really infuriates me. True
> pioneers lead the way and do what they damn well like, they don't get
> bound by the constraints imposed by others or wrapped up in what others
> think of them. I've been spending my evenings on stuff I like recently,
> working to 2 or 3 in the morning to get some things I like doing checked
> into source control, as well as writing even more floating point code for
> Cortex-M0 (it wasn't so bad) which contributes to our product. Sorry,
> Cortex-M0 is a nice little processor, I'm sure TI have a watching brief,
> and I it seems that MSP430 is being squeezed on all sides because it's
> looking expensive compared to LPC1100 devices, and some MSP430s are just
> bloody scarce...
>
> Now, if you want to make a profitable business, it's a different matter.
> It's good to do what you like anyway--then you won't mind the nights spent
> building and nurturing it so much. Or find a rich wife to subsidise you.
> --
> Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
> CrossWorks V2 is out for LPC1700, LPC3100, LPC3200, SAM9, and more!
>
>
>


Hello Stephan,

> Very harsh reallity.

> I prefer to surrender right now. Its not worth to spend nights of work on a
> useless project.

Here is what you should do, if it was up to me to decide what you
should do with your time. :-)

I used an assembler for the z80 once that was 'augmented' for lack of
a better term. It was a macro assembler that had some nice macro
functions to it.

It still let you write plain assembly language code: (I'm making up a
little syntax here)

Load A, 15
Mov A, PortB

But it also let you write loops that translated into assembly: (I
don't remember the exact syntax.)

DB loopy

For loopy = 1 to 100

Load A, loopy
Mov A, PortB

Next loopy

A register was pushed/popped to support the macro.

It had string functions and other "high level" constructs that would
assist in writing assembly. It was an assembly/BASIC mix. I can't tell
you how easy it became to write a lot of assembly. The output of this
actually fed into a 'regular' assembler. This was all DOS-based, mind
you, because it was about a hundred years ago when I wrote z80 code
for money. My DOS text editor shelled out to run a batch file that
called both the macro converter and assembler.

Something like this might have a lot more appeal than BASIC or C
specifically for the msp430.

-Rob


Memfault Beyond the Launch