Propeller Memory Card - QPI mode very slow???
RossH
Posts: 5,462
Hi,
I've recently been testing some Catalina drivers for the Propeller Memory Card, and I've noticed some VERY odd behavior. At first, I thought my drivers were not working at all, but it turns out they are - I just had not left them running for long enough!
It seems that when the FLASH chip is set to QPI mode, the Sector Erase ($20) and Chip Erase ($C7) operations just take a very, very long time!
Here is what I am seeing ...
In SPI mode:
If I leave my drivers running for long enough (as I just happend to do tonight) they work fine - but 2 hours??? This seems very bizarre!
The Parallax demo programs for this board only use SPI mode - does anyone have any working QPI code for erasing the FLASH chip on this board that might tell me what I am doing wrong???
Ross,
I've recently been testing some Catalina drivers for the Propeller Memory Card, and I've noticed some VERY odd behavior. At first, I thought my drivers were not working at all, but it turns out they are - I just had not left them running for long enough!
It seems that when the FLASH chip is set to QPI mode, the Sector Erase ($20) and Chip Erase ($C7) operations just take a very, very long time!
Here is what I am seeing ...
In SPI mode:
Erasing a 4k block : < 0.1 second
Erasing the entire chip : 10 seconds
In QPI mode:
Erasing the entire chip : 10 seconds
Erasing a 4k block : 30 seconds!
Erasing the entire chip : 2 hours!
Erasing the entire chip : 2 hours!
If I leave my drivers running for long enough (as I just happend to do tonight) they work fine - but 2 hours??? This seems very bizarre!
The Parallax demo programs for this board only use SPI mode - does anyone have any working QPI code for erasing the FLASH chip on this board that might tell me what I am doing wrong???
Ross,
Comments
Edit: I've attached a zip file containing the PropGCC external memory driver for the PMC.
pmc.zip
The main difference I can see between your code and mine is that your code seems to use bit 7 as the busy bit:
My data sheet for the W25Q32 (and also the Parallax demo code) indicates the busy bit is bit 0.
Ross.
Thanks, David - yes, I missed that also.
Everything seems fine in QPI mode except for the Sector Erase and Chip Erase commands (well, they work, but they take far too long to be useful!). So for the moment I will just leave it like that - i.e. for those two commands only, I will revert to SPI mode.
If you ever do convert your driver to use QPI mode for these commands, I'd be interested to see what times you get.
Ross.
Thanks,
David
Can you share the code you are using for the QPI mode?
One thing I thought of, which is just a guess and may be silly to ask, but I'll ask it anyway. Is it possible that you are not leaving CS high long enough after issuing the erase command before you try to read the status register (which will bring CS low again? The datasheet says it needs to be high for 50ns to deselect.
Also, have you tried using the larger block erase commands? or the whole chip erase command?
I was concerned if you were setting it high, and then in the very next instruction setting it low. Which would be right at the 50ns edge and might have been an issue, but your code has several instructions between setting it, so the timing is not the issue.
Although, the release function uses pinout and pindir that I assume are defined someplace else. Is this resulting in CS being set high, or is it letting it float? Is there a pullup on the CS line?