Shop OBEX P1 Docs P2 Docs Learn Events
A few stamp questions. — Parallax Forums

A few stamp questions.

Bob_RBob_R Posts: 5
edited 2004-07-24 03:55 in BASIC Stamp
Hello guys and gals. I'm new to the stamp world and i had a few questions. I know that stamps are cabable of counting pulses, but is it cabable of counting pulses and differentiating the length of·a·pulse from the one before it (to reset the counter) while measuring freqency at the same time? Is a stamp also capable of running 2 or more sub routines at once ?

-Bob

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-07-23 23:33
    No. The BASIC Stamp is single-threaded. You can measure pulses or count them, but you can't do both at the same time (unless they're very wide pulses and you write the code yourself in PBASIC).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Bob_RBob_R Posts: 5
    edited 2004-07-24 00:00
    The pulses would get up to as fast as 100u/sec long, but they would vary in witdh. What I'm tring to do is measure speed and angular postion of a turbine shaft for a project of mine. I'm am reading the pbasic programing book, but I'm not to familar with it yet.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-07-24 00:12
    You won't be able to count and measure at the same time then. You may need to write your code in assembly language or use a compiler.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Bob_RBob_R Posts: 5
    edited 2004-07-24 01:36
    What is the differance between pbasic and assembly language?
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-07-24 02:05
    PBASIC is high-level; very much like other flavors of BASIC. It gets compiled into tokens (similar to Java bytecodes) and downloaded to the BASIC Stamp for execution by the interpreter. The interpreter has to fetch tokens from an external EEPROM (on the module, but external to the PIC/SX), decode them, then run them. This takes time. If you want raw speed, you would used native assembly language on an SX chip (we have tools and training materials for them).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Bob_RBob_R Posts: 5
    edited 2004-07-24 02:14
    Cool. What do i need to get started ?
  • AlWilliamsAWCAlWilliamsAWC Posts: 135
    edited 2004-07-24 02:46
    Have a look at http://www.awce.com/pak7.htm

    Al Williams
    AWC
  • KenMKenM Posts: 657
    edited 2004-07-24 03:41
    Bob,

    I strongly recommend the SX mentioned by Jon. The IC is lightning fast, but programming is not as intuitive as a stamp.· But if I learned, you can too!

    If this is a one time electronics project, hard to justify the cost of a SX key which is a valuable tool to debug and program your SX.

    If you will be doing more and more of this micro controller stuff, learn to use the SX, and by a basic stamp.

    For some of my projects, I will test the program concept and hardware with a basic stamp, then build the real thing with a $4.00 SX compared to a $50 BS2.

    But with that $50 BS2 you gain YOUR time......for me personally, a program on the SX can take 5 times as long to write than the BS2. On the other hand, the BS2 has some limitations with regards to speed and capability.....i.e. do two things at once.

    There are not as many members in the SX forum, or not as many posts, probably because the users of the average SX user is probably a bit more programming savy than the average BS2 user.....that is, almost anybody can pick up a stamp, use the great resources from parallax and be making useful programs in no time at all.....not so easy with the sx (at least for me).

    If you get the SX however, the people in this forum are just as helpful and I recommend a book by Guenther Daubach, sold by parallax...

    blah blah blah....
  • Bob_RBob_R Posts: 5
    edited 2004-07-24 03:55
    Thanks. I will look in to the SX. I will be doing more micro projects as i learn more. I was wanting to do this all on 1 chip and have 3 pulse outputs (one in relation to angle) as well, so i dont think the pak7 will suit my application. At this point in my life, i dont know much about programing but i am very intersted in learning. Looks like i got alot of reading ahead of me. hop.gif
Sign In or Register to comment.