Jump to content
igor

eLua for SAM3 (Arduino Due)

Recommended Posts

I am porting eLua to the Atmel SAM3/4 processors, in particular the SAM3X8E used in the Arduino Due.

 

Port is running, with support for the serial console and several devices.

 

  • PIO - works
  • UART - works, except for buffering (xmodem does not work on serial console).  Hardware flow control written, but not tested.
  • USB CDC - works, except for buffering (although attached build does not use it).
  • Timers - works
  • PWM - works, but has some issues (sometimes the drivers return wrong values to eLua, but it does work).  Have not tested for accuracy of frequency or duty cycle.  So far just uses the hardware pwms, use of timers as PWM (e.g., so can use more pins for PWM) is in the works.
  • spi - written, but not tested (if you try it out, let me know).
  • rand (generate numbers at random) - works
  • rtc - works (but not sure about using external crystal)
  • i2c (twi) - not finished
  • adc - not finished
  • can - not finished
  • cnt (counter) - not finished
  • dac - not written

 

Source code available on github -

https://github.com/ecdr/eluain the SAM branch
To talk to the console, use the programming port on the Arduino Due Usual settings 115200 baud, N, 8, 1You may need to set your terminal program to send a CR and LF as end of line.
You can program the attached bin file to an Arduino Due using the Arduino boot loader (bossac).e.g., if the programming port is connected as COM8 (on windows)
bossac.exe -Ufalse -pCOM8 -e -w -v -b elua_lua_arduinodue.bin -R
Thank you to Sergio at simplemachines.it

For my eLua port for the Stellaris launchpad, see

http://forum.stellarisiti.com/topic/552-elua-for-stellaris-launchpad

elua_lua_arduinodue.zip

Share this post


Link to post
Share on other sites

Where download source code?

 

It is on github in my fork of eLua, in the branch named SAM.

The direct link is.

https://github.com/ecdr/elua/tree/SAM

 

Most of the SAM specific adaptations are in the src/platform/sam34 directory.

https://github.com/ecdr/elua/tree/SAM/src/platform/sam34

 

If you haven't used git it takes a bit of learning, but is really nice when using/managing a large project.

I haven't done much on this recently, but would welcome contributions to the branch.  (Would be nice to get it totally working

and incorporate into the eLua main line.)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×