sd card buffer
Owen
Posts: 100
I hope this isn't too basic...
I'm having trouble trying to create an sd card buffer between two cogs. What I want to do is have one cog dump data into an array and have a second cog see the data and store it into the sd card. Despite searching the forums and the object exchange I haven't come across an example of explanation of how to do this. I don't now how to keep track of where in the array the sd cog should be reading and what array index the writing cog should write into. is there an easier, faster better way than using an array as the buffer?
thanks,
Owen
I'm having trouble trying to create an sd card buffer between two cogs. What I want to do is have one cog dump data into an array and have a second cog see the data and store it into the sd card. Despite searching the forums and the object exchange I haven't come across an example of explanation of how to do this. I don't now how to keep track of where in the array the sd cog should be reading and what array index the writing cog should write into. is there an easier, faster better way than using an array as the buffer?
thanks,
Owen
Comments
I think this is from the thread you refer to but i'm a bit confused as to how you know when the buffer is full or empty. also i don't entirely understand the use of putPtr &= $3F is this creating a bit mask? how does this work/help? if I dont want a delay in the buffer am I right that putptr and getptr would both be initialized to 0? sorry for all the questions but the code has no comments so I'm still trying to understand.
thanks for the help
Owen
When you want to call these routines from different COGs you would need LOCKs however..