Of the 3 options shown I like the one with the SDCard added the best.
Having clean chip select is important to me. If necessary we can use a lock to protect the clock.
Also it may be useful to have pull-ups on Data2/3 for the hold/write protect disable.
Another advantage of having the SDCard added is for sales to bread-board or other users.
It becomes a general solution.
The one problem I see is that fsrw (last time I checked) doesn't always leave the SD MISO pin in the tristate condition... So, you'd have a pin contention problem. I've heard that modifying fsrw to send extra clocks can fix that though. Still, I think I like your first option best.
If you're not doing a full 8-bit bus on P0..P7, I don't think you gain a whole lot (in general) on having a 4 bit bus on P0..P3.
Maybe you can move the flash CS to P1 and clock to P2? Wait... That doesn't work...
It's late here, but I don't immediately see how to make it work...
Maybe I'd drop back to just one SPI SRAM so the clock can be on the 4 bit bus somewhere...
Another option is just use SPI flash and non-volatile SPI sram and make life simple...
Or, maybe make so it can be SQI flash with no SRAM or SPI flash and SRAM...
Even if you could fix fsrw, it might still be a challenge because it does background caching. Doesn't that make it hard to know when the pins are free?
I switched the battery socket out with a two-pin socket. I wasn't planning on including a battery to keep costs down, but including the socket without the battery would probably seem a little unkind.
I added the microSD card socket using the second pinout I posted, connected as another SPI device with every device having a dedicated Chip Select pin. I have attached a copy of the schematic and layout. It should work in the Human Interface Board, a breadboard, or with a simple modification, soldered into a Propeller Proto Board.
Does anyone see anything that should change, or is it ready for a prototype run?
I might modify the board to support the flash in a 16-pin SOIC package, because it tends to be cheaper than the 8-pin package for the same die.
I have a few prototypes built up with this pinout:
Propeller
Flash SRAM SD Card
P0
Data 0
Data 0
Data In
P1
Data 1
Data 1
Data Out
P2
Data 2
Data 2
—
P3
Data 3
Data 3
—
P4
Clock
Clock
Clock
P5
Chip Select
—
P6
—
Chip Select
—
P7
—
—
Chip Select
I also have DAT1 and DAT2 from the microSD card each connected to a 1-pin unpopulated socket on either side of the socket itself. (See images at http://forums.parallax.com/showthread.php/147152) I realized that when the microSD card is in use, P2 and P3 aren't doing anything, so I could connect DAT1 and DAT2 to them. I also noticed DAT3 is shared with the Chip Select pin, and DAT0 is shared with the Data Out pin, so I can swap the microSD Chip Select pin with the shared clock pin, and have DAT0 through DAT1 in sequential order. like this:
Propeller
Flash SRAM SD Card
P0
Data 0
Data 0
Data In / Command
P1
Data 1
Data 1
Data Out / DAT0
P2
Data 2
Data 2
DAT1
P3
Data 3
Data 3
DAT2
P4
—
—
Chip Select / DAT3
P5
Chip Select
—
—
P6
—
Chip Select
—
P7
Clock
Clock
Clock
No one has written Propeller drivers for 4-bit mode, as it is somewhat difficult and complex. (See the Latest Simplified Specifications.) In fact, the separate CRC for each data line would make it impractically slow on a lesser microcontroller, but the Propeller could assign a cog to each data line and perform the CRCs in parallel. Anyway, if someone gets around to implementing it, it would be a resource hog, but it could approach the speeds of quad-SPI flash. I would like the Propeller Memory Card to support 4-bit SD mode, should someone write the driver, and this would allow it to happen without soldering and without added costs or drawbacks.
— David Carrier
Parallax Inc.
Edit: I'm also going to add 100 k ohm pull-up resistors to the !CS pins on the quad-SPI devices to ensure the devices are disabled during start-up and when the select lines are otherwise uninitialized.
Comments
Of the 3 options shown I like the one with the SDCard added the best.
Having clean chip select is important to me. If necessary we can use a lock to protect the clock.
Also it may be useful to have pull-ups on Data2/3 for the hold/write protect disable.
Another advantage of having the SDCard added is for sales to bread-board or other users.
It becomes a general solution.
Thanks,
--Steve
If you're not doing a full 8-bit bus on P0..P7, I don't think you gain a whole lot (in general) on having a 4 bit bus on P0..P3.
Maybe you can move the flash CS to P1 and clock to P2? Wait... That doesn't work...
It's late here, but I don't immediately see how to make it work...
Maybe I'd drop back to just one SPI SRAM so the clock can be on the 4 bit bus somewhere...
Another option is just use SPI flash and non-volatile SPI sram and make life simple...
Or, maybe make so it can be SQI flash with no SRAM or SPI flash and SRAM...
I added the microSD card socket using the second pinout I posted, connected as another SPI device with every device having a dedicated Chip Select pin. I have attached a copy of the schematic and layout. It should work in the Human Interface Board, a breadboard, or with a simple modification, soldered into a Propeller Proto Board.
Does anyone see anything that should change, or is it ready for a prototype run?
I might modify the board to support the flash in a 16-pin SOIC package, because it tends to be cheaper than the 8-pin package for the same die.
David Carrier
Parallax Inc.
Propeller
Flash
SRAM
SD Card
P0
Data 0
Data 0
Data In
P1
Data 1
Data 1
Data Out
P2
Data 2
Data 2
—
P3
Data 3
Data 3
—
P4
Clock
Clock
Clock
P5
Chip Select
—
P6
—
Chip Select
—
P7
—
—
Chip Select
I also have DAT1 and DAT2 from the microSD card each connected to a 1-pin unpopulated socket on either side of the socket itself. (See images at http://forums.parallax.com/showthread.php/147152) I realized that when the microSD card is in use, P2 and P3 aren't doing anything, so I could connect DAT1 and DAT2 to them. I also noticed DAT3 is shared with the Chip Select pin, and DAT0 is shared with the Data Out pin, so I can swap the microSD Chip Select pin with the shared clock pin, and have DAT0 through DAT1 in sequential order. like this:
Propeller
Flash
SRAM
SD Card
P0
Data 0
Data 0
Data In / Command
P1
Data 1
Data 1
Data Out / DAT0
P2
Data 2
Data 2
DAT1
P3
Data 3
Data 3
DAT2
P4
—
—
Chip Select / DAT3
P5
Chip Select
—
—
P6
—
Chip Select
—
P7
Clock
Clock
Clock
No one has written Propeller drivers for 4-bit mode, as it is somewhat difficult and complex. (See the Latest Simplified Specifications.) In fact, the separate CRC for each data line would make it impractically slow on a lesser microcontroller, but the Propeller could assign a cog to each data line and perform the CRCs in parallel. Anyway, if someone gets around to implementing it, it would be a resource hog, but it could approach the speeds of quad-SPI flash. I would like the Propeller Memory Card to support 4-bit SD mode, should someone write the driver, and this would allow it to happen without soldering and without added costs or drawbacks.
— David Carrier
Parallax Inc.
Edit: I'm also going to add 100 k ohm pull-up resistors to the !CS pins on the quad-SPI devices to ensure the devices are disabled during start-up and when the select lines are otherwise uninitialized.