Porting SST25VF080B Sample Driver to Spin

I recently purchased some Microchip SST25VF080B Memory for use with my Parallax Propeller MCU.

I downloaded the Microchip driver sample software and tried to port it to Spin.

The sample code (I think its C) can be found below
So too can the Spin code which I translated from C to Spin.

I'm kind of mostly happy at the port, I think I covered 95% + of the statements.

Now that its converted, I can see and understand it, to a degree, but not completely...

And I'm left with the following questions:

1. Why is there no error checking?

Surely before I write to the ram I need to check if its busy etc but I don't see that in the reference sample.

The Spin code compiles without any errors.

But I cant help but think...
What happens if I write Like 1K to 1Mb or more to the ram
And then a another process requests to read/write data.

Maybe this catered for already in the C,
but since I lack C skills
I thought to ask the community here...

Really, what I would be happy with,
is to know if the driver will work or not?
And where I need to place checks to ensure read/write collisions (and subsequent crashes) do not occur.

I'm not sure If I can paste all the code in to this question,
So I have included both the microchip reference sample driver
and the ported spin code driver as files.

Thank You for looking.


Sign In or Register to comment.