Shop OBEX P1 Docs P2 Docs Learn Events
Propeller 2 Assembly Language beginner guide v0.1 - Page 3 — Parallax Forums

Propeller 2 Assembly Language beginner guide v0.1

13»

Comments

  • evanhevanh Posts: 17,308
    edited 2026-06-10 02:46

    @pilot0315 said:
    So you have 3 to work with.
    If that is so can you say reuse the three but in different ".loops"

    Yep.

    Or are the three exclusive to the entire asm program.
    Thanks for the explanation

    The event system is hardware in each cog. It can be reused with an instruction or two for each event. There is no compiler or OS contexts, but each cog is independent of the others.

  • evanhevanh Posts: 17,308
    edited 2026-06-10 03:30

    There is one known gotcha on reuse. An actively triggering event will flow through and also trigger the reconfigured event. This can be confusing, and buggy, when it would normally be armed instead of triggered. It only impacts event sources that can be asynchronous to the program flow. eg: From a pin/smartpin.

    There is two workarounds: First one is to remove the event source first. This eliminates any active triggering before the new config is assigned. Eg:

                    setse1  #0
                    setse1  #%001_000000 | pin
    

    Second one is to acknowledge any extraneous trigger after setup:

                    setse1  #%001_000000 | pin
                    nop        ' spacing instruction before ack'ing event
                    pollse1
    

    PS: When I say "actively triggering" I mean the very condition required for causing the trigger is happening on the very same sysclock tick as the event setup instruction is executing. So unlikely to occur, but still can, for edge triggered event types. Whereas it will always occur for level triggered event types.

Sign In or Register to comment.