Concurrency? Anyone tried this?

Sounds interesting… Concurrent & Parallel Programming for Arduino

http://concurrency.cc/

unfortunately only MAC versions available for download. Any MAC users tried it?

Cheers,
Pracas

I read the intro of their getting started guide just now. Seems “interesting”, but from what I understand, all they are doing is emulating parallel processing on the arduino efficiently. My main issue is that I can’t tell if you can still use usual arduino C syntax or if the entire code structure is different when using concurrency for arduino

We’re working on finishing easy installers for all platforms. Windows is coming next, and will be done soon.

When you use our tools, you’re programming in a completely different language. The language is called occam, has been around for a long time, and makes it straight-forward to express concurrent/parallel ideas in code. For example, reading from multiple ADCs while handling interrupt-driven serial IO is no more complex than blinking two LEDs in parallel at different rates.

While you are using a different language, we do leave the Arduino bootloader intact. This means you

  1. Upload our runtime once (as a sketch, as it were).
  2. Upload your bytecode (also as a sketch, so to speak).
  3. Repeat #2 as many times as you want.

If you decide you want to upload a C++ based sketch from the “native” Arduino environment, then do so. If you “switch” back, you have to upload our runtime again.

In short, it’s not a painful experience to explore another language on the Arduino. We made sure that the exploration does not require you to “give up” the way an Arduino owner already does things.

Hope that helps.

I’ve only lightly skimmed the site (and will look at it more closely later); but can you upload your runtime to replace the Arduino bootloader (and regain the 2k)? You can do that with a regular sketch and an ISP programmer, so in theory you should be able to do so with your stuff.

Seems like an interesting concept, something I will follow, even if I can’t use it immediatly (on Ubuntu)…

:slight_smile:

When you use our tools

Is it yours or OURS? :wink:

@pracas: Good question!

On one hand, I’m a co-author of the concurrency.cc tools and website. Hence, I think of the tools as OURS.

On the other hand, all of the tools involved in providing occam and the Plumbing libraries on the Arduino are LGPL/GPL/Creative Commons licensed, so perhaps those tools are YOURS.

:slight_smile:

Or, perhaps I meant a more inclusive version of “ours,” which included everyone in the first place. (Or, perhaps we’re having fun with words, and it’s fine either way.)

@cr0sh:
About the bootloader: I imagine we could use an ISP to replace the Arduino bootloader with our own runtime. We haven’t simply because we wanted to make sure the new language could be used by anyone without having to worry about how to “get back” to the Arduino-compatible environment they started with. That, and we haven’t had a particular need (eg. the 2K of flash hasn’t yet been something we were desperate for, so why bother? If it becomes an issue, then we’d certainly want to look at making it easy/documenting how.)

Also @cr0sh:

If you’re comfortable doing the build yourself (on Ubuntu): you can check out the Subversion tree and follow the instructions here:

http://projects.cs.kent.ac.uk/projects/kroc/trac/wiki/CrossBuilding

and end up with something that works just fine.

Or, you can use the script I wrote to build a complete cross-compiled Linux toolchain:

http://projects.cs.kent.ac.uk/projects/kroc/trac/browser/kroc/trunk/distribution/opt-avr

This is in the tree when you do a checkout. If you do this, join the users@ or dev@ mailing lists and ask for help if you get stuck.

When we do the packaging for Linux, we’ll instead provide a Debian/Ubuntu package as well as a Fedora package. It’s just a matter of time.

I know this is resurrecting an old thread, but I’ve just got this lot working on a 2009 (3 LEDS all blinking away concurrently). Built it from source via the svn checkout method described above. All pretty straight forward. This is on Xubuntu 10.04, 64-bit.
Even found an occam-mode.el for emacs; so happy, happy :slight_smile:

We now have binaries for Mac and Windows (including a JEdit IDE), and I’m in a position where I simply don’t have build machines for all the Linux flavors out there. Once we get 10.04/64-bit into the regular build mix, you’ll be able to add us as a source, and get auto-updates.

Thanks for the report that everything is good to go. We’ll be updating some more things this coming weekend – it’s “fall break” – and most of the updates will be documentation related.

If you have questions, please ask away on the users@concurrency.cc list. We’re happy to help.

