Shop OBEX P1 Docs P2 Docs Learn Events
Arduino libraries. — Parallax Forums

Arduino libraries.

Martin HodgeMartin Hodge Posts: 1,246
edited 2011-12-03 22:51 in Propeller 1
Now that we are beginning to have a workable build environment with some c++. Is it time to discuss this?

Comments

  • Kevin WoodKevin Wood Posts: 1,266
    edited 2011-11-28 04:18
    I'm planning to clone the functionality of either the Arduino or Wiring libraries. Arduino is based on Wiring, so there's much overlap, but some differences still exist. Right now, I'm leaning towards Wiring, but I need to do some more poking around the code first.
  • blittledblittled Posts: 681
    edited 2011-11-28 09:20
    If you go with Arduino Libraries would it be too big a leap to try to make a port of the Arduino IDE to run it. I have a Diligent Uno32 (collecting dust) and Diligent is doing a port of the Arduino ide to pic chips with moderate success. If we paired that with Martin's Propeller ASC we may lure some Arduino people over to the Propeller :)

    I do feel we need to make some sort of library that handles some of the IO of the propeller to ease the transition from Spin and other implementations of C on micro-controllers.
  • jazzedjazzed Posts: 11,803
    edited 2011-11-28 10:09
    Martin, I think we can make ASC a great alternative. Do you have a propeller loader plugged in to the IDE?
    blittled wrote: »
    I do feel we need to make some sort of library that handles some of the IO of the propeller to ease the transition from Spin and other implementations of C on micro-controllers.
    I agree with this. Would be nice to make a PBASIC-like library. Your thread already mentions some of the functions required. Please continue.
  • Martin HodgeMartin Hodge Posts: 1,246
    edited 2011-11-28 12:52
    jazzed wrote: »
    Martin, I think we can make ASC a great alternative. Do you have a propeller loader plugged in to the IDE?

    I've gotten as far as cloning the Arduino source from github and starting the build. It doesn't really build anything. It seems to simply launch a Java VM and bring up the GUI. From there, if I'm reading right, the GUI simply calls avr-gcc and links in various libraries. (avr-gcc is installed from rpm/deb on most distros.)

    Right now I'm having some problems with git wanting to load up over 900MB of unknown "stuff" the /.git directory.

    The repo is here
    Build instructions here
    What the Arduino does to build a sketch, here
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-11-29 16:35
    This is a very interesting thread. Superb work and well done!

    What is the prototype code? Would it be to take an Arduino sketch that reads a pushbutton and lights a led, and take that code and drop it into another IDE (or the Arduino IDE) and plug in the Propeller ASC and the circuit works exactly the same?

    If you could do that, then it would open up many more potential customers to the propeller.
  • jazzedjazzed Posts: 11,803
    edited 2011-11-29 18:27
    Dr_Acula that's the basic idea.

    Martin, sorry that I haven't had any time to work on it yet.
  • Martin HodgeMartin Hodge Posts: 1,246
    edited 2011-11-29 20:40
    Dr.A, exactly. A friendly invitation to Arduino users to explore the Propeller without being intimidated by a new language and IDE.

    Jazzed, you have more important things to do right now. No need to apologize. I'm surprised to learn that you had considered working on it at all actually.

    I'm going to be spending a lot of time playing catch up to you guys on the coding. If there is anybody doing work on it (Kevin?) I'd only ask that a repo be set up, on your choice of host, so that I can watch and learn. I can supply a free ASC to up to five individuals who're seriously considering working on it. A good candidate for testing and development might be the Danger Shield, which is a conglomeration of basic IO devices like pots, light & temp sensors, buttons, LEDs and a shift register. It's cheap and exercises all of the ASCs digital and analog IO.

    Just tossing up ideas.
  • blittledblittled Posts: 681
    edited 2011-11-30 09:33
    Martin,
    What you propose is intriguing. As I am developing the "PBasic" style library I see a lot of functions that could easily be ported over to the Arduino Library. It gets tricky though when you start dealing with the differences between the Propeller and AVR chips. For example how will we do AttachInterrupt to the Propeller chip? On the flip side many of the Arduino functions will be deterministic since there are no interrupts to slow down timing loops.

    Since the libraries are set up for interrupts we would probably have to "hide" the cog operations from the user. This may give the illusion of having no big advantage since the user won't see how the cogs improve things. Also we would have to determine which routines would actually be in cogs. Some like serial communications would most definitely be in a cog but would we really need to put the Tone function into a cog?

    I'm very interested in this project but I first need to get the library I started done and I probably wouldn't be able to get involved until shortly after the holidays.
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2011-11-30 22:12
    Martin, I'm willing to work with you on the project. I was already thinking about contacting you about it before it came up, so I suppose there's no reason not to get involved.

    Anyways, I guess the main question to answer at this point is what is / would be the scope of the project? My understanding is that the Arduino environment is a fork of the Wiring environment, modified for the Arduino hardware (more info...). So are the plans to create a new fork of either environment, or to develop the functionality that can be merged back into the source project?
  • Martin HodgeMartin Hodge Posts: 1,246
    edited 2011-12-01 08:42
    My thinking was to follow what Digilent did for the chipKIT with mpide. The GUI is identical and you can run Arduino sketches on it. As to your main question, I don't know. For greatest compatibility would it make more sense to work from the Arduino fork? It may seem like going backwards, but I'm shooting for greatest compatibility over peak performance. At least in the beginning. This is still up in the air in my mind, so you could provide some persuasive arguments one way or the other.
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2011-12-02 07:56
    Martin - I spent some time looking at the Arduino, MPLAB, and Wiring IDEs. My thought is that the best choice at this point would be to collaborate with the Wiring project to add Propeller capability.

    Here's why I say this. From much reading, I surmise that the Arduino project isn't very interested in stuff that isn't an Arduino. This has led to a few different projects forking the Arduino code, such as with MPLAB. If we were to fork Arduino or Wiring, we would either need to maintain everything that our fork supports (including non-Propeller stuff), or strip out everything non-Propeller, and maintain that ourselves. We would lose the support of an already established project.

    If we collaborate with the Wiring project, we should only need to contribute & maintain the Propeller stuff. This would give us access to a project that, for lack of a better way of saying it, knows what they're doing. :) I think that guidance at this stage would be a big help. The Wiring project seems intent on supporting multiple processors, and have plans to add ARM, PIC, and TI's 430?? chip, etc.

    As for comparability with PropASC... I don't think it would be an issue. There's already a certain amount of work that would need to be done to account for the Propeller vs Atmel hardware differences. Stuff from the Arduino project, license permitting, could always be backported to Wiring if needed, or most likely, we could develop an analogous library. Wiring does currently support the Arduino, but not to the extent that Arduino does.

    The other benefit I see for supporting Wiring is that we could develop a process to add other Propeller boards, such as the demo board, C3, etc., to Wiring.

    I think that the biggest negative to Wiring is that it's not as popular as Arduino, so there's some name recognition lost there. I don't think that would matter much. We would still end up with a similar "system". And if for some reason down the road forking became necessary, that option would still be there.

    Anyways, as I said, I'm still wiling to work with you, whatever your thoughts or decision. I'm planning to contact the Wiring folks for some feedback, and if it's positive, I'll go from there.
  • jazzedjazzed Posts: 11,803
    edited 2011-12-03 09:40
    Kevin Wood wrote: »
    Martin - I spent some time looking at the Arduino, MPLAB, and Wiring IDEs. My thought is that the best choice at this point would be to collaborate with the Wiring project to add Propeller capability.
    I support Kevin's solution. Being able to use Wiring directly will be much easier for software maintenance.
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2011-12-03 11:48
    Okay, I sent an email to the Wiring developers, and I'll let everybody know what they say.
  • Martin HodgeMartin Hodge Posts: 1,246
    edited 2011-12-03 12:40
    It looks like you have much better of a handle on this than I do at the moment. So let's go ahead with Wiring.
  • Dave HeinDave Hein Posts: 6,347
    edited 2011-12-03 18:53
    If we ignore the IDE for the moment, doesn't Wiring or Arduino support just require implementing the functions used by those environments? Basically, the goal is to compile and link Arduino or Wiring source without any changes. So it really comes down to implementing each function in the Wiring and Arduino libraries. This doesn't sound too hard. Am I missing something?
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2011-12-03 19:19
    Okay, I got an initial reply from the Wiring folks. I'm posting my email and the reply. I expect that more details will be available in a few days or so, and I'll be able to put together some form of proposal / roadmap / powerpoint / start soliciting conference speakers / etc. :)

    Dear Kevin, we definitely would like to add it, this is very exciting. For sure we can provide the needed guidance to support your community etc. I am forwarding this message to Brett and Alexander to start.

    best regards,
    Hernando.

    On 12/3/11 2:45 PM, Kevin Wood wrote:

    Hello Wiring dev team,

    I'd like to find out what is involved with adding a new microcontroller platform to Wiring? The microcontroller in question is the Parallax Propeller. Parallax has commissioned a team of developers to create a Propeller port of GCC, and the work is going well. If possible, I'd like to have Propeller support added to Wiring rather than creating a fork of the Wiring or Arduino platform just to get a similar environment.

    If the Wiring project is open to adding platform support for the Propeller, what would the Propeller community need to provide? There's no expectation of having Wiring do the work, but rather providing guidance as needed to the Propeller community.

    Also, can you tell me if there is anything in the Wiring licenses that prevent using the IDE or libraries for commercial applications? The current state of the Propeller community is that most Propeller code is licensed under the MIT license, which allows for use in commercial projects. As such, if Propeller support is added to Wiring, I'd like to make sure that the community was clear on the licensing.

    Any info that could be provided would be appreciated.

    Thanks.
    Kevin Wood
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2011-12-03 21:51
    Dave Hein wrote:
    If we ignore the IDE for the moment, doesn't Wiring or Arduino support just require implementing the functions used by those environments? Basically, the goal is to compile and link Arduino or Wiring source without any changes. So it really comes down to implementing each function in the Wiring and Arduino libraries. This doesn't sound too hard. Am I missing something?

    My plan was to create a set of functions / classes that followed the Wiring or Arduino syntax, but weren't necessarily compatible. Sketches would maybe run, but at minimum the setup()...loop() syntax would need to be rewritten into a proper C++ program.
  • jazzedjazzed Posts: 11,803
    edited 2011-12-03 22:51
    Dave Hein wrote: »
    If we ignore the IDE for the moment, doesn't Wiring or Arduino support just require implementing the functions used by those environments? Basically, the goal is to compile and link Arduino or Wiring source without any changes. So it really comes down to implementing each function in the Wiring and Arduino libraries. This doesn't sound too hard. Am I missing something?
    The problem may just come down to replacing/adding the libraries and the device loader. Regardless, any code developed would probably be leverage-able in either environment. I would be mainly concerned about being having to wait for someone else and/or being blocked from a release for some reason.
Sign In or Register to comment.