Shop OBEX P1 Docs P2 Docs Learn Events
waitcnt issues with p2 — Parallax Forums

waitcnt issues with p2

David BetzDavid Betz Posts: 14,516
edited 2013-01-01 11:01 in Propeller 1
I'm having some trouble getting waitcnt working on the Propeller 2. GCC generates the following code where r7 contains the amount of time I want to wait and r5 contains zero:
  70:	0d0cfc0c 			getcnt	18 <r6> wr
  74:	070cbc80 			add	18 <r6>, 1c <r7> 
  78:	050cbcfc 			waitcnt	18 <r6>, 14 <r5> 
The problem is, this code seems to wait forever. Any idea why this might be happening?

Comments

  • ctwardellctwardell Posts: 1,716
    edited 2013-01-01 08:43
    Is GAS setting WC on the waitcnt?
    It looks like that would make the match be on CNT[63:32} instead of CNT[31:0].

    C.W.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-01-01 11:01
    ctwardell wrote: »
    Is GAS setting WC on the waitcnt?
    It looks like that would make the match be on CNT[63:32} instead of CNT[31:0].

    C.W.
    It turns out that gas was assembling the code perfectly well. My problem isn't with the blink code, it seems to be with the code that launches the COGs. For some reason, the parameter isn't being passed in the S field. More digging....
Sign In or Register to comment.