Shop OBEX P1 Docs P2 Docs Learn Events
Sinfully easy — Parallax Forums

Sinfully easy

LoopyBytelooseLoopyByteloose Posts: 12,537
edited 2006-05-09 20:31 in Propeller 1
This is like a BasicStamp on steroids - easy, fault tolerant, and fun.

Once I understood that it really was that simple to build my own board and interface AND that the IDE is really quite simple, the LED started to blink.

Moved on to using a bank of 5 LEDs with 5 cogs and they all work fine.
It is much easier than dealing with the SXes as you don't have to really spend a lot of time figuring out oscillator timing in the SPIN code [noparse][[/noparse]unless you really want to].

My Propeller has been up and running for three 24hour days now [noparse][[/noparse]excepting reprogramming] and I feel confident that I can do video and keyboards soon.

I have burned up one voltage regulator by reversing voltage and a couple of protective diodes I had in place.· But nothing has gotten through to the Propeller.

It looks like I should buy a TV tomorrow, something I have done without for years and years.

For now, it is print documentation and work on my H/P Printer Contest entry.· Originally I had intended to use my BS40p to control the two steppers, but I am beginning to wonder about a keyboard and video menu display.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-05-07 16:58
    On my growing list of projects is a stepper controller with the Propeller -- what a breeze it will be. When I get to it; lots of other fun things are ahead of it on my list.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-05-07 17:45
    I wish I didn't have to work this week. I was up to 3:30 last night and two 16 hour days on the Propeller.
    It is so different and so cool.

    I have five COGS blinking based on prime number timing (3, 7, 9, 13). I don't think you can do that with multi-thread binary -- only parallel.

    Video and keyboards are next, but it will have to wait a bit.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-05-07 17:55
    If you stare at the prime number LEDs does it make you smarter? I could use a boost after so many long -- but fun-fillrd -- days.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-05-08 14:12
    Kramer:
    Do you think you could post your code?
    I was toying with the prime number idea and I'm interested in how you implimented it.
    THanks!

    KK

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Just tossing my two bits worth into the bit bucket


    KK
    ·
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-05-08 15:45
    Well here is my 'MultiLEDblink.spin' for whomever wants it.

    I am a bit shy of posting code in the presence of so many more knowledgible.· About all I can say is it works and it really is a simple adaptation of Jon's code.·

    Sometimes I feel it is really hard to keep up with Parallax, but when I look back to two years ago, I am amazed at what I have learned.


    CON
    · _clkmode· = RCFAST
    ··
    VAR
    · long· stack1[noparse][[/noparse]8], stack2[noparse][[/noparse]8], stack3[noparse][[/noparse]8],stack4[noparse][[/noparse]8], stack5[noparse][[/noparse]8]

    PUB main
    · cognew(blinkLed(16,· 11), @stack1)
    · cognew(blinkLed(17,· 3), @stack2)
    · cognew(blinkLed(18,· 5), @stack3)
    · cognew(blinkLed(19,· 7), @stack4)··
    · cognew(blinkLed(20,· 13), @stack5)·
    PRI blinkLed(pin, hz)
    · dira[noparse][[/noparse]pin]~~
    · repeat
    ··· !outa[noparse][[/noparse]pin]
    ··· waitcnt((4*clkfreq)/ (hz * 1 ) + cnt)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

    Post Edited (Kramer) : 5/9/2006 4:37:09 AM GMT
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-05-08 17:32
    THanks Kramer!
    I was hoping you had a prime seave (sp) in there... but that's cool...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Just tossing my two bits worth into the bit bucket


    KK
    ·
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-05-09 04:41
    Oops!, I had a non-prime in there. I changed the first line from 9 to 11.

    Sorry, but my life requires that I spend most of my time teaching at mutiple locations and traveling with a dog by motorcycle. I have to carry my library and work with me. As a result, my programing skills are not that advanced. I think it is seive, not seave.· The seive would locate prime numbers, but it really is a huge number crunching task that has been done many times.

    What this demonstrates is that you don't have to have COGs operate on a least common denominator to fit odd frequency communications.· For example, MIDI and RS232 serial can easily co-exist at a slow clock and less power.

    I need a few dense programming books that can travel well. I was thinking of 'The Art of Programing', but it is a series of volumes.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

    Post Edited (Kramer) : 5/9/2006 4:48:39 AM GMT
  • GadgetmanGadgetman Posts: 2,436
    edited 2006-05-09 06:26
    Correction, it's Sieve...

    And in the case of finding Primes, we usually talk about Erastosthenes' Sieve.
    [noparse][[/noparse]quote]
    The Sieve of Eratosthenes identifies all prime numbers up to a given number n as follows:

    1. Write down the numbers 1, 2, 3, ..., n. We will eliminate composites by marking them. Initially all numbers are unmarked.
    2. Mark the number 1 as special (it is neither prime nor composite).
    3. Set k=1. Until k exceeds or equals the square root of n do this:
    -Find the first number in the list greater than k that has
    - not been identified as composite. (The very first number
    - so found is 2.) Call it m. Mark the numbers

    - 2m, 3m, 4m, ...

    - as composite. (Thus in the first run we mark all even
    numbers greater than 2. In the second run we mark
    all multiples of 3 greater than 3.)
    - m is a prime number. Put it on your list.
    - Set k=m and repeat.

    4. Put the remaining unmarked numbers in the sequence on your list of prime numbers.

    I can't remember where I found that snippet anymore, but it explains it quite nicely.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't visit my new website...
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-05-09 20:05
    Gadgetman...
    THanks... I'm going to attempt to code that one...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Just tossing my two bits worth into the bit bucket


    KK
    ·
  • GadgetmanGadgetman Posts: 2,436
    edited 2006-05-09 20:31
    There are two examples of the Sieve coded for different Basics, and with different optimisations, in my forum...

    http://totallytrygve.com/phpBB2/viewforum.php?f=8

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't visit my new website...
Sign In or Register to comment.