Memory Issue
DragonRaider5
Posts: 13
Hi,
I have a problem using some memory in the HUB RAM from different COGs. I'm relatively new to SPIN and PASM so I'm sorry if the mistake I made is stupid ^^ here is an example of what I'm doing(and what doesnt work):
main.spin:
test.spin:
The result is, that some random stuff gets written to the Serial Port but not the value I'm looking for("A", which equals 65). I also checked my function which converts the values which are meant to be displayed(in my real program) but it seems to work properly.
Thanks in advance and if you need any additional information don't bother asking me
PS.: Sorry for the bad formatting. Idk how to do it better in this editor :P
I have a problem using some memory in the HUB RAM from different COGs. I'm relatively new to SPIN and PASM so I'm sorry if the mistake I made is stupid ^^ here is an example of what I'm doing(and what doesnt work):
main.spin:
OBJ test: "test.spin" com: "Full-Duplex_COMEngine.spin" PUB main | pointer test.writeToBuffer pointer := test.getBufferPointer 'ignore the fact that it takes some time to start the cog and to write the byte in the "new" cog as this is just an abstracted example :P com.writeByte(pointer.byte[0])
test.spin:
VAR long buffer[1] DAT org 0 WRB_start mov bufferPointer, par mov tmp, #%0100_0001 '65 wrbyte tmp, bufferPointer cogid tmp cogstop tmp tmp res 1 bufferPointer res 1 PUB writeToBuffer cognew(@WRB_start, @buffer) PUB getBufferPointer return @buffer
The result is, that some random stuff gets written to the Serial Port but not the value I'm looking for("A", which equals 65). I also checked my function which converts the values which are meant to be displayed(in my real program) but it seems to work properly.
Thanks in advance and if you need any additional information don't bother asking me
PS.: Sorry for the bad formatting. Idk how to do it better in this editor :P
Comments
Try this:
Andy
thanks a lot! What a mistake hahaha I'll learn from it have a nice day!
DragonRaider5