Shop OBEX P1 Docs P2 Docs Learn Events
a couple of questions from Prop Noob — Parallax Forums

a couple of questions from Prop Noob

WKUadamWKUadam Posts: 6
edited 2010-05-03 18:03 in Propeller 1
Hi i've been using the Basic Stamp for a while, now i'm beginning to work on a project that i think would be beyond a stamp, i think I need a propeller. I have a couple of questions before i invest my time and money into a new chip.

1) the props have 8 cores (cogs) can each of these be set to run a different program? (motor control, LCD display, sensors)
2) can i transfer data from one cog to another? i detect something with a sensor and output something to the LCD?
3) does the prop have interrupts?
4) is it possible to set up multiple serial connections? serial sensors and an LCD

is this possible in spin or do i need the assembly language?

Thank you for any help

Comments

  • rjo_rjo_ Posts: 1,825
    edited 2010-05-03 17:19
    1) yes
    2) yes
    3) what is an interrupt?
    ... but seriously. Technically the Prop doesn't have interrupts. But in reality, the spin language has very potent analogous functions... you can create softare interrupts very easily.

    4) yes

    4b) depends on what you want to do ... if you give some examples, it would be better.

    Most importantly... there is no conversion remorse. I have yet to see a comment in the forum such as "geez i wasted my time learning about the Prop." Everything happens eventually... but this hasn't happened yet[noparse]:)[/noparse]

    Rich
  • WKUadamWKUadam Posts: 6
    edited 2010-05-03 17:41
    thank you, i wish it had interrupts but i guess with the multi-core design i can get around it without problems.

    my question about the spin language is can each of these functions be done with spin? set up each core, serial etc.

    i saw a website that hacked a wii remote camera to output i2c, i want to build something that can read this and output the locations to a lcd screen. and a robot will be able to track it. I'll probably add other features later so i wanted the prop
  • heaterheater Posts: 3,370
    edited 2010-05-03 17:45
    The Prop doe not have interrupts.

    When you have 8 processors to play with you are unlikely to miss interrupts. Have an interrupt routine? OK give it to COG to handle. This is one of the great ideas of the Prop design that makes your coding time a lot easier. Makes getting the timing right much easier and makes swapping code modules in and out as required much easier.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • rjo_rjo_ Posts: 1,825
    edited 2010-05-03 17:49
    ...etc. Yes, this can all be done in spin...

    spin uses objects(from the Obex or your own). Many objects contain assembly code... but mostly you only need to know how to call an object's functions.

    I2C ... lots of examples in the OBEX. about your specific goal, we have experts here... I'm not one of them[noparse]:)[/noparse]

    Rich
  • WKUadamWKUadam Posts: 6
    edited 2010-05-03 17:53
    thanks alot
  • Christof Eb.Christof Eb. Posts: 1,245
    edited 2010-05-03 17:56
    Hi WKUadam,

    have you already had a look into the OBEX? If for your hardware there is already a driver there, you don't need assembler.

    If you don't need high speed, you can work with spin, which is an interpreter. If you need high speed -more than a few 1000 instructions per second-, you can use either assembler or a compiler, for example PropBasic. Normally only for hardware drivers you will need such high speed. To give you an example: I tried to do a light dimmer with a resolution of about 1/10000 seconds. Here I was·only partly·successful with spin in combination·with the timer. No problem with assembler.

    Instead of interrupts, you·can calculate·one cog per task, that has to be done in parallel. For example a buffered serial connection will need one cog. The counters have a lot of power, so some tasks can be done using them with very little cog assistance, for example DAC.

    Good luck!
    Christof
  • K2K2 Posts: 693
    edited 2010-05-03 18:03
    I used to pride myself on writing tight ISRs, and I really loved the Virtual Peripheral paradigm of the SX processor. Using a Propeller, it felt at first like I was losing my identity. Now I think it is nothing short of FANTASTIC how very demanding functions can be developed and run in complete isolation one from another, or they can be closely coupled and even synchronized. Like Rich suggested, the Propeller's multicore paradigm is so much better that few users look back.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The early bird gets the worm but the second mouse gets the cheese.
Sign In or Register to comment.