Shop OBEX P1 Docs P2 Docs Learn Events
How fast does spin spin? — Parallax Forums

How fast does spin spin?

siljamickesiljamicke Posts: 66
edited 2010-08-29 05:44 in Propeller 1
I now have sorta 8-bit sound coming out aswell! Things are progressing well :)

A question, is it feasable to do audiosynthesis using spin in speeds around RCFAST?

I tried a simple:

PUB Simplesound
  
  dira[16..23]~~
  repeat
  
     outa[16..23]+=64
 

...which i guess should do a rough four sample sawtoothy kind of wave. I don't get a very high pitch though, i'm guessing 7-8 kHz by ear. I'd like too utilize waveforms greater than 4 samples and still be able to get higher frequencies:(

Maybe i have to venture into the assembly side, just to buy myself headroom.
I am however not afraid of assembly, but i thought that i should give spin a real try before dismissing it. I know i could run the chip faster, but i reckon 12Mhz isn't all that slow so, am i barking up the wrong tree regarding spin here?

/Mikael

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-08-27 13:21
    Well, RCFAST is about 1/7th to 1/4th the speed of the normal 80MHz system clock. More important, it's not that stable nor is it accurate since it's very dependent on ambient temperature and somewhat dependent on supply voltage. Crystals are cheap. Use one. If you're trying to save power by running the Propeller slower, use a different clock multiplier (than 16x), but stick with the crystal.

    Spin is fairly slow at 80MHz with most operations taking on the order of 2us (I could be off there). By using the cog counters, you can do some processing at the system clock speed (like pulse train generation). Read the application note on the counters for details (AN001). Spin-only programs can handle "bit-banged" serial I/O at 19.2KBps with an 80MHz clock, so that may give you some idea of what's possible. For anything faster, you will need to use assembly.
  • siljamickesiljamicke Posts: 66
    edited 2010-08-27 13:30
    Well, since 7 times the speed still is less than three octaves higher, i guess tomorrows home assignement is Prop ASM! :)

    Today left me with i big grin on my face though, since to me, even my cheap eight resistor DAC sound output is like a whole wall full of blinking leds ;)

    Thanks for the clarification Mike!
  • siljamickesiljamicke Posts: 66
    edited 2010-08-29 05:44
    My prop is singing now!

    Maybe not a grammy winner, but atleast it makes noise, and that is so much fun to me! :scool:
Sign In or Register to comment.