TopObject memory and FDS StartUp question.
CannibalRobotics
Posts: 535
How does one determine the 'stack' usage of the top object?
With other objects, there is a stack address and size that can be used.
If I want to start and stop FullDuplex serial to change the i/o pin numbers to communicate with multiple devices, how long should I wait to send data after calling the start. I'm thinking in SPIN terms it's pretty quick since it's a PASM object.
Thanks in advance-
With other objects, there is a stack address and size that can be used.
If I want to start and stop FullDuplex serial to change the i/o pin numbers to communicate with multiple devices, how long should I wait to send data after calling the start. I'm thinking in SPIN terms it's pretty quick since it's a PASM object.
Thanks in advance-
Comments
Anyway FullDuplexSerial uses a sendbuffer. This means if you want to send characters they get stored in the buffer. This storing is done by the SPIN-cog who calls the methods str, dec, bin etc. As long as you don't "overfill" the sendbuffer I guess you can start immediatly.
keep the questions coming
best regards
Stefan
When you say "TopObject" I think you really mean "cog 0". Each Spin cog requires it's own stack. The first cog that starts up will use the memory immediately after the VAR space for it's stack. This stack could extend all the way to the end of hub RAM, though most programs use less than 100 longs for their stack. In your other thread about Stack Posers I posted some code that measures cog zero's stack usage. WritePattern put's a known pattern in cog zero's stack area. StackUsed will return the number of bytes that have been used. WritePattern must be called from cog 0, but StackUsed could be called from another cog, which could continually montor cog zero's stack.
As far as FDS. You can write to it immediately after you call the start routine. The data will queue up in the outbound buffer, and TX will wait if the buffer gets full.
Dave