Shop OBEX P1 Docs P2 Docs Learn Events
Interesting Propeller Code Issue.... — Parallax Forums

Interesting Propeller Code Issue....

jknightandkarrjknightandkarr Posts: 234
edited 2012-07-21 22:43 in Propeller 1
I posted my code here first of all
http://www.savagecircuits.com/forums/attachment.php?attachmentid=2799&d=1339005611

Now I've been trying to figure out this problem for a while now, I can't seem to get my 2nd cog's method to work. I've got one copy program that works as I want, but I'd like to know whats wrong to avoid future issues in my programs. No matter how I look my programs over or how many times, I can't seam to locate my issue. I've checked the Prop Ed labs book as well as the Propeller Manual's information on COGNEW & COGINIT & I can't seam to get this solved. I thought stack space could have been an issue, so I tried 120 longs, no change, I don't see my problem, no matter how many times or how I look at it, I just don't see the error.

Joe

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-07-21 22:16
    The link didn't work for me. When I went to SavageCircuits I tried to look at your post I wasn't allowed without logging in.

    One common error with the Prop is to set input and output pin states in one cog and then try to change them from a different cog. Make sure any cog using I/O pins is the only cog using those pins.

    Edit: I didn't see the download window initially. The link does work. It's a direct link to a zip file.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-07-21 22:26
    Which program doesn't work? There are three. What doesn't it do that you think it should?
  • jknightandkarrjknightandkarr Posts: 234
    edited 2012-07-21 22:41
    The problem program is the one with debugging. The one cog is the first version & the last one is the one that works as needed. Basically the problem is the cognew command isn't displaying my LED pattern at all.

    Joe
  • kuronekokuroneko Posts: 3,623
    edited 2012-07-21 22:43
    The problem program is the one with debugging.
    As Duane already mentioned ... you set pins 0..2 to outputs in cog N but use them in cog M.

    FWIW, @Stack0 really is the same as @Stack0[0].
Sign In or Register to comment.