Shop OBEX P1 Docs P2 Docs Learn Events
Can only start 5 cogs? - Page 2 — Parallax Forums

Can only start 5 cogs?

2»

Comments

  • eagletalontimeagletalontim Posts: 1,399
    edited 2015-01-26 20:51
    Well, I have gone and done it... i wrote a cog tester and found that number 4 and number 7 cog are not starting on my Prop. Do I have a coding error?
  • SapphireSapphire Posts: 496
    edited 2015-01-26 20:58
    Why don't you add printing of the return value from cognew() so you know which cog actually started? Doesn't PST require a cog? That might explain why 7 didn't start.

    Also, BYTE cog[7] should be BYTE cog[8].
  • eagletalontimeagletalontim Posts: 1,399
    edited 2015-01-26 21:01
    I think you are right about cog 7 not starting but cog 4 does not start for sure. I have tested this same code on my Prop breadboard and all cogs start up. Maybe I have a bad Prop? It was brand new when I popped it in an started programming...
  • ozpropdevozpropdev Posts: 2,792
    edited 2015-01-26 21:11
    Cog 4 is running fine down here.
    Sapphire is correct, Cog 7 does not start because there are no more free cogs.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2015-01-26 21:19
    Ok, I redid the cog tester and it is a little more informative now. All cogs start on my breadboard. Cog #5 according to the tester does not work. Guess I am going to have to buy more Props :(
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2015-01-26 21:35
    Ok, I redid the cog tester and it is a little more informative now. All cogs start on my breadboard. Cog #5 according to the tester does not work. Guess I am going to have to buy more Props :(

    To have one cog that has "failed" is the least likely of almost any scenario, just don't be so quick to point the finger unless it is at yourself. It will be your software, and you know it. As for testing "cogs" it is easy enough to load some other software onto the Prop which can check this out rather than relying on the very code you are debugging, but once again, it is NOT going to be a faulty cog.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2015-01-26 21:46
    Hmm. I am confused :( I pulled out the Prop from the socket of my circuit board and installed it in my breadboard where the other Prop was and cog #5 failed as it did in the other circuit. The Prop that was replaced with the "Bad" Prop was in the same circuit and all cogs started. If it is software, how?

    EDIT * : I just installed the Prop that "Passed" into my circuit board and all cogs started using the cog tester I made. I then loaded the full suntracker code into it and all works...well, except for the socket data part which I started a new thread on :)
  • ozpropdevozpropdev Posts: 2,792
    edited 2015-01-26 22:00
    Revised cog_tester shows all cogs working here.
    391 x 321 - 52K
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2015-01-26 22:16
    Hmm. I am confused :( I pulled out the Prop from the socket of my circuit board and installed it in my breadboard where the other Prop was and cog #5 failed as it did in the other circuit. The Prop that was replaced with the "Bad" Prop was in the same circuit and all cogs started. If it is software, how?

    EDIT * : I just installed the Prop that "Passed" into my circuit board and all cogs started using the cog tester I made. I then loaded the full suntracker code into it and all works...well, except for the socket data part which I started a new thread on :)

    Okay, I'm sticking by what I said about it's not a failed cog, despite this "indication" that it could be. I still think you have power problems that aren't showing up and one Prop may just work and another may just fail. As I said before the failed cog scenario is a very unlikely, they just don't fail and if any part of the Prop was stressed by over-voltage etc then we normally find that the weakest link breaks first, that is, the PLL. If you loaded my "Hardware Explorer" onto your board you could very easily test out cog 5 etc. For instance:
    [font=courier][B].TASKS[/B] 
    0000: CONSOLE                         0000 00 00 00 00 00 00 
    0002: IDLE                            0000 01 00 00 00 00 00 
    0003: IDLE                            0000 01 00 00 00 00 00 
    0004: IDLE                            0000 01 00 00 00 00 00 
    0005: IDLE                            0000 01 00 00 00 00 00 
    0006: IDLE                            0000 01 00 00 00 00 00 
    0007: TIMERTASK                       343E 01 00 00 00 00 00  ok
    [B]LONG count [/B] ok
    [B]pub CHECK BEGIN count ++ AGAIN ; [/B] ok
    [B]' CHECK 5 RUN[/B]  ok
    [B].TASKS[/B] 
    0000: CONSOLE                         0000 00 00 00 00 00 00 
    0002: IDLE                            0000 01 00 00 00 00 00 
    0003: IDLE                            0000 01 00 00 00 00 00 
    0004: IDLE                            0000 01 00 00 00 00 00 
    0005: CHECK                           4BA8 01 00 00 00 00 00 
    0006: IDLE                            0000 01 00 00 00 00 00 
    0007: TIMERTASK                       343E 01 00 00 00 00 00  ok
    [B]count @ .[/B] 321370 ok
    [B]count @ .[/B] 366047 ok
    [B]count @ .[/B] 426970 ok
    [B]count @ .[/B] 480670 ok
    [B]count @ .[/B] 521904 ok
    [/font]
    
    As you can see I launch some very simple counting code into cog 5 and it checks out fine. This check took me a whole 30 seconds to run.
Sign In or Register to comment.