Problem with passing HUB RAM address to PASM executed in different COG
in Propeller 1
Hey there,
it's me again ^^ I'm entcountering a problem(only 0 read) when trying to pass a HUB RAM address to PASM executed in a different COG. Here's an example I've made up to show what I'm doing(I saw something like this in the CMUCam4 firmware):
Thanks in advance if you can help me,
DragonRaider5
it's me again ^^ I'm entcountering a problem(only 0 read) when trying to pass a HUB RAM address to PASM executed in a different COG. Here's an example I've made up to show what I'm doing(I saw something like this in the CMUCam4 firmware):
CON _EXAMPLE_LONG_ARRAY_SIZE = 20
VAR long testArray[_EXAMPLE_LONG_ARRAY_SIZE]
PUB main
testArrayPointer := @testArray
cognew(@EXAMPLE_PASM, 0)
DAT
org 0
EXAMPLE_PASM rdlong tmp, testArrayPointer
' work with the tmp buffer
djnz counter, #EXAMPLE_PASM
testArrayPointer long 0
counter long _EXAMPLE_LONG_ARRAY_SIZE
tmp res 1
Thanks in advance if you can help me,
DragonRaider5

Comments
actually I'm incrementing the pointer by 4 every time I loop. The problem is, that I write to the long array in a different COG, then I stop the COG, read the long from my main SPIN code(where it displays me valid data) and then when I read it again in the way which is shown in the example it only reads 0s
'Better to show more of your code.
-Phil