Shop OBEX P1 Docs P2 Docs Learn Events
Propeller Questions For the Average Idiot — Parallax Forums

Propeller Questions For the Average Idiot


I took a look at Propeller datasheet.

All I wanted to know was this:

How many memory registers does it have? At this point I don't care what they are. Program or data.

How many bits wide are they? 16?, 32 or what?

After a couple paragraphs I gave up on that datasheet.

At this point I am just tire kicking on the Propeller.

Maybe when I get up to C the Propeller will be more comprehensible.

«13

Comments

  • David BetzDavid Betz Posts: 14,511
    edited 2018-11-26 16:56
    Each COG has 512 32 bit registers. 496 of them can hold either data or code. The rest are special-purpose registers like DIRA, INA, and OUTA for accessing the I/O pins, counters, video shifter, etc.
  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2018-11-26 17:24
    Thank you David

    Funny you started out with cog memory and skipped over main memory.

    Hee's something for datasheet.
    5.1.
    Main Memory
    The Main Memory is a block of 64 K bytes (16 K longs) that is accessible by all cogs as a mutually-exclusive resource through the Hub. It consists of 32 KB of RAM and 32 KB of ROM. Main memory is byte, word and long addressable. Words and longs are stored in little endian format; least-significant byte firs

    Here's link to datasheet.

    https://www.parallax.com/sites/default/files/downloads/P8X32A-Propeller-Datasheet-v1.4.0_0.pdf
  • Thank you David

    Funny you started out with cog memory and skipped over main memory.
    Main (hub) memory is not registers. You asked about registers.
  • The main memory is like an I/O device in that you can't actually execute code in it and you need to use special instructions to access it (RDxxxx, WRxxxx, where xxxx is BYTE, WORD, or LONG). Normally, the cogs are loaded with an interpreter for Spin bytecodes which make the whole thing look (and act) like 8 Spin processors where the program is stored in main memory. These days, you can also compile C programs either directly into Propeller instructions or into modified Propeller instructions that are 'executed" by a small, fast interpreter running in a cog ... like the Spin case, but much closer to the actual Propeller instructions.

  • That's fascinating but not helpful. Thanks anyhow.

    Datasheet looks a little better now.
  • That's fascinating but not helpful. Thanks anyhow.

    Datasheet looks a little better now.
    What exactly are you trying to understand?

  • Would you expect to be able to easily understand an ARM M0 processor datasheet with a typical mix of peripheral processors for I2C, SPI, timing, video ... given your current level of experience? Why should the Propeller be much different? In some ways, it is simpler and more straightforward, particularly with its emphasis on software defined peripherals.
  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2018-11-26 20:29
    Thank you for all the responses.

    Using Propeller Tool version 1.3.2

    Looking in Help/Useful Tables

    Where is the instruction set in Help?

    They cleverly hid operators etc. in something called Useful Tables.

    Looked 10 minutes. Could not find instruction set.

    Let me go back to the datasheet for instruction set. It may be more common sense.

    This Help looks like it relies on the Tutorial and the rest is an afterthought.

    Edit. Found them in datasheet. I think.

    LONGFILL (StartAddress, Value, Count) Fill longs of main memory with a value.

    Is this equivalent to MOV or LOAD or LD?
  • Cluso99Cluso99 Posts: 18,066
    There is a summary sheet of 2 pages for instruction set, and two pages for spin. I think they are contained in the PropTool download. Check PropTool Help menu for some docs downloaded with it. There was a short set of tutorial examples that used to be downloaded with PropTool - not sure if it's still there. If you have experience with other micros then these examples will get you running quickly. IMHO the Propeller is the easiest micro to program, period! And I have programmed heaps of different micros commercially in over 40 years.

  • Thank you Cluso99

    "There is a summary sheet of 2 pages for instruction set, and two pages for spin. I think they are contained in the PropTool download. Check PropTool Help menu for some docs downloaded with it."

    Right where you said it would be. It's called Quick Reference.

    "There was a short set of tutorial examples that used to be downloaded with PropTool - not sure if it's still there."

    There is a Tuturiol there. Then the only example source code is for it, the tutorial. No general sample code like Stamp or SX.

    Don't know what they were thinking there.

    " If you have experience with other micros then these examples will get you running quickly. "

    Great. To be honest. I won't be running very far with Propeller.

    Just taking a break from learning assembler with a 'different micro' as you say.

    Got burned out on it. Messed up a header file I was working on the other day. Will have to totally redo it later.

    Yes.Will just run a Propeller sample program now and then. Then dig into a line of code a little.



  • microcontrolleruser,

    The Propeller datasheet lists all of the PASM instructions but it's the Propeller Manual that goes into detail on not only every register but every PASM and Spin instruction.

    If you really want to know about the LONGFILL instruction then look in the Propeller Manual.

    But first, do you know what a LONG is?
    The name itself should be a clue.
    https://www.parallax.com/downloads/propeller-manual

  • Genetix

    "The Propeller datasheet lists all of the PASM instructions"

    Couldn't find them.

    "But first, do you know what a LONG is?"

    I don't know what Parallax means when they say that.

    They call instructions 'Elements' so who knows what they mean by LONG.

    Would have to look at their explanation.

    I was asking if that instruction is as close to MOV as you are go to get with Spin.

    Anyhow. Will just run one sample program tonight or run the Propeller code for keypad and just look at it.






  • tomcrawfordtomcrawford Posts: 1,126
    edited 2018-11-26 22:40
    comment withdrawn

  • Cluso99Cluso99 Posts: 18,066
    The quick reference lists all of the PASM instructions. Mostly you will use a subset of less than half of these.
    There is useful sample code on the OBEX (object exchange). Link is on the Parallax website.

    The Propeller (P1) does not have, and nor do you need, Interrupts. All the peripherals are done by software, and there is a host of them in OBEX.

    Try a demo program using spin and FullDuplexSerial (FDX) and you will see how easy it is to use a soft peripheral. Don't bother with the PASM part of FDX - it's one of the more complicated ones. Just use it with spin to write out a string, etc, to the serial port. There is a Windows terminal program called Propeller Serial Termjnal (PST).

    Or if you want to see what a prop can do, see my thread "Prop OS" or "Propeller OS" or similar. It's a whole DOS like OS for the prop using a microSD card. If you cannot find it see my P8XBlade2 thread for a link.

    Or there is CPM running using a Z80 emulator called ZiCog.
  • microcontrolleruser,

    Is this what you were looking for?
    Section 6.4. - Propeller Assembly Instruction Table (Page 22)

    That LONGFILL instruction that you referenced earlier is in the Spin section that comes first (page 19).

    And just so you know a LONG refers to 32-bits or 4 Bytes which is the largest unit the Propeller can use at a time.
    It is a 32-bit Processor after all.

    The answer to your memory questions is here:
    Section 5.0 - MEMORY ORGANIZATION (Page 15)
    Cog RAM is on the bottom of page 16.
  • I suggest you read the first chapters of the Propeller Manual. It explains the architecture of the Propeller and will answer many of your questions about memory, cogs, registers, I/O, etc.

    Then skim the Spin reference in the manual so you will get an idea to look for explanations for the commands.

    To see examples, look in the library subfolder and the example subfolder (not sure if that is the name).

  • Also check out the original Propeller Manual. It has a few tutorials that are now buried in the Propeller Tool Help menu.

  • Thank you for all the responses!

    All of them very good!

    I'm keeping quiet and just thinking about the new info.

    All very astute comments. To the point.
  • kwinnkwinn Posts: 8,697
    Thank you Cluso99

    ...To be honest. I won't be running very far with Propeller.

    Just taking a break from learning assembler with a 'different micro' as you say.

    Got burned out on it. Messed up a header file I was working on the other day. Will have to totally redo it later.

    Yes.Will just run a Propeller sample program now and then. Then dig into a line of code a little.

    Not digging in and learning PASM and at least one of the other languages available for the Propeller is a mistake. It is different from every other micro on the market, but once you wrap your mind around the new concepts you will see the elegance and simplicity of it. I have worked with a lot of the popular chips on the market over the years and the P1 is by far my first choice for any application it can handle.
  • I was so bummed to find out recently that Parallax no longer sells the Propeller Education Kit.
  • Ditto everything kwinn said. You're really putting yourself at a disadvantage if you don't embrace what the Propeller has to offer. It makes programming so much simpler than any single-processor-with-interrupts micro could ever hope to.

    -Phil
  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2018-11-27 04:25
    Thank you all

    My associate has a lifetime of experience in programming and he uses Propeller and is quite satisfied with it.

    I will 'come up through the ranks'. It just works for me.

    Being sociable and doing some experiments with Propeller.






  • The Propeller Help does not have Language Reference with code snippets like Stamp Editor.

    Now the good part is Propeller Tool has a Terminal program.

    Just making some observations.

    Still looking for code samples that are to my liking.
  • Ken GraceyKen Gracey Posts: 7,386
    edited 2018-11-27 04:44
    You know what I'm about to suggest :)

    Come over and join the idiots like me, using BlocklyProp. I think it's a great way to learn the Propeller concept from the outside in. I don't think much about registers and variable sizes using this tool. Everything just sorta takes care of itself and variables are always big (LONG). You can jump right into multicore programming with LEDs, motors and buttons using the "new processor" block. We're having a really good time with this programming environment.

    The most recent project I made with BlocklyProp is this "Visual Metronome" http://learn.parallax.com/tutorials/language/blocklyprop/visual-metronome-project.

    But I'm really stepping it up this winter, and expect to send this autonomous robotic boat across Lake Tahoe using GPS for navigation. This project will show what's possible with the Propeller and BlocklyProp.



    The guy talking in the video tells the story behind the project.

    I don't have much time to write text code, but I can do that too if needed.

    Ken Gracey
  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2018-11-27 05:27
    Ken

    You really have gone where no man has gone before.

    I think I can cross you off the my list of consulting fee prospects for good now.

    When I lived in the Bay area it had Stanford, Berkeley and aerospace and other than that it was middle of the road.

    I think we are about the same age. Maybe it is time to move Parallax to another state.

    I say Texas. Send me my consulting fee after you have been there a while and feel better.

    New Braunfels, TX. I give it 5 stars.

    Call your buddies at Iconstrutix in Texas. They are always wide awake and sharp on the phone. They like it.

    You can get you and your brother matching Ford F450 pickups with Parallax logo's on them.

    Fill up for $2.50 a gallon. How can you resist that?



  • What kind of code samples make sense to you?

    And what micro(s) have you come from? There is a lot of diverse experience here. It may be familiar to "translate" a few ideas.

    A bunch of us saw that Datasheet, or even just the discussion here, pre datasheet. That was true for me. We had the diagram, but not the datasheet you looked at recently. No matter, the response was generally the same:

    What the heck is this thing? Yeah, looks crazy. It's not. But, things are done a bit differently. This is most generally a good thing. Every so often, it's not. YMMV, just like all of us.

    At the time I jumped in, I had been gone from this stuff for about 20 years. Just did different stuff, but have always loved embedded and my career path was headed back this direction. Honestly didn't take much to get going and doing useful things. Those programs in the OBEX are gold. I got more done using this chip than I ever expected, and it was generally fun, more than work. That's not easy to say with these things.

    Other than that, welcome!








  • " Honestly didn't take much to get going and doing useful things."

    That is how my relative is with it.

    Just started using it without any complaints or anything.

    It may if you have to be experienced to pickup on it.

    I just have to do the 33 instruction assembler thing. It's simple step by step.Works for me.

    Will keep my foot in the door with Propeller though.
  • microcontrolleruser,

    Propeller documentation and Help is not as refined as the BASIC Stamp is but hopefully that will change when the P2 is finally released.
    The Stamp had been out for over a decade before the Propeller arrived.

    If there is a particular code example that you don't see or can't find, THEN ASK!

  • Thank you Genetix

    Found some tidbits in Wikipedia Propeller article.

    https://en.wikipedia.org/wiki/Parallax_Propeller

    " multi-core processor parallel computer architecture microcontroller"

    What's 'computer architecture' mean?

    "After booting the propeller, a bytecode interpreter is copied from the built in ROM into the 2 KB RAM of the primary COG. This COG will then start interpreting the bytecodes in the main 32 KB RAM. More than one copy of the bytecode interpreter can run in other COGs, so several Spin code threads can run simultaneously."

    Now I understand it. ROM>COG>Main Ram.

    Yes. The program is in main memory. No. It doesn' run there; Yes.Cog runs it.

    Perfectly clear.

    "This interpreter decodes strings of instructions, one instruction per byte,"

    It's an 8 bit microcontroller.The 32 bit instructions mentioned in doc's must be 4 of these.

    They say Spin is "Fortran and BASIC" mixed togther.

    "This refers to the whitespace formatting of FORTRAN and the keyword-based operation of BASIC"

    So.It's a big multi-processor Stamp with a strain of Basic programming it.

    Interesting.



  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2018-11-28 21:16
    It's an 8 bit microcontroller.The 32 bit instructions mentioned in doc's must be 4 of these.
    No. The 32-bit instructions are the ones running in the cogs themselves. The 8-bit instructions are bytecodes fetched from hub (main) memory during Spin interpretation.
    They say Spin is "Fortran and BASIC" mixed togther. This refers to the whitespace formatting of FORTRAN and the keyword-based operation of BASIC"
    I don't know who "they" are but Spin is about as far from Fortran as you can get. And Fortran does not use whitespace for formatting. Spin is more like Python in that regard.

    -Phil
Sign In or Register to comment.