Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DSPic FORTH

415 views
Skip to first unread message

dons...@gmail.com

unread,
Jan 9, 2013, 12:51:54 PM1/9/13
to
I just started getting familiar with the DSPic family of micros and I find very little information on FORTH for that chip family, basically the only FORTH I found was FlashForth.

Is there anything else available? Is there a reason for this that anyone is aware?

Usually when FORTH is not readily available it's because it is a new device which does not apply here or the device doesn't have the needed resources which I tend to doubt as it suppose to do well with C.

Thanks
Cecil - k5nwa

Brad Eckert

unread,
Jan 9, 2013, 2:53:41 PM1/9/13
to
On Wednesday, January 9, 2013 10:51:54 AM UTC-7, dons...@gmail.com wrote:
> Is there anything else available? Is there a reason for this that anyone is aware?
>
I think the vendors chose to concentrate on the most popular family in the 16-bit niche, the MSP430. These day's you're not going to see a new port unless someone pays for it or does it themselves.

dons...@gmail.com

unread,
Jan 9, 2013, 3:11:55 PM1/9/13
to
The MSP430 family has a beautiful instruction set and architecture, you can implement a very efficient FORTH for it, but unfortunately it won't fit the crunching capacity I'm looking for. I have not looked at them in a while so maybe new models are more powerful.

Cecil - k5nwa

Stephen Pelc

unread,
Jan 9, 2013, 3:22:15 PM1/9/13
to
The C tools are almost free (beer). No Forth vendor can compete with
free beer.

It is interesting part that on 32 bit CPUs there are reasons to ignore
free (beer) in favour of functionality.

The PIC24/3x family is the first PIC family that could justify MPE's
attention. However, we have yet to convince ourselves that it is a
good commercial proposition. On a technical basis, it would make a
good VFX target.

Stephen


--
Stephen Pelc, steph...@mpeforth.com
MicroProcessor Engineering Ltd - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691
web: http://www.mpeforth.com - free VFX Forth downloads

Mikael Nordman

unread,
Jan 9, 2013, 3:46:26 PM1/9/13
to
I started to implement FlashForth also for the MSP430.
I noticed a drawback for a subroutine threaded forth.
There is no one cell relative call instruction. That makes high level
words quite long since each call takes two cells.

The dsPIC instruction is really nice and symmetrical, I like it.
It also has a relative call with a reach of 32 KBytes.

-- Mike


Hugh Aguilar

unread,
Jan 9, 2013, 5:09:43 PM1/9/13
to
The first target for my Straight Forth cross-compiler will be the
PIC24. I have a MicroStick-II that I'm using. I'm not ready with the
cross-compiler yet.

I don't know anything about DSP.

dons...@gmail.com

unread,
Jan 9, 2013, 5:53:15 PM1/9/13
to
It is just has added instructions that have unusual properties such as a MAC instructions, one instruction that multiplies two numbers and adds them to a tally usually with special handling of the overflow condition. That makes the creation of FFT or Digital Filters very efficient.

Cecil -k5nwa

Hugh Aguilar

unread,
Jan 9, 2013, 9:54:56 PM1/9/13
to
What are you planning on doing with DSP? Isn't that for simulating
analog circuits in a micro-controller?

dons...@gmail.com

unread,
Jan 9, 2013, 11:48:28 PM1/9/13
to
SDR, Software Define Radio, very simple radios with the filtering, decoding, and display of the spectrum implemented by a DSP chip instead of hardware.

Thinking also about an infrared oven controller (PID controller) for soldering surface mounted printed circuit boards, a DSP is not needed but the chips are cheap($2 to $5) and the extra processing won't hurt.The extra speed could be used to display in real-time what is happening on a small TFT display.

I have implemented good part of an SDR radio on Discovery F4 board(ST Cortex M4 CPU at 168 MHz) but would like to try it on a DSPic also. It's my hobby, I'm doing it because I can.

Cecil - k5nwa

Brad Eckert

unread,
Jan 10, 2013, 12:39:46 PM1/10/13
to steph...@invalid.mpeforth.com
On Wednesday, January 9, 2013 1:22:15 PM UTC-7, Stephen Pelc wrote:
> The C tools are almost free (beer). No Forth vendor can compete with
> free beer.
>
That's not to say a commercial cross compiler couldn't be targeted at a simple VM expressed in C. Then you can have the best of both worlds. The free beer IDE with the free drivers and middleware that they use to lure you in, and Forth with all of its interactivity and compactness.

