Is this a bad idea for prop ?
BTX
Posts: 674
Hi all.
I've an application where my prop memory is out. And I can't use a SD in this.
Is a bad idea to connect two eeproms, both with A0 line connected to a inverter, and reset the prop each time I want to use a different software (each one store in each eeprom). also selecting the inverterd input, to change the currently working eeprom, with another hardware part ??
I would think too, in add a serial SPI SRAM to the prop, to share data between the two eeprom softwares.
I've an application where my prop memory is out. And I can't use a SD in this.
Is a bad idea to connect two eeproms, both with A0 line connected to a inverter, and reset the prop each time I want to use a different software (each one store in each eeprom). also selecting the inverterd input, to change the currently working eeprom, with another hardware part ??
I would think too, in add a serial SPI SRAM to the prop, to share data between the two eeprom softwares.
Comments
KK
It might be easier to use a larger EEPROM (64K or 128K) and have the default program (in the 1st 32K) check a spare I/O pin for a switch setting and either continue with the rest of the program that's already loaded or use something like sdspiFemto.spin to load a program from the 2nd 32K of EEPROM (or 3rd or 4th 32K areas of a 128K EEPROM).
An SPI SRAM could be used to hold data. Alternatively, if you only have a few bytes of data (< 56), you could use the SRAM in a DS1307 RTC and use the same I/O pins used for the EEPROM.
Mike said: check a spare I/O pin for a switch setting and either continue with the rest of the program......
Sorry I can't understand what you mean with that ?..
Mike. Anyway I will take a look to sdspiFemto.spin to learn how you did that.
About the SRAM I need it's 24KB, so I choose some SPI SRAM from microchip of 32KB, this is for store samples of a signal, my samples come each 1mSeg.
It sounds like you have several programs or one large program that you want to split into several programs. You have two issues:
1) Where do you store your data?
2) How do you execute one program after another?
You can use SPI SRAM to store your data between phases of your program. Each SRAM will hold 32K and you can attach several of them using one select I/O pin per SRAM plus 3 other I/O pins for Clock, MOSI, and MISO.
If you don't need to write the data frequently, you could use an SPI Winbond Flash Memory to hold your data. These come in 1MB through 8MB sizes and there's an I/O driver in the Object Exchange that will support one of these plus up to two SRAMs. It organizes the Flash Memory into files and you can have more than one file open at a time. You can even store your programs on the Flash Memory and load them as needed by name.
If you don't want to use the Flash Memory, you could use a 64K or 128K EEPROM instead of the standard 32K one (or just add additional EEPROMs on the same 2 I/O pins). As I mentioned, the sdspiFemto.spin driver will load programs from any attached 32K EEPROM area.
It's not clear for me if "sdspiFemto.spin" uses an SD card; I can't use it on this design.
All about memories that you comment above, is clear for me now.
FemtoBasic has statements for copying programs from one area of EEPROM to another (COPY). You download your program to the 1st 32K of EEPROM, then download a copy of FemtoBasic to RAM and use that to copy the 1st 32K of the EEPROM to some other 32K portion of EEPROM like:
COPY [0],[$8000]
This copies the 1st 32K to the 2nd 32K of a 64K EEPROM.
I also have a version of FemtoBasic that uses a Winbond Flash Memory instead of an SD card and can do the same sort of copying between EEPROM and the Flash Memory.
I've just download it from OE and now I understand and can see it more clearly !!!
Great idea from you !!!, no needs to add any jumper, just what it's do, is simply copy from one address to another one, reboot and voila !!
I suppose a 24LC1025 would work fine for this, it's 128Kx8.
One possibility is to have both programs in EEPROM and use the lower 32KB for the current program/version, as you said.
That may lead to corruption of you boot image (after a power loss).
Better would be to have 3 programs in EEPROM. The first 32kbytes are a bootloader that will load either of the 2 real programs depending on the status of a pin (what Mike proposed).
But, if you combine this bootloader with your application you can somewhere in your program select to load the other version replacing the contents of the HUB and without resetting the propeller, and then relaunching the COGs that need relaunching.
But, if you just need some extra space for data but your code fits in memory... go for the simplest solution, add an external serial SRAM/FLASH.
Yes, while reading the Mike code in sdspiFemto, I was discovering what he and you mean with this.
Correct, I don't need to do a rebbot, and using the first 32K with the bootloder prevent the corruption if a power lost happend. (I was not noticed of that before).
As I need about 32KB to store the samples of an external signal (ADC do that), I should use a serial SRAM for that, plus the bootloader method, to get a code enough long to achieve all calculus that I need to do, after get the samples. This is analisys of the signal, menu of the software, control my PropToCpld, etc, etc.