Shop OBEX P1 Docs P2 Docs Learn Events
Is the Javelin Worth it? — Parallax Forums

Is the Javelin Worth it?

JohnnyVJohnnyV Posts: 5
edited 2004-08-20 18:28 in General Discussion
I bought the BS with board of education kit for a class I took and have loved playing with the basic stamp, and even made my own robot. I have always had in intereset in electronics and I'm considering switching my major to electrical enginnering (I'm currently a physics major). I was thinking about buying a Javelin but they seem awful pricey to me at 89 bucks. Is the Javelin really worth it? How easy is java, I've never used it. Does the manual do a good job explaining java? Is the java used by the Javelin the same as the 'computer version' or is it modified? I feel that the BS is limiting my robotic projects being able to only excute one line at a time. I want to be able to sense and at the same time have the robotic platform moving.

Thanks,
John
ThinkTwisted.com

Post Edited (JohnnyV) : 8/13/2004 5:21:17 PM GMT

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-08-13 17:27
    You can download any of our product information at no charge -- everything we (Parallax) publishes is avaiable as a PDF. What you'll find is that the Javelin uses a subset of the Java that runs on your PC. One cannot compare the horsepower you have on your PC with the 8-bit micro that forms the core of the Javelin, hence the differences.

    The manual assumes you understand Java and spends more time of the specifics of the Javelin. There are over 2000 books in print on programming in Java. It would be a bit silly for us to repeat what's already available.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • J. A. StreichJ. A. Streich Posts: 158
    edited 2004-08-13 23:58
    I don''t know much about the Javelin, but I know a bit about Java, so this is just my take on it.
    Java is a very simple language to pick up, if you have programmed in C++... The big difference between PBasic and Java is object orientation. In java everything is an "object" which means that your code is at a much higher level. If your a hardware person and don't plan to do much CS stuff (and coding for the basic stamp isn't as much fun as building circuits) then Java may not be your cup of tea; however, if you do some coding as well (or writting software was more fun than building the circuits) then it may be worth while to pickup some Java tutorials.

    Also a helpful rescourse to remember the Java docs are at http://java.sun.com/reference/api/index.html ...



    As far as the Javelin goes, does it support threads? And more importantly, can I upload programing to it from a *nix box?
  • JohnnyVJohnnyV Posts: 5
    edited 2004-08-14 01:03
    That was the other thing I was wondering, can I upload code with my linux box? I can use WineX to upload my BS code.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-08-14 01:15
    The Javelin is single-threaded and the IDE runs in Windows.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • J. A. StreichJ. A. Streich Posts: 158
    edited 2004-08-14 04:02
    Ah, so the JVM doesn't have thread support, that means if I wanted to use them I'd have to implement them in code... I suppose there isn't anything stopping me from implimenting them in PBasic either... *thinks a moment* ... I suppose that would be base of a sort of kernel... Grrrr, if only there were more hours in a day...

    <EDIT> I suppose that would require me to invent some type of intrepreter or invent a "eval" sub routine. It's a lot of work, and I think it would only slow down the chip no mater what microprocessor I was using. The context switching algo would be active way to often. </EDIT>

    I know the IDE runs in Windows, but there is a tokenizer and such for the BASIC Stamp that can be complied for Linux/BSD and the like (open source, and uses your freely avalible tokenizer library); I was wondering if there was such software already. Is it possible to compile with a standard Java compiler and send the byte code to the stamp?

    Post Edited (GameMaster) : 8/14/2004 4:07:27 AM GMT
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-08-14 12:43
    I suppose it is possible, since the IDE actually calls an external compiler. What the IDE does is provide a editing, programming, and debugging environment.

    Another important note for you desktop Java programmers is that the Javelin does not have garbage collection.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Magnus LundinMagnus Lundin Posts: 1
    edited 2004-08-14 14:38
    It is possible to edit, compile, link and upload programs to the Javelin from Linux.
    It is also possible to control start/stop/singlestep programs running on the
    Javelin from Linux.
    It is not possible to get full debug support linking the executing code
    on the Javelin to the Java source code. If parallax publishes more tech info on their linker,
    and sombody has the time, then this should be doable.

    The compiler ( jikes v 0.4.7 ) can be run under wine and can also be compiled
    into a native Linux app, but the old code must be slightly patched before it compiles with a
    modern c++ compiler ( I use gcc 3.3.3 ). Sun njava compilers or newer versions of jikes
    does not seem to work.

    The linker , JavelinDirectL , is supplied by Parallax in Linux version on the yahoo file area.

    I wrote a downloader and run controi in python using the Parallax c++ code as a base.

    I created a raw but working package - javelinLinux.zip
    and posted it to the old yahoo file area some months ago
    http://groups.yahoo.com/group/javelinstamp/files/

    There has been no response so I havnt put any effort into updating this package yet.

    Magnus Lundin
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2004-08-14 14:38
    I don't think you can compile using another compiler.
    You should compile from within the IDE (due to native methods
    only known to Javelin).

    Then you can download from linux using the file
    JavelinLinux.zip located here:
    http://groups.yahoo.com/group/javelinstamp/files/

    There is also a downloader package here:
    http://groups.yahoo.com/group/javelinstamp/files/Software/Downloader/


    regards peter
    ·
  • allanlane5allanlane5 Posts: 3,815
    edited 2004-08-15 18:25
    The Java language the Javelin IDE supports is a subset of the full Java, but it uses the same Java bytecodes as everyone else.· You will have to compile it under the Javelin IDE, since there are some 'hooks' into the underlying microprocessor which are Parallax proprietary.

    However, it IS 'real' Java, minus threads and garbage collection.

    The underlying microprocessor is a Ubicom SX28, which supports 'pseudo-peripherals'.· The chip runs so fast, that there are pre-built hunks of assembly code, which run under the interrupt handler, to implement serial ports, timers, etc.· Thus, your program CAN do something else (like decide which way to turn) while still recieving data.

    Java is quite a capable language -- so the learning curve from PBasic to Java can be steep.· The Javelin module IS fully BS2 pin-compatible, so all you would have to do is purchase the module, download the IDE, install the module in your BOE board, and go for it.

    And you get EXCELLENT bragging rights, if you program you 'Bot in Java.· This is considered the cool language of choice right now, up there with C++.
  • KenMKenM Posts: 657
    edited 2004-08-16 00:33
    Another consideration is the SX chip itself. You program in assembly. As with all the Parallax Basic Stamp products, documentation is good.

    The SX can run much faster than any stamp, handles interupts......capable of doing two tasks at once. Actually it can do only one thing at a time, but running at a clock speed of 50 MHz, it has the appearance of doing two things at once.

    Be warned though, programming the SX is not nearly as easy as a stamp, but if I learned you can too.

    $$$$$$.......what is your time worth? An SX with resonator costs less than $8 US dollars. But you WILL spend consideably more time to get your SX program running. There is also a one time investment in the SK-key, $89 last time I checked.

    I have not used the JAVA Stamp to comment with certainty on Java Stamp speed vs SX speed, but am fairly confident the JAVA or any Stamp cannot come close to an SX for raw speed. But again, getting the SX program working is definately more of a task.

    One of the nice features about the SX, if you also get the SX key from parallax, is the ability to single step through your program, one instruction at a time. For programming hacks such as myself, this is an invaluable tool to debug a program.

    My 0.02 cents

    Ken
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-08-16 00:55
    Of course a Javelin (running a small JVM) will not ever run nearly as fast as an SX programmed in assembly language. The purpose of the Javelin is to allow Java programmers to get into the embedded world with a language that they're already comfortable with.

    Per you point, the Javelin -- while single-threaded -- can run up to six background processes (virtual peripherals). This allows it to buffer serial IO, maintain a PWM single, run a timer (that can control many others), etc.

    For those coming from a Java or C++ background that want to get into embedded control, the Javelin Stamp is a great way to go.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • edited 2004-08-16 03:18
    If you are new to programming then the BASIC stamp is much easier to get started with.· If you are already familiar with C++ and/or Java, the Javelin is a much nicer processor to use.· I personally feel that it falls between the BASIC stamp and using a raw microcontroller like the SX.· I often use the Javelin to quickly prototype code and then once I have worked out all of the interfacing issues, I move the code to the SX.· This lets me concentrate on the writing of SX code rather than interfacing issues.· The best thing about the SX is that you get full control over the VPs that you use and you can run the controller at rates up to 75MHz.
    ·
  • basicstampedebasicstampede Posts: 214
    edited 2004-08-19 16:27
    Hello all.· I've been using BS2 and its variants with good success.

    I've always wanted to use my Javelin also, but the few times I've tried, I've given up, mainly because of my lack of Java language.· I have done C programming, but not C++, and this whole thing about OOP is really interesting, but I just cannot seem to truly understand it for some reason.

    Can anyone recommend 1 book that will give me a very good foundation to learn Java so I can apply it to Javelin?

    I am hoping that Jon Williams will soon come up with Javelin equivalent for StampWorks (Javelin Works) that teaches Java as it relates to embedded programming, starting from turning LED on/off to interfacing with RTC and ADC etc.· Does anyone know if such a book will be coming out anytime soon?

    Thank you.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-08-19 16:53
    I don't know that I'm going to be able to do the Javelin equivalent to StampWorks, but as time permits I try to port experiments from the BASIC Stamp to the Javelin.

    On learning Java ... there is no shortage of books. Just keep in mind that all of them teach PC-oriented Java so you may need to make some adjustments. I have found, though, that many simple examples from desktop Java books run fine on the Javelin.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • J. A. StreichJ. A. Streich Posts: 158
    edited 2004-08-20 14:36
    O'Reily has good books for everything under the sun, and speaking of SUN so do they.... Java Core programming is a tome with a lot of valuable things, but it is centered arround building software with AWT and Swing (read: stuff with GUIs), so there is probably better choices for learning OOP and Java. Try Dietel and Deitel, I saw they have a new "How to Program in Java"
  • basicstampedebasicstampede Posts: 214
    edited 2004-08-20 16:06
    OK.· I am trying to pick out a Java book.· But, what is Java2 vs. Java (or Java 1.1 or 1.2)?

    Which version of Java book should I purchase to help me use my Javelin?

    Thanks.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-08-20 16:25
    Probably picking up an older Java book will be best, the Javelin uses a subset of Java 1.1. Since you're not going to be doing graphics or those sorts of things, that material (usually in the new books) is of limited value. In Dallas we have a book chain called "Half Price Books" -- I've found lots of cool older Java books there. And, FWIW, one of my favorite authors of programming books is Herb Schildt; look for any of his books.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • DmitriDmitri Posts: 1
    edited 2004-08-20 18:28
    Here is my experience with JavelinStamp.

    1. It is not real java.
    You cannot reuse the code you will write for Javelin anywhere else. This sucks.
    2. It is buggy. I posted complain that CPU.delay() causes unpredictable errors which are fixed by
    something irrational like adding line
    int a=1;
    after a call to CPU.delay()
    Nothing is being done to fix it. (Sounds like Microsoft, huh?)
    3. It is very slow, almost on the border of being usable.
    A simple function call will set you back almost 0.5ms !
    4. It is a memoty hog. Amount of RAM is not enough for anything serious (I'm trying to make a RT-data-logger)

    On a positive side, it is probably a good place to learn about Java micros.

    For my money, now I would go with something like JStik.

    Good luck.
Sign In or Register to comment.