Shop OBEX P1 Docs P2 Docs Learn Events
Question about demo code for Paralax Memory Card 40004 — Parallax Forums

Question about demo code for Paralax Memory Card 40004

Don MDon M Posts: 1,652
edited 2014-02-02 20:00 in Propeller 1
I have been playing around with the demo code for the memory card. I downloaded it from the product page.

I think there is a problem with it but I can't seem to figure it out. When you run the demo it is supposed to show the number of blocks free in the Flash chip. The flash chip on my memory card is a Winbond W25Q32DW in the 8 pin version.

On PST it shows 0 blocks. I am able to store the Hello message to memory and erase it but I don't see why it does not report the number of blocks.

Here is the code portion the I wonder about:
if Blocks := Memory.Start(spiClk, spiDI, spiDO, spiCSflsh, spiCSsram, spiWP, spiHOLD) < 1
    ' There was no response from the correct flash device
    Term.Str(string("Flash memory is inaccesible.", CR))
    abort

  ' Display number of free blocks
  Term.Str(string(CR, "Flash memory has "))
  Term.Dec(Blocks)
  Term.Str(string(" blocks.", CR))   

I'm wondering if the driver is the correct one for the flash chip that Parallax uses on the card.

Any help? I have attached the demo from the product page.

Thanks.
Don

Comments

  • kuronekokuroneko Posts: 3,623
    edited 2014-02-02 19:54
    From a quick glance, < is stronger than := so it should read if (Blocks := Memory.Start(spiClk, spiDI, spiDO, spiCSflsh, spiCSsram, spiWP, spiHOLD)) < 1
  • Don MDon M Posts: 1,652
    edited 2014-02-02 20:00
    Thanks Kuroneko! That fixed it. Parallax needs to update the demo.
Sign In or Register to comment.