I don’t know if this thread is still live…
I have installed the latest Windows version and attempted to get going.
The very first test was to simply blink an LED. It didn’t work and so I changed the connections assuming that a low would normally be supplied from the Arduino, not a high. That didn’t work either.

I did set the com port, compile and download. The Tx Rx leds flickered indicating transmission. However the message I got from the plugin was…
avrdude.exe: stk500_getsync(): not in sync: resp 0xa0
avrdude.exe done. Thank you.

Not having used avrdude I am now unaware as to whether that means the transmission got screwed or not and what to do about it if it did.
The normal communication has been working fine under the IDE.

Can anybody please assist?

Hi donone,

Could you join the users mailing list for our project and send us that information there?

http://www.concurrency.cc/docs/mailinglists

That would be the best thing to do, as the entire team is there. We’re going to need more information from you than you’ve provided here for us to help you get going, but it should be very straight-forward. (The standard Arduino environment uses avrdude, so you have used it before… they just hide some error messages and not others.)

donone

Did you try the somewhat obvious; disconnect/reconnect the arduino USB and give it another go?

The Linux version seems to “get stuck” sometimes , but this clears it.

Thanks for the response. Yes I did join the group but did not post.
Yes I did try several times plugging and unplugging to no avail.
I will post to the group Sunday.

I can’t get this to work at all. It seems to go through the motions without error, but the Lilypad just sits there, unchanged, no matter what I do.

Hi Ian,

No one on the team has a Lilypad, but this could be my excuse to get one.

Tell me what you’ve got, and we’ll work with you to get you up-and-running. Also, I’d encourage you to join our mailing list and continue dialoging with us there. We can get you sorted out.

And, if you join the list and tell me what Lilypad to order, I’ll get one and make sure things work on it.

Cheers,
M

If you end up getting one, go for the “LilyPad Pro Kit”, which works out better value in the long run, as it includes the power supply and FTDI breakout board and comes to about roughly what it would cost with only one or the other of those latter items.

Also, for prototyping (prior to sewing), I suggest getting crocodile clip leads from Maplin (expensive) and not some cheapo ebay seller (about a tenth of the cost) as the cheap ones fall off because they don’t close effectively (somewhat of a prerequisite, I’d have thought). In my experience, anyway.

The Lilypads I use are not the newer lower cost simplified one (which I would have got if I’d have known back then that it was going to come out in the future). Mine are based on an Atmega328, clocked at 8MHz with an external resonator, led on digital13 (PB5 physical pin 17) and runs on +5v (which the AAA battery power supply pumps up to). Connection to USB is via the FTDI breakout board, which has DTR, which connects to the atmega reset line via 0.1µF cap.

I saw the mailing list but the signup page is ugly and I don’t really want my email account being occupied or diluted by goodness knows who and how many messages, all of which really should live somewhere else that I can read by more modern methods (eg Google Reader) when I choose to.

I’m sorry you don’t like our mailing list. It’s a standard Mailman mailing list that you can easily subscribe/unsubscribe from. The user list is low volume. We’re a small, distributed team, but we’ll take it under advisement that a forum of some sort would be preferable.

I haven’t done any testing on 8MHz Arduino-compatible boards, which is where you ran into trouble. I think you’re the first person to request it, hence why support wasn’t there in the first place. We’ll get something in our hands, test, and push a new build that should support the Lilypad without any difficulty.

If you want to know when we’ve done that, watch our blog (which you can subscribe to in Google Reader) or our Twitter feed (@concurrencycc).

I’m using Windows XP and have tried to get just the first three examples to load and run without success. The TX/RX LEDS flicker and the LED on pin 13 flickers initially but that’s all. Also, I had to add the COM entry on the occPlugin manually, as the drop down list wasn’t populated.

Oh I see, so it does actually work on other Arduinos other than the Lilypad? I didn’t realise. I’ll have to try it on a different type of Ardiuno next weekend (although of course the Lilypad is the one that will actually be used in the end). Thanks.

I’m feeling a bit foolish at the moment. It does work! I didn’t realise that I needed to upload the Plumbing firmware. The documentation regarding this is a bit scarce, especially in the guide book.
There are still some issues with the plugin, the drop down list of serial ports and the reluctance of it to let go of the serial port but they are tolerable, so now I can get down to the serious matter of playing with it. :slight_smile: