Last time I compared PICs and AVR, the later won because it's designed for C. This should also make it a better target for Lua.
"designed for C" is a relative term. It's still Harvard, which means that if you use the GCC AVR port you'll end up reading all your const data from RAM. Other compilers might handle this better.
AVR 8bit currently seems to top at 256KB Flash, 8KB RAM. I would say that RAM is too little.
RAM is definitely too little. I would also say that the Flash is too little, at least after playing a bit with GCC and comparing the generated code size with Thumb code size. The difference is quite large.
AVR 32bit gives 512KB Flash, Ethernet, USB 2.0, SRAM internal 32/64KB or via external bus. That is maybe too much.
It's just right if you ask me :)
Best,
Bogdan
Bogdan Marinescu kirjoitti 9.2.2009 kello 16:31:
I see they have some parts with 256k of Flash/32k of RAM, so the
answer is a definite "maybe" :) I'm not at all familiar with the dsPIC
architecture, so I can't say if the code would fit in their 256k of
RAM. Also, I'm not at all familiar with their compiler support
libraries (are they ANSI C compliant? POSIX maybe?). It depends a lot
on the toolchain (eLua will eliminate this dependency at some point in
the future by providing its own libc/libm, but probably not anytime
soon).
For the "best micro we could use part", it depends on your
requirements. If you want to do DSP, there are some very good and
cheap parts available from TI (and probably others, but I'm only
familiar with TI DPSs). If you don't need DSP, just pick an ARM or
Cortex-M3 core with at least 256k Flash/32k RAM (I'd go for 512k/64k
personally), you can probably find them as cheap as (or even cheaper
than) the dsPIC. Look here for a list of the platforms currently
supported by eLua:
http://eluaproject.net/en/Status
Best,
Bogdan
On Mon, Feb 9, 2009 at 4:23 PM, RJP Computing <rjpcomputing@gmail.com> wrote:
Hi,
I am not that familiar with embedded programming, but at my work we are
looking into running Lua on an embedded platform we use internally at the
company. My question is: Can Lua run on a dsPIC33F micro? If not what is the
cheapest and best micro we could use? Any suggestions and help would be
great. Thanks.
--
Regards,
Ryan