Dead cog6?
Javalin
Posts: 892
Hiya
Seem to have a problem, but just with COG6. Code below - nice and simple example. It runs on any cog but 6 - I've tried both on a PCB of mine (express PCB) and the prop demo board. Same on both.
Seems to rule out pins and soldering. Stuck. Help?
Debug serial is running on COG 1 and can be verified as if you set the TestCog6 sub to run on 1, you get no output.
???
thanks!
James
Seem to have a problem, but just with COG6. Code below - nice and simple example. It runs on any cog but 6 - I've tried both on a PCB of mine (express PCB) and the prop demo board. Same on both.
Seems to rule out pins and soldering. Stuck. Help?
Debug serial is running on COG 1 and can be verified as if you set the TestCog6 sub to run on 1, you get no output.
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 ' debug - USE onboard pins pcDebugRX = 31 pcDebugTX = 30 ' serial baud rates pcDebugBaud = 256000 ' 57600, 115200 or 256000 only OBJ debug : "debug_pc" VAR long adcStack[20] long adcData[20] PUB Start ' start the PC debug object debug.startx(pcDebugRX,pcDebugTX,pcDebugBaud) coginit(6, TestCog6 ,@adcStack) repeat debug.str(string("its ")) debug.dec(adcdata[0]) debug.putc(" ") debug.dec(adcdata[1]) debug.putc(13) waitcnt(clkfreq/5+cnt) PUB TestCog6 repeat adcData[0]++ adcData[1]+=2 waitcnt(clkfreq/10+cnt)
???
thanks!
James
Comments
Generally, it's a bad idea to use coginit. cognew avoids these potential conflicts.
-Phil
How is debug_pc coded in detail?
Does it start a cog with cognew or coginit?
If it does start with cognew it might be that the timing of everything leads to that the cognew inside the debg_pc.spin-file starts cog 6.
then you restart cog 6 through the coginit.
if you use always cognew everything should work because then the prop-chip itself takes a free cog and all cog-conflicts are avoided automatically.
if you start using coginit you the coder take over the responsability to avoid cog-conflicts.
best regards
Stefan
Yes I use coginit (as part of a bigger app) to assign blocks of code to specific cogs to simplify the management (for me).
debug_pc doesn't use a cog - it uses full duplex serial (which is on cog 1) to send debug back to the pc, i.e. debug.str(string("hello world!")), debug.dec(12) etc
I'll double check it and try the other cogs again tonight.
Cheers,
James
On my PCB it doesn't work if you use lots of cognew's - i.e.
it DOES work however if you start some PASM code in cog 6.....
Anybody? Thoughts?
James
there is the shared HUB-RAM which is shared among all 8 cogs.
all COG-RAM is individual to the cog it belongs to. All 8 cogs are absolutely identical.
So there is really no reason to dedicate a certain cog to a certain task.
if you use only cognew the cog-numbers might change from start to start but it really doesn't matter as all cogs are completely identical.
Can you explain to me in detail what you are doing that makes it nescessary to use a certain cog?
I guess nothing as your understanding of how the propeller works is somewhere middle-deep. (if it would be very deep you would have known that FullDuplexSerial starts a cog)
best regards
Stefan
Tried LED's and via SPIN it doesn't work.
Not doing anything spectacularly complicated, a data logging app, but having manual cogs makes life easier to manage,
James
Based on the evidence you've presented, I suspect that cog 6 could have a bad RAM location.The Spin interpreter uses all of cog RAM. Your PASM program uses just a little bit. Just out of curiosity, though, what happens if you run your program using a lower clock rate --- PLLx8 or PLLx4? (Use 9600 baud to test this.)
-Phil
No change sadly. Tried:
and
-Phil
You need to read his comments: he said the code does work on the Demo Board (post #6).
-Phil
Do try it without the PLL. If that produces the same behavior, you may want to write a program to test all the RAM in cog 6, writing and reading back various data patterns.
-Phil
Same result.
-Phil
Try the attached memory test program.
Dave
http://obex.parallax.com/objects/91/
Runs all COGs, but not all RAM in each COG.
Broken Board:
on the working Prop Demo board though:
EDIT: The second listing is identical to the first. Are you sure it's from the working board?
Essentially running:
with or without some LED blinking code in each cog. Cog [0] (main cog) just debugs adcData[2..7] to the serial terminal (cog1)
James
Yes - sorry copy & paste failure. I've updated the post....
Thanks for that - very useful testing.
James
-Phil
Your initial post said that you are having the same errors on the Prop Demo board as on your board. Then what is the cause on the Demo Board? Now that it is known that the other has bad cog mem.
Anyone have an idea what would cause this?
I think I'll save Dave's memory test program in case any of my Props start acting strange.
But a couple posts down Javalin mentions that is does run ok on the Demo board. There is a typo in the first post...
Bad testing on my part - sure I tested both the same, but must of made a mistake. The Demo board is fine for total clarification.