Go Down

Topic: Arduino -like syntax on ARM mcu (Read 12792 times) previous topic - next topic


I have started Xduino project at www.xduino.com to extend Arduino-like platform to other hardware. Currently Xduino v0.11 has been released (thanks for feedback for v0.1) with support for ARM Cortex-M3 mcu (other hardware platform will be added in the future)

With Xduino users can program on ARM Cortex-M3 ST32F10x platform with familiar Arduino language look and feel. Although there is no IDE available yet, your favourite ARM Compiler to do the job. (There are several toolchains out there even free ones like gcc.)

Note: not all Arduino syntax is supported yet as it's in very much initial stage.

Please let me know if you have a chance to test.
From http://www.xduino.com/arm-cortex-m3/
Code: [Select]

/* Xduino library initialization */
#include "main.h"

int LedPin = PB7;            // as labelled on your ARM Cortex-M3 board

int main(void)

     doInit();                         //Initialize

     Serial1.begin(115200);       //USART1
     Serial1.println("Starting Xduino example...");
           for(int i=1;i<=10;i++)

           } else {
                       Serial1.print("Character ");            //print string
                       Serial1.print(Serial1.read());            //print single input character
                       Serial1.println("...");                  //print string with new line

(The example has been updated to reflect the latest set of syntax compatibility)


Looks great. Will be interested to see how this progresses.


Hi, thanks for the kind comment : -).
Xduino v0.3 has been released it now support all Arduino command on Arduino References and Extended references page except for analogReference() command as it has not been tested on board with Vref pin.

On top of general Arduino functions, other features has also been added like:
-setting Rx Tx buffer size independently on each port
-Serial1.printf() style command which takes C/C++ printf format of up to 5 variable parameters.
-pause() and pauseMicroseconds() which can be used within interrupt routine to approximately delay  millisecond/microseconds
-full C/C++ math.h and stdlib.h support, etc.
-endless possibilities of C/C++ library inclusion.
-Analog read and write of 12-bits accuracy (0-4095).
-Analog write function with real analog output and not PWM
-Up to 16 digital RISING/FALLING/CHANGE interrupts

(In this version Keil RV-MDK example project file has been included.)

Example program can be seen at the http://www.xduino.com/project-library/ page.

Thanks for your kind feedback.


Nice project!

I have a ARM720T-based board... how difficult is it to support this chip?

What abaout Parallax Propeller mcus or PICs?


Hrm, might i point out this as a possible chip to support. It happens to be built already arduino shield compatible based on similar designs to the arduino pro. I gave some thought to buying it before but havent really had a purpose for it yet. http://www.sparkfun.com/commerce/product_info.php?products_id=9257


Thank you for the comments : -)

bohne: I have just checked the ARM site for the ARM720T and found out "The ARM720T processor has been superseded by the ARM926EJ-S processor." It is still possible to get Xduino working on it, a lot of coding is required. Also, since it's being 'superseded' I am not sure if it's worth the effort doing the coding which might not get used so often in the near future.  >:(

Knuckles904: The board you have mentioned only contains 32KB of Flash and 8KB of RAM.

We are more inclined towards newer mcu with lower cost such as those in the ARMcortex-m3.  The board we have tested Xduino on is with ARM STM32f103ret6 72MHz (as of today), 512kbytes of flash and 64kb of RAM, 48 General I/O pins, 16 ADC channels 12bits, 2 DAC channels (not PWM) 12bits, etc etc with exactly same price-tag.. I think newer Cortex-M3 mcu already has built in Ethernet, once we get a hold of that then Xduino will move towards supporting that too.

The next release of Xduino should also contain C/C++ IDE as well as support for commercial IDE (now supporting Keil and IAR) depending on user's preference.

Thank you for your kind suggestions! the more the better! : -)


Aug 12, 2009, 12:43 pm Last Edit: Aug 12, 2009, 12:46 pm by Nachtwind Reason: 1
how... compatible is the xduino to arduino? From what i see there is not much porting involved but i guess several libraries and functions will not work or react as expected..
I am really keen on this project and would like to know how 'ripe' this is for developers. Can i, more or less, already do the same that is doable with the arduino or are there any key aspects missing?

How do you upload stuff? I read rs232 several times, but does it have a rs232 connector on board or maybe even an USB i cant see on the pic?

*finger hovers over the buy button*


Aug 12, 2009, 01:35 pm Last Edit: Aug 12, 2009, 01:36 pm by fog007 Reason: 1
Nachtwind: thank you for the very useful direct question : -)

Let me first address the hardware issue about RS232. Yes the board has 5 serial ports and the first one is connected to MAX3232 chip which can be used for both firmware uploading and standard communication of up to 115200bps. The tool for uploading is generally provided by the board-maker, so this is no problem.

From the software point of view if you have checked out the "Project library" section it will show you some examples (which I believe is extremely close to Arduino syntax except the pin-number differences)
Also the difference will be the IDE in which you can use free trail of Keil or IAR.

