Shop OBEX P1 Docs P2 Docs Learn Events
Im Stumped — Parallax Forums

Im Stumped

tom90tom90 Posts: 55
edited 2008-02-27 00:08 in Propeller 1
Hey All,

I have written code for an A/D that has an averaging function in another cog. These two cogs are synced so that they start at exactly the same time. The first cog does the ADC and the second cog adds up every 100 values for averaging.

I put in a "spike" in the code for the second cog so I could see it on an oscilloscope.
              mov       outa, tester             'Spike to be seen on scope 
              andn      outa, tester




When I put the prop on the scope it indicates that the second cog is not starting for an extended amount of time. This "spike" usually appears after 2-4 minutes.

Im sure my code for syncing the cogs is correct as I have used it previously without any trouble.

Can anybody spot anything obviously wrong with my code? Ive been trying to find the cause of this for a couple days now and am out of ideas.


*Nevermind the cogstop statements at the beginning that was one last attempt to make it work

Thanks for any help,
Tom

Post Edited (tom90) : 2/26/2008 7:47:22 PM GMT

Comments

  • deSilvadeSilva Posts: 2,967
    edited 2008-02-27 00:08
    This is not good:
    time := (clkfreq/1 + cnt) #> 20_000_000
    



    Also, have a look how COGSTOP should be used...
    Why don't you use 80 MHz?
Sign In or Register to comment.