Shop OBEX P1 Docs P2 Docs Learn Events
newbie — Parallax Forums

newbie

zoidzoid Posts: 12
edited 2011-08-09 13:02 in Propeller 1
Man I am completely lost!
this stuff looks nothing like stamp basic.
I've been studying the manuals for over a week and then try to pick apart some code... huh??????
I tried to play with a led blinking pgm on pg 191,192 in the hydra manual only to discover it has errors in it.
If I try to doodle with that code I get more mysterious errors.
I go to the help section in the propeller tool and click on tutorials....its blank.
Where can I find some decent tutorials?

Comments

  • idbruceidbruce Posts: 6,197
    edited 2011-08-08 12:36
    zoid

    Try this web page, it is for Propeller Education Kit Labs.

    http://www.parallax.com/PropellerEducationKit/tabid/845/Default.aspx

    Scroll down the page until you find "Propeller Education Kit Labs: Fundamentals Book v1.2 (.pdf)", and download this text. This book is very educational.

    Bruce
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2011-08-08 13:14
    The Official Guide is a good start, but it's not freely available. You can preview it on Google books, and it might be enough to help you out.

    You might also want to consider trying PropBasic, which you can use in conjunction with BST. There's also an object in the exchange that mimics the sytax of PBasic, but I don't recall the name.
  • LeonLeon Posts: 7,620
    edited 2011-08-08 13:26
    Try the Propeller Tool Spin Tutorial examples. They start with this very simple program to flash an LED:
    PUB Toggle
      dira[16]~~
      repeat
        !outa[16]
        waitcnt(3_000_000 + cnt)
    
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-08-08 14:00
    I learned a lot from JonnyMac's Spin Zone articles.

    Duane
  • RonPRonP Posts: 384
    edited 2011-08-08 14:09
    I would suggest PE Kit and Labs also its the closest thing to "What is a Microcontroller" for the stamp. The best way of going through the Labs is to also have the hardware set up for the Labs.

    Ron
  • agimuhingagimuhing Posts: 39
    edited 2011-08-08 14:27
    there is a decent spin tutorial in the propeller help

    you can find it on the top menu bar under "Help" and it's labeled "Propeller Help..."
    look in the table of contents for "Spin Programming Tutorial"
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-08-08 14:34
    zoid: There are lots of simple examples to get you going. There is a set of tutorial and examples that come with PropTool. I cannot recall where they all are, so others will help out.

    If you have any problems, post your code (remember to either post it in an attached archived zip file - PropTool will do this for you) or ensure it is between {code} and {/code} tags (replacing the {} with the square bracket kind) to maintain indentation.
  • zoidzoid Posts: 12
    edited 2011-08-08 17:06
    Leon wrote: »
    Try the Propeller Tool Spin Tutorial examples. They start with this very simple program to flash an LED:
    PUB Toggle
      dira[16]~~
      repeat
        !outa[16]
        waitcnt(3_000_000 + cnt)
    

    Um er i typed this in verbatim and... it does not fly. Thinking it refers to the wrong pin, i changed
    Dira[16]~~ to Dira~~ set all pins to outputs then:
    !outa[16] to outa[$FF] set 1st 8 bits to 1
    on this hydra board P0 is the test LED

    I would think this ought to do it. yet....
    no... then
    when I tried to close to propeller tool I got some error message that something was out of range. It repeated endlessly until I had to reboot my computer... It crashed it. ?? go figure

    sorry to be a pest
  • kuronekokuroneko Posts: 3,623
    edited 2011-08-08 17:10
    zoid wrote: »
    Dira[16]~~ to Dira~~ set all pins to outputs then:
    !outa[16] to outa[$FF] set 1st 8 bits to 1
    on this hydra board P0 is the test LED
    outa[$FF] is the same as outa[31], so bad idea as is setting all pins as an output (dira~~). Just use dira[0]~~ and !outa[0] (I assume your debug LED works, mine was soldered in upside down).
  • zoidzoid Posts: 12
    edited 2011-08-08 17:14
    I have been there. online help/ chapter 3.
    The screen says programming tutorial and nothing else.
    also, online help/ chapter 2 using the propeller IDE is also blank.
  • LeonLeon Posts: 7,620
    edited 2011-08-08 17:14
    That little program definitely works on my Proto board.
  • zoidzoid Posts: 12
    edited 2011-08-08 17:30
    kuroneko wrote: »
    outa[$FF] is the same as outa[31], so bad idea as is setting all pins as an output (dira~~). Just use dira[0]~~ and !outa[0] (I assume your debug LED works, mine was soldered in upside down).

    yes thanks I will try this tomorrow as it is getting late
    The test LED does work as I have seen it lit up once however, I will confirm this as well with a meter anyway.... tomorrow

    All in all I think this is just a "learning curve" thing. The prop is a complex chip. It will be a powerful thing for me once i get over the "hump". I already have a $$$ paying application for it... Not due for a demo for 4 months so i do have time to get it right. FYI, The app uses VGA video , MIDI and a mouse so I bought a Hydra. that is my learning platform.
  • kuronekokuroneko Posts: 3,623
    edited 2011-08-08 17:35
    For the record, setting the first 8 bits can be achieved by using either outa[7..0]~~ or outa[7..0] := $FF.
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2011-08-08 19:24
    I hate to say this, but a lot of the "beginner" Spin programs in the tutorials are very poor choices. They use a lot of idiomatic Spin shorthand that's not the least bit beginner friendly.

    The snippet that Leon posted is a perfect example - full of shorthand, and no comments at all.
  • HumanoidoHumanoido Posts: 5,770
    edited 2011-08-08 23:58
    Kevin Wood wrote: »
    I hate to say this, but a lot of the "beginner" Spin programs in the tutorials are very poor choices. They use a lot of idiomatic Spin shorthand that's not the least bit beginner friendly.

    The snippet that Leon posted is a perfect example - full of shorthand, and no comments at all.

    It seems that no one who is well versed in Propeller programming is willing and able to write complete functional spin programs for the beginner without the shorthand or fancy stuff.
  • LeonLeon Posts: 7,620
    edited 2011-08-09 01:27
    It's a tiny little program. I'd have thought that anyone could understand how it works after a quick read of the Propeller Manual.
  • TorTor Posts: 2,010
    edited 2011-08-09 01:35
    Even for experienced programmers coming from elsewhere the shorthand is just in the way. Any programmer can understand outa[7..0] := $FF, but the shorthand variants will force you to stop and start looking things up. And for some of that shorthand I just can't see the point. It's not particularly shorter, and it doesn't make things easier to read. For a programmer it's much clearer and easier to use hex. Or octal, or decimal. '!' as 'not' is common everywhere, and OK (if it's still meaning the same in Spin, of course - not otherwise). But specially-invented shorthand for operations that can as easily be done with numbers isn't particularly smart - I don't know how many of them there are in Spin, I haven't investigated that point. I won't use any of those anyway, as long as there's a $hex way.

    -Tor
  • prof_brainoprof_braino Posts: 4,313
    edited 2011-08-09 09:02
    Leon wrote: »
    It's a tiny little program. I'd have thought that anyone could understand how it works after a quick read of the Propeller Manual.

    Don't be disappoint if you cannot follow all the examples the first time. Many users on this forum already had several decades of experience on computers when they were "beginner" to the prop. It is a small wonder that such folks don't understand the "beginner" perspective of others. Although some statements appear to imply we are stupid for not understanding, this is not necessarily the intent.

    EDIT - Maybe take a look at propforth http://code.google.com/p/propforth/ Some folks find this easier.
  • zoidzoid Posts: 12
    edited 2011-08-09 13:02
    OK
    yes I can generally read a simple piece of code as shown in the example
    yes I was right to suspect it worked but was outputting on the wrong pin
    my test LED is on P0... pin 1
    the test pgm outputs on P16 ...pin 21
    once i changed the ......[16]s to [0]s it works on my test rig

    my o'scope is fried and the replacement is not here yet so I used a led in series with a resistor to probe around with
    and find this out.

    now I may proceed
Sign In or Register to comment.