I demonstrated something like this a few years ago and put it on Sourceforge as Fminus. The cross compiler part was based on Win32forth, and as I recall it was targeted at a PIC24. A Forth vendor could take the VM part and port the cross compiler to a nicer platform, since I released it under MIT license.

rickman

unread,
Jan 10, 2013, 5:35:21 PM1/10/13
to
On 1/9/2013 11:48 PM, dons...@gmail.com wrote:
> On Wednesday, January 9, 2013 8:54:56 PM UTC-6, Hugh Aguilar wrote:
>> On Jan 9, 3:53 pm, donseg...@gmail.com wrote:
>>
>>> It is just has added instructions that have unusual properties such as a MAC instructions, one instruction that multiplies two numbers and adds them to a tally usually with special handling of the overflow condition. That makes the creation of FFT or Digital Filters very efficient.
>>
>> What are you planning on doing with DSP? Isn't that for simulating
>> analog circuits in a micro-controller?

Lol!


> SDR, Software Define Radio, very simple radios with the filtering, decoding, and display of the spectrum implemented by a DSP chip instead of hardware..
>
> Thinking also about an infrared oven controller (PID controller) for soldering surface mounted printed circuit boards, a DSP is not needed but the chips are cheap($2 to $5) and the extra processing won't hurt.The extra speed could be used to display in real-time what is happening on a small TFT display.
>
> I have implemented good part of an SDR radio on Discovery F4 board(ST Cortex M4 CPU at 168 MHz) but would like to try it on a DSPic also. It's my hobby, I'm doing it because I can.

Why not consider one of the ARM Cortex M4 processors? They can be very
inexpensive as well and have lots of processing power, including what
they call, DSC, Digital Signal Controller, special instructions and
optimizations that approach DSP throughput rates. Some implementations
include not only DSP, but floating point as well.

There are a number of vendors selling these including Motorola, NXP, ST,
Atmel and others. Why limit yourself to one vendor with limited future
growth?

Rick

dons...@gmail.com

unread,
Jan 10, 2013, 7:53:26 PM1/10/13
to
I already said that I had already implemented a lot of the project on an ST M4 Cortex processor using a ST Discovery M4 card which I will finish.

http://www.mouser.com/ProductDetail/STMicroelectronics/STM32F4DISCOVERY/?qs=sGAEpiMZZMutVogd4PRSvEN8XDBeCtgD

The reason I'm interested in a DSPic version is that those chips are available in DIP and SOIC packaging which are more easy for me to work with. I want to create a PCB with not just the CPU but also all the special IO required to connect and control the transceiver, with DIP or SOIC devices it is easier to create a PCB and for others to use.

Computers create noise, so having a CPU on one board and I/O on another with all the wiring involved inside a radio is a very bad idea. You want a single board to do it all because its easier to shield one board.

This is a hobby for me, so I also want to work with those chips because they are interesting and easy to work with.

Cecil - k5nwa

Hugh Aguilar

unread,
Jan 10, 2013, 11:59:04 PM1/10/13
to
On Jan 9, 9:48 pm, donseg...@gmail.com wrote:
> It's my hobby, I'm doing it because I can.

I can appreciate that. I'm targeting the PIC24 first with my cross-
compiler, and I expect that the users will mostly be hobbyists. I'll
make that version free, or at least, inexpensive. When I target the
ARM, that won't be free --- that will be for professional work. I
expect to learn a lot with the PIC24 version though, which will give
me a leg up on the ARM version.

I'm doing Straight Forth because I can. :-)
I don't know of anybody else who could write Straight Forth ---
Forth-200x won't have closures --- Elizabeth Rather cheerfully admits
that she doesn't know what they are or what they're for, and so they
aren't going to be made part of the standard.

rickman

unread,
Jan 13, 2013, 5:22:44 PM1/13/13
to
On 1/10/2013 7:53 PM, dons...@gmail.com wrote:
>
> I already said that I had already implemented a lot of the project on an ST M4 Cortex processor using a ST Discovery M4 card which I will finish.
>
> http://www.mouser.com/ProductDetail/STMicroelectronics/STM32F4DISCOVERY/?qs=sGAEpiMZZMutVogd4PRSvEN8XDBeCtgD
>
> The reason I'm interested in a DSPic version is that those chips are available in DIP and SOIC packaging which are more easy for me to work with. I want to create a PCB with not just the CPU but also all the special IO required to connect and control the transceiver, with DIP or SOIC devices it is easier to create a PCB and for others to use.
>
> Computers create noise, so having a CPU on one board and I/O on another with all the wiring involved inside a radio is a very bad idea. You want a single board to do it all because its easier to shield one board.
>
> This is a hobby for me, so I also want to work with those chips because they are interesting and easy to work with.
>
> Cecil - k5nwa

Hi Cecil,

I think you overrate the problems created by multiple boards in a radio.
I worked for Thales which make handheld radios for the military and
emergency services. They don't make a radio with a single board in it.
They are all modular.

Of course the project is yours and you can set the requirements to suit
yourself. I don't know of any of the CM4 devices that aren't available
in QFP and/or QFN type packaging which is pretty easy to work with. I
don't like to use fine pitch BGAs in my professional work and my
assembly house tells me LGA modules are a PITA. But I love QFPs and QFNs.

BTW, emitted noise in electronic circuits have specific causes. Just
running wires isn't one of them. Running wires that act like antennas
is what emits noise.

Rick

rickman

unread,
Jan 13, 2013, 5:25:51 PM1/13/13
to
On 1/10/2013 11:59 PM, Hugh Aguilar wrote:
> On Jan 9, 9:48 pm, donseg...@gmail.com wrote:
>> It's my hobby, I'm doing it because I can.
>
> I can appreciate that. I'm targeting the PIC24 first with my cross-
> compiler, and I expect that the users will mostly be hobbyists. I'll
> make that version free, or at least, inexpensive. When I target the
> ARM, that won't be free --- that will be for professional work. I
> expect to learn a lot with the PIC24 version though, which will give
> me a leg up on the ARM version.

How exactly will that be better than just doing the ARM version and then
improving the ARM version?

Are you really planning to make money selling a Forth for the ARM?
Where will you find customers?

Rick

Hugh Aguilar

unread,
Jan 14, 2013, 4:45:54 PM1/14/13
to
On Jan 13, 3:25 pm, rickman <gnu...@gmail.com> wrote:
> Are you really planning to make money selling a Forth for the ARM?
> Where will you find customers?

The world is full of programmers who have tried Forth (usually
PolyForth or SwiftForth), dumped it, and switched to C. They are okay
with C, but they wish they had closures like the desktop-computer
languages have --- they will use any language that generates code for
micro-controllers and has closures, of which there are none at this
time.

rickman

unread,
Jan 14, 2013, 5:09:36 PM1/14/13
to
Care to clue me in as to why closures are so important?

Are you aware that there are many factors that influence the choice of
programming language by individuals and that this is often a company
decision rather than a programmer's decision?

Do you have a business model?

Rick

Hugh Aguilar

unread,
Jan 14, 2013, 6:27:21 PM1/14/13
to
On Jan 14, 3:09 pm, rickman <gnu...@gmail.com> wrote:
> Care to clue me in as to why closures are so important?

No, I wouldn't care to --- read any novice-level book on programming
any modern language for this information.

Also, you could learn how my novice package works, as it uses a crude
closure-like construct extensively (that was the best that I could
muster with ANS-Forth) --- see list.4th and association.4th in
particular.
http://www.forth.org/novice.html

> Are you aware that there are many factors that influence the choice of
> programming language by individuals and that this is often a company
> decision rather than a programmer's decision?

Yes --- in some cases however, the owner of the business is a
programmer, so it is the same thing.

> Do you have a business model?

Yes --- I write the world's greatest micro-controller programming
language --- then I just wait for the world to beat a path to my door.

rickman

unread,
Jan 15, 2013, 12:20:45 AM1/15/13
to
On 1/14/2013 6:27 PM, Hugh Aguilar wrote:
> On Jan 14, 3:09 pm, rickman<gnu...@gmail.com> wrote:
>> Care to clue me in as to why closures are so important?
>
> No, I wouldn't care to --- read any novice-level book on programming
> any modern language for this information.

Yes, I figured as much...


