Parallax Serial Terminal
bcrem
Posts: 2
Hi folks,
So I'm using the PST for debugging; just wondering if anyone knows how to use if for multiple cogs. Once I have the object in my main cog, can I pass an address to other cogs I spin off, so I can see debug output from them as well? Obviously I'd have to watch out for one cog's output stomping on anothers...still, I'd rather have too many talking than just one.
Any code examples of this kind of usage?
Thanks in advance,
Bill
So I'm using the PST for debugging; just wondering if anyone knows how to use if for multiple cogs. Once I have the object in my main cog, can I pass an address to other cogs I spin off, so I can see debug output from them as well? Obviously I'd have to watch out for one cog's output stomping on anothers...still, I'd rather have too many talking than just one.
Any code examples of this kind of usage?
Thanks in advance,
Bill
Comments
Main HUB RAM is available to all COGs. The following example is running in the top object. Temp is a memory pointer returned from the "Request" child object. The repeat loop prints out 256 bytes in 10 byte rows starting at the memory address stored in temp.
If you need to view PASM variables, then do much the same. Write the value to HUM memory then expose the memory through a method. I use PASD for low level PASM debugging as PASD provides a COG memory view. There is also ViewPort.
If you have multiple objects reading and writing to main ram then you'll need to use memory locking. Else you will have unexpected results and debugging will be a challenge.
See the sections on byte[], word[], and long[] in the Propeller manual.
cserial.spin is attached below. It also contains other routines such as start1, rx1, tx1 that are used to create additional serial ports, but you should probably stay away from using those.
Dave