The opensource IDE which will be packaged with Xduino is pretty complete as of today, just have to pack it together and make sure that others (not just me) can run it.

Let's compare by example from Ladyada.net Lesson 3 page:
Arduino's blink

Code: [Select]

int redPin = 12;                  // Red LED connected to digital pin 12
int greenPin = 11;                // Green LED connected to digital pin 11

void setup()                      // run once, when the sketch starts
 pinMode(redPin, OUTPUT);        // sets the digital pin as output
 pinMode(greenPin, OUTPUT);      // sets the digital pin as output

void loop()                       // run over and over again
 digitalWrite(redPin, HIGH);     // sets the Red LED on
 digitalWrite(greenPin, HIGH);   // sets the Green LED on
 delay(500);                     // waits for half a second
 digitalWrite(redPin, LOW);      // sets the Red LED off
 digitalWrite(greenPin, LOW);    // sets the Green LED off
 delay(500);                     // waits for half a second

And now Xduino's blink
Code: [Select]

#include "main.h" //ADDED
using namespace compatArduino; //ADDED
int main() { //ADDED
doInit(); //ADDED

int redPin = PB2;             // Red LED connected to digital pin PB2
int greenPin = PB1;         // Green LED connected to digital pin PB1

pinMode(redPin, OUTPUT);        // sets the digital pin as output
pinMode(greenPin, OUTPUT);      // sets the digital pin as output

while(1)  //void loop() replaced by while(1)
 digitalWrite(redPin, HIGH);     // sets the Red LED on
 digitalWrite(greenPin, HIGH);   // sets the Green LED on
 delay(500);                     // waits for half a second
 digitalWrite(redPin, LOW);      // sets the Red LED off
 digitalWrite(greenPin, LOW);    // sets the Green LED off
 delay(500);                     // waits for half a second


So you can see the number of differences  ;D .
It is still possible to make it exactly look and feel like Arduino when it comes to setup() and loop(). However, I am still debating to make it that way or not. What do you think?


From what i read and guess you will write an open source IDE anyway - so why stick to one of the two? A distinguition between a sketch having just a main() or one having setup() and loop() isnt hard to make - so why bother to have just one instead of doing both? One way or another code has to be parsed - so you could check on compilation which case there is..

I really like the 'new' way a sketch looks - so it seems it's quite compatible, indeed if i had read your page more closely i wouldnt have needed to ask the question as you write several times that the functions are to 99.99% compatible and ported..
That whole thing looks increadible - especially as the price for your board is even less then the price for a duemilanove (in germany) - including S&H...

When do you think you will have the IDE ready for testing? I would like to participate in that ,0)


Wow, I'm drooling over the additional I/O and power of that chip.

I could care less about having setup() and loop() functions.  The main thing that would hold me back is a lack of additional libraries. It's one of the huge advantages of the arduino... it's just so simple.

The other thing I'm not seeing is a schematic. Often, after developing something with an Arduino, I'll create my own PCB. Do you plan on releasing schematics for the board? That'd be a deal-breaker right there.


Aug 23, 2009, 07:31 pm Last Edit: Aug 23, 2009, 07:32 pm by gbulmer Reason: 1
JustinHoMi - I believe the board is made by ETT in Thailand and is an ET-ARM STAMP with either a 512K or 128K STM32F103.

The schematic is here.

I believe it is a proprietary design.

I have one. They are nice little boards, missing USB, but lower price than an Arduino.



Ram - Are you really writing a new IDE, or using the Arduino-IDE as a base?

A new IDE seems like a lot of work when there are lots, and lots already available. What will it provide that the existing IDE's, like Arduino-IDE don't?



...at least toggable Shift+Backspace? ;0)

Anyhow - noone of the xduino crew ever answered my buy request - do i have more chances getting one here? ;0)


This is quite intriguing. I have seen another group doing this http://blogs.leaflabs.com/?p=91
Yay for multiple options. ;)



Yes!!! the IDE is at the final stage now.. just testing on other machines to see if the installation/building goes smoothly.

Nachtwind I didn't respond to you as the IDE was not ready and you were waiting for that : -). One other person emailed me was that you as well? If so, I did reply, sometimes these email with pricing detail get stuck in email filters. Please send a private message on here as well if possible.

About the IDE, I thought about using other IDE such as eclipse, netbeans, etc. But those are too complex. Soon you'll see Xduino IDE which will be much more simpler than eclipse. Also, I did check with other programmers about making eclipse plug-in to make things more simple such as project templates, adding hardware options, etc etc. and what I have been told confirmed what I had in mind which was that a lot of things in eclipse are not well documented yet. So I did write that option off. I could manually compile in eclipse but setting it up takes about 5-6 steps making it not so suitable for a lot of users.

I plan to release the IDE for windows platform this week. The Linux platform should follow shortly unless there are some hidden wall that I cannot think of yet. I must thank you for your feedbacks as well as other feedbacks. Keep them coming so I can keep improving.... Yay!

Now... who doesn't want a 72MHz board?  :D

Go Up