> Also, you could learn how my novice package works, as it uses a crude
> closure-like construct extensively (that was the best that I could
> muster with ANS-Forth) --- see list.4th and association.4th in
> particular.
> http://www.forth.org/novice.html

Why waste my time with a "crude" construct when I can read novice-level
books?

I did a quick search and found several descriptions of what closures
are. None of them explained what they are good for. Obviously it isn't
too much or they would have expounded on it.


>> Are you aware that there are many factors that influence the choice of
>> programming language by individuals and that this is often a company
>> decision rather than a programmer's decision?
>
> Yes --- in some cases however, the owner of the business is a
> programmer, so it is the same thing.
>
>> Do you have a business model?
>
> Yes --- I write the world's greatest micro-controller programming
> language --- then I just wait for the world to beat a path to my door.

That's sort of what I figured. Just like the company you worked for
valued your time so much they continually cut your hours until you were
starving. Even a frog will eventually jump out of the pot when the heat
is slowly turned up.

Hugh, if you have something worth saying, then just say it instead of
playing these games.

Rick

Brad Eckert

unread,
Jan 17, 2013, 10:39:34 AM1/17/13
to
On Monday, January 14, 2013 10:20:45 PM UTC-7, rickman wrote:
> I did a quick search and found several descriptions of what closures
> are. None of them explained what they are good for. Obviously it isn't
> too much or they would have expounded on it.

Closures are good for keeping your pants up.

Matthias Koch

unread,
Jan 24, 2013, 9:57:50 AM1/24/13
to

> I started to implement FlashForth also for the MSP430.
> I noticed a drawback for a subroutine threaded forth.
> There is no one cell relative call instruction. That makes high level
> words quite long since each call takes two cells.
>

Hi Mike,

I just finished my work on Mecrisp, a native Forth for MSP430. As FlashForth is GPL3 too, you could include some of my words in your upcoming FlashForth-msp430 if you wish.

Matthias
http://mecrisp.sourceforge.net/

ohayo....@gmail.com

unread,
May 10, 2013, 5:16:33 PM5/10/13
to
Hi,

I just found out that RS has published a FORTHdsPIC version :
http://www.designspark.com/blog/forthdspic-gets-its-compiler-more-bare-metal

For SDR new PIC24 and dsPIC33EP are announced with 10 to 24MSPS 12 bits A/D converters ;=) . I currently use a beta sample of PIC24FJ128GC010 which has a 12 bits 10MSPS ADC.

Regards

WJ

unread,
May 11, 2013, 7:32:25 AM5/11/13
to
Hugh Aguilar wrote:

> On Jan 14, 3:09�pm, rickman <gnu...@gmail.com> wrote:
> > Care to clue me in as to why closures are so important?
>
> No, I wouldn't care to --- read any novice-level book on programming
> any modern language for this information.

A couple of simple closure examples in Lua.


-- A function that returns a closure.
function make_stepper()
local i = 0
return function () i = i + 1 return i end
end

function make_matrix (height, width, func)
mat = {}
for row = 1, height do
mat[row] = {}
for col = 1, width do
mat[row][col] = func(row,col)
end
end
return mat
end

function print_matrix (mat)
for _, row in ipairs(mat) do
for _, x in ipairs(row) do io.write(string.format("%3d",x)) end
print()
end
end

print_matrix( make_matrix( 5, 5, function(y,x) return y*x end ))
===>
1 2 3 4 5
2 4 6 8 10
3 6 9 12 15
4 8 12 16 20
5 10 15 20 25

print_matrix( make_matrix( 4, 5, make_stepper() ))
===>
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20




-- A function that returns a closure.
function make_counter ()
local cnt = 0
return
function (arg)
if arg then
return cnt
else
cnt = cnt + 1
end
end
end

counts = {string=make_counter(), number=make_counter(), table=make_counter()}

for _, x in ipairs({1,2,3,4,5,"a","b",'c',{},{}}) do
counts[ type(x) ]()
end

for key, val in pairs( counts ) do
print( val('report') .. " " .. key .. 's' )
end

===>

5 numbers
3 strings
2 tables

oh2...@gmail.com

unread,
May 18, 2013, 8:21:48 AM5/18/13
to
Thanks Matthias
Just saw this post now. I will have a look

Mike
0 new messages