SD Card as EEPROM Substitute or Replacable Power-On Boot Medium with Extra Data
he1957
Posts: 58
Apologies for the longish Subject line.
I have been examining the circuit diagrams/schematics/printsets and power-up sequences for the Propeller chip and observe the connections and boot sequences for power-up ROM code that uses P28 and P29 for SCL and SDA respectively.· This prompts me to ask the following:
1. Any reason why an SD card could not be used as a substitute for·the "dedicated" EEPROM
Given the specific size of·the "default" EEPROM is "fixed" at 32KB (to match the Prop's internal memory size) and references are made to the ability to use larger EEPROM sizes:
2. What would be the memory size limit of either an EEPROM or some "other" (SD Card) device?
The FemtoBasic Interpreter (with LOTS of thanks and enormous gratitude to those contributors [noparse][[/noparse]it is an absolutely _fantastic_ piece of work!]) contains commands that reference both EEPROM and an SD card so:
3. How does one (easily?) keep track of the use of the EEPROM use [noparse][[/noparse]either at or greater than 32KB] (when not using the simple "save" command (in FemtoBasic) [noparse][[/noparse]or other {SPIN perhaps?} methods which I have yet to discover]?
Thanks in advance,
HarryE.
·
I have been examining the circuit diagrams/schematics/printsets and power-up sequences for the Propeller chip and observe the connections and boot sequences for power-up ROM code that uses P28 and P29 for SCL and SDA respectively.· This prompts me to ask the following:
1. Any reason why an SD card could not be used as a substitute for·the "dedicated" EEPROM
Given the specific size of·the "default" EEPROM is "fixed" at 32KB (to match the Prop's internal memory size) and references are made to the ability to use larger EEPROM sizes:
2. What would be the memory size limit of either an EEPROM or some "other" (SD Card) device?
The FemtoBasic Interpreter (with LOTS of thanks and enormous gratitude to those contributors [noparse][[/noparse]it is an absolutely _fantastic_ piece of work!]) contains commands that reference both EEPROM and an SD card so:
3. How does one (easily?) keep track of the use of the EEPROM use [noparse][[/noparse]either at or greater than 32KB] (when not using the simple "save" command (in FemtoBasic) [noparse][[/noparse]or other {SPIN perhaps?} methods which I have yet to discover]?
Thanks in advance,
HarryE.
·
Comments
SD cards use SPI protocol, totally different, plus need an initialization process to get them into SPI mode. However, it is possible to boot to a bootloader that can read SD, then boot again from the SD card from whatever of many files you want (see the OBEX femtobasic, PropDOS, and my own PropCMD).
On keeping track of EEPROM use, you have to do that yourself; there's no fixed protocol except that the lower 32K will boot the Prop.· I tend to favor leaving the EEPROM to its own devices and using SD for all mass storage, as it's much more versatile.
Advantage:
1. You only have to boot once - having a bootloader means to load the prop twice
2. You save 2 PINs
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
I have been looking at the PIC10F2xx in SOT23 6pin packages but I do not think there is enough space for prop bootstrap code after the I2C protocol program in the pic. see the PIC Programming thread.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBladeProp, RamBlade, TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80), MoCog (6809)
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
2) There was a version of FemtoBasic that used the last 16 bytes of each 32K area in EEPROM to store a file name. In the interest of code space, this facility was removed, also because an SD card would furnish the same functionality.
When I have time, I (or anyone up to the task) can/will write (extract) the minimum code (for the eeprom or to be loaded by something else simulating an eeprom) to boot PropDos which would then be capable of asking for a binary to run. This would mean that the eeprom code could be a "standard" object which only requires the pin to the SD card to be provided. Although this boot process would be a two stage process, I am sure it would be a worthwhile project.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBladeProp, RamBlade, TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80), MoCog (6809)
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
PropDos and PropCMD and sdspiFemto already does this process and the new fsrw would be even better. I would really like to see if it could be done in 0.5KB but have no idea if it can be done this small yet.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBladeProp, RamBlade, TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80), MoCog (6809)
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
localroger: The reason I want minimum code space is that I am trying to replace the eeprom with a miniature micro (pic or mc9s08). Once the prop boots from the SD card, I don't want the eeprom present as I am using the pins for a data bus.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBladeProp, RamBlade, TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80), MoCog (6809)
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
If you use the "bootblock" convention of the FAT file system, you could easily store a 32K Spin program in the MSDOS compatible boot area of the FAT volume. The assembly loader function in sdspiFemto can easily be stripped out and, with a small Spin prefix, could easily fit in 1K in some little micro that's emulating an I2C EEPROM that disconnects itself completely after doing its job (until the next reset).
Jimmy
Jimmy: This sounds even better Boot straight off the SD.
It would need a larger micro with more pins, but certainly would be doable, but it would need to jump out of the way after initial booting, and back in again on reset. In this instance, it would also be possible to use the download pins and protocol of SI/SO (pins 30/31) instead of the eeprom emulation. Not sure which would be faster or more compact.
Thinking a little further, it may not be fast enough to get the code from the SD card and be ready to emulate the eeprom in the time the prop is ready for it, so downloading may have to be used.
Anyone care to comment??
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBladeProp, RamBlade, TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80), MoCog (6809)
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
The idea is that booting would be a multistep process. The boot mini-micro would emulate an I2C EEPROM containing a small (<1K) SD card bootloader that would load (and start) a Spin program up to 32K off an SD card beginning at a fixed location. This Spin program could be the complete application or might be an operating system or file loader that would load a FAT file with a specific name from the SD card.
Once the mini-micro is done, it could drop into a mode where it uses one of the I2C lines (like SCL - pin 28) for the SD card select and just copies it to the SD card select line. It would leave the SD card unselected until then so the SD card could be connected to I/O pins 28-31.
dd is your friend. Provided the space on the card is unused (like sectors 1-63 on a partitioned card) you can use dd to copy your binary wherever you like. You could comfortably hide a bootloader in there and have a very small fixed-location booter load it and run it.
I have one here that simply looks in the root of the card for boot.bin. If it finds it, it simply loads it and boots into it. If it does not then it falls through to a routine that lets you know it's panicing for a while before re-booting and re-trying. The SD card stuff I'm using is an unmodified copy of sdspiFemto.spin
There is really not a lot to it [noparse]:)[/noparse]
If that routine returns then we've failed and so go into the panic loop before restarting the processor.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lt's not particularly silly, is it?
Currently using the femto drivers is about 6KB. Fortunately, still a bit of code to carve out.
I presume dd is easy to use as we will need to make instructions for it's use if we go this way (boot sectors 1-63 would be 31.5KB) which is almost the complete hub space.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBladeProp, RamBlade, TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80), MoCog (6809)
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
What a great buch of creative and thoughtfull comments and ideas. (Aside: dd if=input_file of=/device/outfile (which can be raw devices [noparse][[/noparse]yes, easy])
Of course I had neglected to "remember" the serial protocols used for EEPROM and SD Card when I asked the original question - duh! None-the-less, Amazing what you people have thought of. OK, similar in theme but either:
1. A minimal EEPROM loader that either prompts for an SD Card filename (assuming it finds one) to load (into RAM) or
2. Same but loads a secondary loader from SD Card and asks or defaults to some image
If no SD Card, the EEPROM routing defaults to the EEPROM.
I guess this prompts the question; can such an EEPROM routine load the target above itself to preserve it from being overwritten (or relocate itself) ? Along same, could such images be loaded elswhere; ie: are Propeller images relocatable?
It looks like PropDOS can do what I was originally thinking of; Boot (loads PropDOS) from EEPROM then allows you to either auto-launch some image into RAM or manually select same.
Cheers,
HarryE.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBladeProp, RamBlade, TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80), MoCog (6809)
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
chers