Shop OBEX P1 Docs P2 Docs Learn Events
Propeller Beginner — Parallax Forums

Propeller Beginner

osullosull Posts: 4
edited 2007-10-25 12:38 in Propeller 1
Hi
I have been using the BS2 for a while but now id like to move up to the world of the propeller given its major advantages over the BS2. I was just looking for help starting off with a few easy programs, maybe controlling LED's or displaying text or results on a screen. If anyone has a few simple programs please pass them on as all the sample programes ive downloaded are fairly complex!!

Comments

  • deSilvadeSilva Posts: 2,967
    edited 2007-10-17 15:34
    Do the SPIN-Tutorial inside the Manual, Chapter 3

    If you are just after a simple program, this is what I use whenever I plug a new propeller into a socket:
    PUB main
      DIRA:=-1
      REPEAT
         OUTA++
    
  • simonlsimonl Posts: 866
    edited 2007-10-17 15:35
    Hi osull,

    Welcome aboard!

    I'd suggest you look initially at the Propeller Education Kit (PEKit) labs; they're in the blue 'stickies' at the top of the forum (here's the link : http://forums.parallax.com/showthread.php?p=617192).

    You'll also find some good tutorial stuff in the manual.

    Have fun, and don't be afraid to ask questions here on the forum. smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,

    Simon
    www.norfolkhelicopterclub.co.uk
    You'll always have as many take-offs as landings, the trick is to be sure you can take-off again ;-)
    BTW: I type as I'm thinking, so please don't take any offense at my writing style smile.gif
  • RaymanRayman Posts: 14,162
    edited 2007-10-17 15:46
    Parallax really should have made a "Hello World." example for both VGA and TV!
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-17 16:19
    They are called TV_TEXT_DEMO, VGA_TEXT_DEMO, and VGA_DEMO respectively...
    Granted, neither very readable...
  • JonathanJonathan Posts: 1,023
    edited 2007-10-17 17:06
    The prop looks a little scary compared to a Bs2. And it is a little more complex. But it is nowhere as tough as it might appear. Case in point: Even I can make the Prop do some (limited) stuff.

    One thing I would reccomend is getting PropTerminal. I have been using it for debugging and quite like it.

    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • rjo_rjo_ Posts: 1,825
    edited 2007-10-17 18:06
    Ditto on the Propeller Education Kit. You will take to Spin like a duck to water.

    You have to get the Education Kit... but by far the best value is the Proto board... and they are stackable. To get them all talking together, you only need one wire going from board to board.

    To help you remember what you read ... get Ed Parson's cheat sheets. A good way to keep Spin in your brain is to refresh yourself frequently. Ed's cheat sheets put it all into two pages. U can get them at ucontroller.com. While you are there, read through the CookBook...

    Take a look at Graham's good thread's index every so often, his page gives you a panoramic view of the Propeller's potential. It is up in the stickies at the top of the forum.

    And remember... you don't have to do it all at once, but you will feel guilty if you don't.

    Rich
  • RaymanRayman Posts: 14,162
    edited 2007-10-17 20:18
    I just made a·minimal·small "Hello World" app for VGA...

    Post Edited (Rayman) : 10/17/2007 8:56:56 PM GMT
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-17 20:50
    So it's 168 lines.... Guinness?

    Post Edited (deSilva) : 10/17/2007 8:57:34 PM GMT
  • RaymanRayman Posts: 14,162
    edited 2007-10-17 23:07
    Here's a truly minimal (without modifying the VGA driver) "Hello World" example:
  • RaymanRayman Posts: 14,162
    edited 2007-10-18 00:38
    Here's a minimal version of "Hello World" for TV:
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-18 01:30
    112 Lines!
    That was also my first task some months ago to delete those masses of VARs smile.gif
    BTW: I just recognize there is no translation at all for the German word "un
  • simonlsimonl Posts: 866
    edited 2007-10-18 10:12
    According to Google: un
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-10-18 10:19
    Babel fish say unclearly.

    Graham
  • Nick MuellerNick Mueller Posts: 815
    edited 2007-10-18 10:28
    Un
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-18 10:41
    Right - and thank you! I know of six to seven more translations, depending on the context.

    What stuck me was the fact that the holistic concept behind "un
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-10-18 10:52
    This is probably because the English language is un
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-18 11:22
    Indeed. I lost a radio sketch from times ago, in which a couple talked in five-syllable words so that their child would not understand their conservation smile.gif

    Edit: As you see with "un-
  • RaymanRayman Posts: 14,162
    edited 2007-10-18 13:04
    I made a "Getting Started" page here:
    http://www.rayslogic.com/propeller/GettingStarted.htm
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-18 14:00
    Not bad, not bad... strictly to the point smile.gif

    Some suggestions:
    (a) I LOVE stick boards (solderless bread boards), can you mention this is possible? Refer to an upcomming tutorial from deSilva or just link to the Edu Kit.

    (b) It might also help to give a list of already available accomplishments, as
    - serial communication
    - I2C, SPI
    - some ADC
    - Delta-Sigma
    - PS/2 Keyboard and Mouse
    - VGA
    - TV
    - High performance graphics (though limited in color and display size)


    I was hit the other day when a "newbie" questioned serial comminication, as "there is no UART in the datasheet"...


    (c) Please add my pet demo program
    PUB main
      DIRA := -1
      REPEAT
         OUTA++
    

    Post Edited (deSilva) : 10/18/2007 2:05:31 PM GMT
  • RaymanRayman Posts: 14,162
    edited 2007-10-18 14:18
    deSilva: Please post your Spin file here and I'll include it... I added some of your ideas there and to my main Propeller page.
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-10-18 16:04
    deSilva said...
    (a) I LOVE stick boards (solderless bread boards), can you mention this is possible? Refer to an upcomming tutorial from deSilva or just link to the Edu Kit.

    (b) It might also help to give a list of already available accomplishments, as
    - serial communication
    - I2C, SPI
    - some ADC
    - Delta-Sigma
    - PS/2 Keyboard and Mouse
    - VGA
    - TV
    - High performance graphics (though limited in color and display size)


    I was hit the other day when a "newbie" questioned serial comminication, as "there is no UART in the datasheet"...


    This is what I had in mind for my late and unmourned·"What Works (Best)" thread. (I killed·the thread·off after many views and no replies, so if you (or anyone else) like, you·may resurrect that thread title.)
  • nomadnomad Posts: 276
    edited 2007-10-18 16:15
    hi,
    this threads are verry unuebersichtlich.....
    hello world

    OBJ
    text : "vga_text" ' Create vgaText-object

    CON
    _clkmode = xtal1 + pll16x
    _xinfreq = 5_000_000

    PUB main

    text.start(16)
    repeat
    text.str(string("hello world",13,10))

    :-;
    nomad
  • RaymanRayman Posts: 14,162
    edited 2007-10-18 16:42
    That does look a bit simpler! Hmm... There's a TV_Text too...
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2007-10-18 16:48
    There's only one improvement I think I would add to that code..

    comments... [noparse]:)[/noparse]

    OBJ
    text : "vga_text" ' Use vgaText-object
    
    CON
    _clkmode = xtal1 + pll16x 'Set propeller speed settings
    _xinfreq = 5_000_000
    
    PUB main
    
    text.start(16)  'Start vgaText-object with P16
    repeat  'Begin repeating loop
     text.str(string("hello world",13,10))  'Print "hello world" on screen followed by carriage return & linefeed
    
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Buttons . . . check. Dials . . . check. Switches . . . check. Little colored lights . . . check.

    — Calvin, of 'Calvin and Hobbes.
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-10-18 17:02
    Do we really need to repeat the phrase? Once ought to be enough, yes?
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-18 21:06
    Rayman said...
    deSilva: Please post your Spin file here and I'll include it... I added some of your ideas there and to my main Propeller page.
    BUT THIS IS MY SPIN PROGRAM !!!
    PUB main
      DIRA := -1
      REPEAT
         OUTA++
    




    WRT to more elaborate "Hello World"- programs:
    Add a section with constants (crystal, video pin) for ALL popular boards,
    so the beginner will have the feeling of an "easy win" at least once smile.gif
  • RaymanRayman Posts: 14,162
    edited 2007-10-25 12:38
    Ok, Nomad shows that it is much better to start with "tv_text" or "vga_text"...

    So, here's a MUCH simpler "Hello World" file:

    It's rigged for VGA, but two changes (as noted) should make it work for TV. (I say "should" because I don't have my TV handy to test it...)
Sign In or Register to comment.