Shop OBEX P1 Docs P2 Docs Learn Events
Assembler version of coginit — Parallax Forums

Assembler version of coginit

CobiCobi Posts: 2
edited 2009-08-06 14:35 in Propeller 1
Hello.
Im playing around with Audio on the Prop. My current experimentation ground consists of one constant sine-oscillator, one ADSR-Envelope generator and one Cog that will act as a Sequencer. My Problem is that i cant get the assembler version of coginit to run.
Can someone who used it successfully please take a look at it? smile.gif
Greetz

Comments

  • ericballericball Posts: 774
    edited 2009-08-06 12:58
    To start with, you aren't initializing sEnvelopeAddress. You're only loading a single LONG from HUB RAM.

    PASM COGINIT is a weird instruction as you have to pack everything into the destination register.

    In SPIN terms, what you are trying to do is:

    Temp5 := (@ToneNumberSteps >> 2) << 18 | (@ToneStart >> 2 ) << 4 | 4



    Oh, one important note - COGINIT is not instantaenous. It will take ~8000 CLK cycles before the PASM routine starts.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Composite NTSC sprite driver: Forum
    NTSC & PAL driver templates: ObEx Forum
    OnePinTVText driver: ObEx Forum
  • CobiCobi Posts: 2
    edited 2009-08-06 14:35
    Yeah, i missed a '3' after dlsb... -.-
    I hate these kind of errors.
    But coginit is working now, thanks. [noparse]:)[/noparse]
Sign In or Register to comment.