Problem with a loop. Look OK!
Sniper King
Posts: 221
This loop looks right.· I cant talk about what it is for and probably could get in trouble with this code.· But I am stuck here.·
the output for this example should be :
<*A*>
<*B*>
<*C*>
The true Output is :
<*A*>
<*A*>
<*A*>
<*A*>
<*A*>
<*A*>
<*A*>
<*A*>
HELP!!!!!!!!!
·
································
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·- Was it pin 11 or 26?· Hmmm....··I think the smell of smoke tells the whole story.· Must be 26.
Michael King
Application Engineer
R&D
Digital Technology Group
the output for this example should be :
<*A*>
<*B*>
<*C*>
The true Output is :
<*A*>
<*A*>
<*A*>
<*A*>
<*A*>
<*A*>
<*A*>
<*A*>
HELP!!!!!!!!!
·
································
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·- Was it pin 11 or 26?· Hmmm....··I think the smell of smoke tells the whole story.· Must be 26.
Michael King
Application Engineer
R&D
Digital Technology Group
Comments
Or, you might not have enough stack space.
Otherwise it looks OK to me other than your messy indenting.
Graham
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·- Was it pin 11 or 26?· Hmmm....··I think the smell of smoke tells the whole story.· Must be 26.
Michael King
Application Engineer
R&D
Digital Technology Group
OK i try to establish a new acronym
AYCS !
Attach Your Complete Sourcecode
best regards
Stefan
Besides I prefer:
AMRCDNW
Attach Minimal Runable Code that Does Not Work (preferably on proto or demo board). Creating the latter normally shows the problem anyway.
Grhaam
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·- Was it pin 11 or 26?· Hmmm....··I think the smell of smoke tells the whole story.· Must be 26.
Michael King
Application Engineer
R&D
Digital Technology Group
When a method is called, the return address and some other internal information is placed into the stack followed by a long for the return value (if any) and one for each parameter and local variable. During the execution of the method, other temporary values may be placed into the stack and, if another method is called, the process begins all over again.
You're using the uppercase 'W' as a counter, but you are comparing the lower case 'w'. I believe that SPIN sees these as two separate variables. 'W' is incrementing correctly, but 'w' is set at what ever the Prop initializes it to, which is obviously not what you want it to be. Fix the case issue and your problem will likely go away.
In other words, this:
should be this:
Or this:
should be this:
Take your pick.
Post Edited (MarkS) : 7/1/2008 2:59:21 PM GMT