Usage of the 8 (or 6?) Special Pins on/after Boot-up, P84-P91 (or P86-P91?)
JRetSapDoog
Posts: 954
The Prop 2 Specifications summary on Parallax Semiconductors site mentions, "92 I/O pins total: 84 fully general purpose I/O + 8 additional general purpose I/O available after boot-up."
From one of the Prop 2 module documents that Chip provided, the following pin assignments are detailed:
P91 RX
P90 TX
P89 SPI_CS
P88 SPI_CK
P87 SPI_DI
P86 SPI_DO
P85 ???
P84 ???
I see that P84 and P85 are assigned for the module with the 32MB SDRAM as CLK and LED, respectively (for the SDRAM and an indicator?). But I don't know the usage for these pins if not using the external memory chip. Are they fully general purpose, or is there something special about them on boot-up?
Also, for the module Parallax is planning, P86-P89 connect to an 8MB SPI flash chip. Is this SPI usage fixed in the built-in 2K ROM?
Lastly, even with an SPI flash chip connected as above, I'm wondering if P86-P88 could also be wired (in parallel) to an SD card, providing one of the general purpose Prop 2 pins was used to drive the CS input of the card.
That is, assuming that one doesn't want to access an SPI Flash chip and an SD card at the same time, could P86-P88 pull "double duty" to access the flash chip and the SD card (though not at the same time and assuming proper initialization)?
And, if so, what would the approximate turn-around time be to switch from one to the other. I recall reading that to initialize an SD card, you have to send a lot of clock pulses to it. But I guess there's nothing that says it has to be constantly mounted, or there wouldn't be unmount commands in the SD card objects. Does anyone see any problems having both an SPI flash chip and an SD card in the same system sharing P86-P88, or, at the very least, booting from the flash chip and subsequently using the SD card?
From one of the Prop 2 module documents that Chip provided, the following pin assignments are detailed:
P91 RX
P90 TX
P89 SPI_CS
P88 SPI_CK
P87 SPI_DI
P86 SPI_DO
P85 ???
P84 ???
I see that P84 and P85 are assigned for the module with the 32MB SDRAM as CLK and LED, respectively (for the SDRAM and an indicator?). But I don't know the usage for these pins if not using the external memory chip. Are they fully general purpose, or is there something special about them on boot-up?
Also, for the module Parallax is planning, P86-P89 connect to an 8MB SPI flash chip. Is this SPI usage fixed in the built-in 2K ROM?
Lastly, even with an SPI flash chip connected as above, I'm wondering if P86-P88 could also be wired (in parallel) to an SD card, providing one of the general purpose Prop 2 pins was used to drive the CS input of the card.
That is, assuming that one doesn't want to access an SPI Flash chip and an SD card at the same time, could P86-P88 pull "double duty" to access the flash chip and the SD card (though not at the same time and assuming proper initialization)?
And, if so, what would the approximate turn-around time be to switch from one to the other. I recall reading that to initialize an SD card, you have to send a lot of clock pulses to it. But I guess there's nothing that says it has to be constantly mounted, or there wouldn't be unmount commands in the SD card objects. Does anyone see any problems having both an SPI flash chip and an SD card in the same system sharing P86-P88, or, at the very least, booting from the flash chip and subsequently using the SD card?
Comments
On PropCade I use 7 pins to provide for eight SPI devices. Three pins select the SPI device (0-7), then we have the regular /CS,CLK,MOSI,MISO
The devices are: 6 SPI Flash/Ram sockets, MCP23S17 I/O expander and a uSD slot.
Sure, use P83 (or choice of pin) as the SD_Cards CSn and as SD_cards have 50k pull-up you don't have to worry that during boot-up the pin is input.
I would assume you would have to put a 1meg pull-down on this line if you want to use card detect function.
3) At power up this line has a 50KOhm pull up enabled in the card.
This resistor serves two functions Card detection and Mode Selection.
For Mode Selection, the host can drive the line high or let it be pulled high to select SD mode.
If the host wants to select SPI mode it should drive the line low.
For Card detection, the host detects that the line is pulled high.
This pull-up should be disconnected by the user, during regular data transfer, with SET_CLR_CARD_DETECT (ACMD42) command
The SD Card is powered up in the SD mode.
It will enter SPI mode if the CS signal is asserted (negative) during the reception of the reset command (CMD0).
Yes, PropCade is available - and I am dropping the price of the "Essentials" kit to $29+s/h, and the "128K" kit to $99+s/h (descriptions of kit contents on the product page)
I will be re-calculating my BOM costs, and coming up with some intermediate kit versions for those that don't need the RTC / RS485 / SVideo / IR in+out / Atari joystick ports.
The Microchip 128kx8 SRAM's would work fine on it, as will standard pinout spi flash parts (up to the 64Mbx8 smt parts) - with the six memory sockets, 512KB of ram and 128MB of flash is easy
Pretty much any cheap USB-serial converter works with PropCade (it has an on-board MAX3232 and DB9F) for programming, or for use as a terminal replacement, however if the MAX chip is removed, it also has a PropPlug compatible connector.
Here is the link to the product page:
http://www.mikronauts.com/propcade/
Thanks, Tony, for those comprehensive details for connecting the SD card. I'll probably have to revisit these later to fully appreciate the details (particularly if there's H/W or S/W differences from standard usage), but I'll know where to look. BTW, so far, I've just used a/the dedicated 4-pin interface and ignored the optional card detection (even if bad form, though I recall Rayman has a clever setup).
Hmm...what am I saying! I don't even think there's an SD object for the P2 at this point (and writing/converting that is above my pay grade). Does anyone know if a conversion/port is in the works? I have no idea how timing-sensitive the code is (and the P2 will be much faster). I know, I know, first things first: chip, loader, Spin and so on. There was a pretty big debate at one time whether to include SD functionality into the firmware, but, ultimately that was decided to not be the best approach.
Lastly, does anyone know the status of P84 & P85 on boot-up (if using a P2 without the SDRAM)? Are there 8 "special" pins on boot-up or just 6? If the answer is 8, I've overlooked or lost track of the usage for those other 2. If just 6, then the summary document could be reworded at some point to reflect that.
There is already a port of Prop GCC for the P2, including SD card driver.
Andy
So, there's already a port of Prop GCC for the P2 that includes the SD card driver, huh? That's good (I think that I do recall reading something about one-line of code setting up an SD card driver on the P1 version). I wonder if the SD card portion of the code was ported by someone in the Parallax community from one of the existing P1 PASM drivers, or if the port came from some other (hopefully unencumbered) source out in cyberspace. Either way, if a high-level language is being used, it sounds like the timing doesn't require assembly (i.e., is not so critical/tight). Still, I wonder if a PASM2 version (with a SPIN2 interface) will be released.